public class StandardContourToolTipGeneratorTests extends TestCase { /** * Returns the tests as a test suite. * * @return The test suite. */ public static Test suite() { return new TestSuite(StandardContourToolTipGeneratorTests.class); } /** * Constructs a new set of tests. * * @param name the name of the tests. */ public StandardContourToolTipGeneratorTests(String name) { super(name); } /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { StandardContourToolTipGenerator g1 = new StandardContourToolTipGenerator(); StandardContourToolTipGenerator g2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(g1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()) ); g2 = (StandardContourToolTipGenerator) in.readObject(); in.close(); } catch (Exception e) { System.out.println(e.toString()); } assertEquals(g1, g2)
public class DatasetGroupTests extends TestCase { /** * Returns the tests as a test suite. * * @return The test suite. */ public static Test suite() { return new TestSuite(DatasetGroupTests.class); } /** * Constructs a new set of tests. * * @param name the name of the tests. */ public DatasetGroupTests(String name) { super(name); } /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { DatasetGroup g1 = new DatasetGroup(); DatasetGroup g2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(g1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()) ); g2 = (DatasetGroup) in.readObject(); in.close(); } catch (Exception e) { System.out.println(e.toString()); } assertEquals(g1, g2)
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/labels/junit/StandardContourToolTipGeneratorTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetGroupTests.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class StandardContourToolTipGeneratorTests extends TestCase {
1
public class DatasetGroupTests 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(StandardContourToolTipGeneratorTests.class);
8
        return new TestSuite(DatasetGroupTests.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 StandardContourToolTipGeneratorTests(String name) {
15
    public DatasetGroupTests(String name) {
16
        super(name);
16
        super(name);
17
    }
17
    }
18
    /**
18
    /**
19
     * Serialize an instance, restore it, and check for equality.
19
     * Serialize an instance, restore it, and check for equality.
20
     */
20
     */
21
    public void testSerialization() {
21
    public void testSerialization() {
22
        StandardContourToolTipGenerator g1
22
        
23
            = new StandardContourToolTipGenerator();
24
        StandardContourToolTipGenerator
23
DatasetGroup g1 = new DatasetGroup();
25
 g2 = null;
24
        DatasetGroup g2 = null;
26
        try {
25
        try {
27
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
26
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
28
            ObjectOutput out = new ObjectOutputStream(buffer);
27
            ObjectOutput out = new ObjectOutputStream(buffer);
29
            out.writeObject(g1);
28
            out.writeObject(g1);
30
            out.close();
29
            out.close();
31
            ObjectInput in = new ObjectInputStream(
30
            ObjectInput in = new ObjectInputStream(
32
                new ByteArrayInputStream(buffer.toByteArray())
31
                new ByteArrayInputStream(buffer.toByteArray())
33
            );
32
            );
34
            g2 = (StandardContourToolTipGenerator) in.readObject();
33
            g2 = (DatasetGroup) in.readObject();
35
            in.close();
34
            in.close();
36
        }
35
        }
37
        catch (Exception e) {
36
        catch (Exception e) {
38
            System.out.println(e.toString());
37
            System.out.println(e.toString());
39
        }
38
        }
40
        assertEquals(g1, g2)
39
        assertEquals(g1, g2)
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