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