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