130-1-3

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 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/axis/junit/NumberAxis3DTests.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 NumberAxis3DTests 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(NumberAxis3DTests.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 NumberAxis3DTests(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

            NumberAxis3D a1 = new NumberAxis3D("Test Axis");↵

22

            ↵

23

            NumberAxis3D a↵

23

    DatasetGroup g1 = new DatasetGroup();↵

24

    2 = null;↵

24

            DatasetGroup g2 = null;↵

25

            try {↵

25

            try {↵

26

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

26

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

27

                ObjectOutput out = new ObjectOutputStream(buffer);↵

27

                ObjectOutput out = new ObjectOutputStream(buffer);↵

28

                out.writeObject(a1);↵

28

                out.writeObject(g1);↵

29

                out.close();↵

29

                out.close();↵

30

                ObjectInput in = new ObjectInputStream(↵

30

                ObjectInput in = new ObjectInputStream(↵

31

                    new ByteArrayInputStream(buffer.toByteArray())↵

31

                    new ByteArrayInputStream(buffer.toByteArray())↵

32

                );↵

32

                );↵

33

                a2 = (NumberAxis3D) in.readObject();↵

33

                g2 = (DatasetGroup) in.readObject();↵

34

                in.close();↵

34

                in.close();↵

35

            }↵

35

            }↵

36

            catch (Exception e) {↵

36

            catch (Exception e) {↵

37

                System.out.println(e.toString());↵

37

                System.out.println(e.toString());↵

38

            }↵

38

            }↵

39

            assertEquals(a1, a2);

39

            assertEquals(g1, g2);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0