public class StandardTickUnitSourceTests extends TestCase { /** * Returns the tests as a test suite. * * @return The test suite. */ public static Test suite() { return new TestSuite(StandardTickUnitSourceTests.class); } /** * Constructs a new set of tests. * * @param name the name of the tests. */ public StandardTickUnitSourceTests(String name) { super(name); } /** * Confirm that the equals method can distinguish all the required fields. */ public void testEquals() { StandardTickUnitSource t1 = new StandardTickUnitSource(); StandardTickUnitSource t2 = new StandardTickUnitSource(); assertTrue(t1.equals(t2)); } /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { StandardTickUnitSource t1 = new StandardTickUnitSource(); StandardTickUnitSource t2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(t1); out.close(); ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( buffer.toByteArray())); t2 = (StandardTickUnitSource) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(t1, t2)
public class ItemLabelPositionTests extends TestCase { /** * Returns the tests as a test suite. * * @return The test suite. */ public static Test suite() { return new TestSuite(ItemLabelPositionTests.class); } /** * Constructs a new set of tests. * * @param name the name of the tests. */ public ItemLabelPositionTests(String name) { super(name); } /** * Check that the equals() method distinguishes all fields. */ public void testEquals() { ItemLabelPosition p1 = new ItemLabelPosition(); ItemLabelPosition p2 = new ItemLabelPosition(); assertEquals(p1, p2); } /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { ItemLabelPosition p1 = new ItemLabelPosition(); ItemLabelPosition p2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(p1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); p2 = (ItemLabelPosition) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(p1, p2)
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/StandardTickUnitSourceTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/labels/junit/ItemLabelPositionTests.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class StandardTickUnitSourceTests extends TestCase {
1
public class ItemLabelPositionTests extends TestCase {
2
    /**
2
    /**
3
     * Returns the tests as a test suite.
3
     * Returns the tests as a test suite.
4
     *
4
     *
5
     * @return The test suite.
5
     * @return The test suite.
6
     */
6
     */
7
    public static Test suite() {
7
    public static Test suite() {
8
        return new TestSuite(StandardTickUnitSourceTests.class);
8
        return new TestSuite(ItemLabelPositionTests.class);
9
    }
9
    }
10
    /**
10
    /**
11
     * Constructs a new set of tests.
11
     * Constructs a new set of tests.
12
     *
12
     *
13
     * @param name  the name of the tests.
13
     * @param name  the name of the tests.
14
     */
14
     */
15
    public StandardTickUnitSourceTests(String name) {
15
    public ItemLabelPositionTests(String name) {
16
        super(name);
16
        super(name);
17
    }
17
    }
18
    /**
18
    /**
19
     * Confirm that the equals method can distinguish all the required fields.
19
     * Check that the equals() method distinguishes all fields.
20
     */
20
     */
21
    public void testEquals() {
21
    public void testEquals() {
22
        StandardTickUnitSource t1 = new StandardTickUnitSource();
22
        
23
        StandardTickUnitSource t2 = new StandardTickUnitSource
23
ItemLabelPosition p1 = new ItemLabelPosition();
24
();
24
        ItemLabelPosition p2 = new ItemLabelPosition();
25
        assertTrue(t1.equals(t2));
25
        assertEquals(p1, p2);
26
    }
26
    }
27
    /**
27
    /**
28
     * Serialize an instance, restore it, and check for equality.
28
     * Serialize an instance, restore it, and check for equality.
29
     */
29
     */
30
    public void testSerialization() {
30
    public void testSerialization() {
31
        StandardTickUnitSource t1 = new StandardTickUnitSource();
31
        
32
        StandardTickUnitSource t
32
ItemLabelPosition p1 = new ItemLabelPosition();
33
2 = null;
33
        ItemLabelPosition p2 = null;
34
        try {
34
        try {
35
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
35
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
36
            ObjectOutput out = new ObjectOutputStream(buffer);
36
            ObjectOutput out = new ObjectOutputStream(buffer);
37
            out.writeObject(t1);
37
            out.writeObject(p1);
38
            out.close();
38
            out.close();
39
            ObjectInput in = new ObjectInputStream(
39
            ObjectInput in = new ObjectInputStream(
40
new ByteArrayInputStream(
40
                    new ByteArrayInputStream(
41
                    buffer.toByteArray()));
41
buffer.toByteArray()));
42
            t2 = (StandardTickUnitSource) in.readObject();
42
            p2 = (ItemLabelPosition) in.readObject();
43
            in.close();
43
            in.close();
44
        }
44
        }
45
        catch (Exception e) {
45
        catch (Exception e) {
46
            e.printStackTrace();
46
            e.printStackTrace();
47
        }
47
        }
48
        assertEquals(t1, t2)
48
        assertEquals(p1, p2)
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0