1 | DateAxis axis = new DateAxis("Test Axis");↵ | | 1 | Da↵
|
2 | Date date = new Date();↵ | | |
|
3 | axis.setMaximumDate(date);↵ | | |
|
4 | assertEquals(date, axis.getMaximumDate↵ | | 2 | y d1 = new Day(15, 4, 2000);↵
|
| | | 3 | Day d2 = null;↵
|
|
| | | 4 | try {↵
|
5 | ());↵ | | 5 | ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵
|
|
6 | // check that setting the max date to something on or before the ↵ | | 6 | ↵
|
7 | // current min date works...↵ | | |
|
8 | Date d1 = new Date();↵ | | |
|
9 | Date d2 = new Date(d1.getTime() + 1↵ | | 7 | ObjectOutput out = new ObjectOutputStream(buffer);↵
|
| | | 8 | out.writeObject(d1);↵
|
| | | 9 | out.close();↵
|
|
| | | 10 | ObjectInput in = new ObjectInputStream(↵
|
| | | 11 | new ByteArrayInputStream(buffer.toByteArray())↵
|
10 | );↵ | | 12 | );↵
|
11 | Date d0 = new Date(d1.getTime() - 1);↵ | | 13 | d2 = ↵
|
12 | axis.setMaximumDate(d2);↵ | | |
|
13 | axis.setMinimumDate(d1);↵ | | |
|
14 | axis.setMaximumDate(d1);↵ | | 14 | (Day) in.readObject();↵
|
| | | 15 | in.close();↵
|
| | | 16 | }↵
|
| | | 17 | catch (Exception e) {↵
|
| | | 18 | System.out.println(e.toString());↵
|
| | | 19 | }↵
|
15 | assertEquals(d0, axis.getMinimumDate()); | | 20 | assertEquals(d1, d2);
|