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)
|