KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joda > time > TestDateMidnight_Constructors


1 /*
2  * Copyright 2001-2005 Stephen Colebourne
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.joda.time;
17
18 import java.util.Date JavaDoc;
19 import java.util.Locale JavaDoc;
20
21 import junit.framework.TestCase;
22 import junit.framework.TestSuite;
23
24 import org.joda.time.chrono.GregorianChronology;
25 import org.joda.time.chrono.ISOChronology;
26 import org.joda.time.convert.ConverterManager;
27 import org.joda.time.convert.MockZeroNullIntegerConverter;
28
29 /**
30  * This class is a Junit unit test for DateMidnight.
31  *
32  * @author Stephen Colebourne
33  */

34 public class TestDateMidnight_Constructors extends TestCase {
35     // Test in 2002/03 as time zones are more well known
36
// (before the late 90's they were all over the place)
37

38     private static final DateTimeZone PARIS = DateTimeZone.forID("Europe/Paris");
39     private static final DateTimeZone LONDON = DateTimeZone.forID("Europe/London");
40     
41     long y2002days = 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
42                      366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 +
43                      365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
44                      366 + 365;
45     long y2003days = 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
46                      366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 +
47                      365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
48                      366 + 365 + 365;
49     
50     // 2002-06-09
51
private long TEST_TIME_NOW_UTC =
52             (y2002days + 31L + 28L + 31L + 30L + 31L + 9L -1L) * DateTimeConstants.MILLIS_PER_DAY;
53     private long TEST_TIME_NOW_LONDON =
54             TEST_TIME_NOW_UTC - DateTimeConstants.MILLIS_PER_HOUR;
55     private long TEST_TIME_NOW_PARIS =
56             TEST_TIME_NOW_UTC - 2*DateTimeConstants.MILLIS_PER_HOUR;
57     
58     // 2002-04-05
59
private long TEST_TIME1_UTC =
60             (y2002days + 31L + 28L + 31L + 5L -1L) * DateTimeConstants.MILLIS_PER_DAY
61             + 12L * DateTimeConstants.MILLIS_PER_HOUR
62             + 24L * DateTimeConstants.MILLIS_PER_MINUTE;
63     private long TEST_TIME1_LONDON =
64             (y2002days + 31L + 28L + 31L + 5L -1L) * DateTimeConstants.MILLIS_PER_DAY
65             - DateTimeConstants.MILLIS_PER_HOUR;
66     private long TEST_TIME1_PARIS =
67             (y2002days + 31L + 28L + 31L + 5L -1L) * DateTimeConstants.MILLIS_PER_DAY
68             - 2*DateTimeConstants.MILLIS_PER_HOUR;
69     
70     // 2003-05-06
71
private long TEST_TIME2_UTC =
72             (y2003days + 31L + 28L + 31L + 30L + 6L -1L) * DateTimeConstants.MILLIS_PER_DAY
73             + 14L * DateTimeConstants.MILLIS_PER_HOUR
74             + 28L * DateTimeConstants.MILLIS_PER_MINUTE;
75     private long TEST_TIME2_LONDON =
76             (y2003days + 31L + 28L + 31L + 30L + 6L -1L) * DateTimeConstants.MILLIS_PER_DAY
77              - DateTimeConstants.MILLIS_PER_HOUR;
78     private long TEST_TIME2_PARIS =
79             (y2003days + 31L + 28L + 31L + 30L + 6L -1L) * DateTimeConstants.MILLIS_PER_DAY
80              - 2*DateTimeConstants.MILLIS_PER_HOUR;
81     
82     private DateTimeZone zone = null;
83     private Locale JavaDoc locale = null;
84
85     public static void main(String JavaDoc[] args) {
86         junit.textui.TestRunner.run(suite());
87     }
88
89     public static TestSuite suite() {
90         return new TestSuite(TestDateMidnight_Constructors.class);
91     }
92
93     public TestDateMidnight_Constructors(String JavaDoc name) {
94         super(name);
95     }
96
97     protected void setUp() throws Exception JavaDoc {
98         DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW_UTC);
99         zone = DateTimeZone.getDefault();
100         locale = Locale.getDefault();
101         DateTimeZone.setDefault(LONDON);
102         Locale.setDefault(Locale.UK);
103     }
104
105     protected void tearDown() throws Exception JavaDoc {
106         DateTimeUtils.setCurrentMillisSystem();
107         DateTimeZone.setDefault(zone);
108         Locale.setDefault(locale);
109         zone = null;
110     }
111
112     //-----------------------------------------------------------------------
113
public void testTest() {
114         assertEquals("2002-06-09T00:00:00.000Z", new Instant(TEST_TIME_NOW_UTC).toString());
115         assertEquals("2002-04-05T12:24:00.000Z", new Instant(TEST_TIME1_UTC).toString());
116         assertEquals("2003-05-06T14:28:00.000Z", new Instant(TEST_TIME2_UTC).toString());
117     }
118
119     //-----------------------------------------------------------------------
120
/**
121      * Test constructor ()
122      */

123     public void testConstructor() throws Throwable JavaDoc {
124         DateMidnight test = new DateMidnight();
125         assertEquals(ISOChronology.getInstance(), test.getChronology());
126         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
127         assertEquals(2002, test.getYear());
128         assertEquals(6, test.getMonthOfYear());
129         assertEquals(9, test.getDayOfMonth());
130     }
131
132     /**
133      * Test constructor (DateTimeZone)
134      */

135     public void testConstructor_DateTimeZone() throws Throwable JavaDoc {
136         DateMidnight test = new DateMidnight(PARIS);
137         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
138         assertEquals(TEST_TIME_NOW_PARIS, test.getMillis());
139     }
140
141     /**
142      * Test constructor (DateTimeZone=null)
143      */

144     public void testConstructor_nullDateTimeZone() throws Throwable JavaDoc {
145         DateMidnight test = new DateMidnight((DateTimeZone) null);
146         assertEquals(ISOChronology.getInstance(), test.getChronology());
147         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
148     }
149
150     /**
151      * Test constructor (Chronology)
152      */

153     public void testConstructor_Chronology() throws Throwable JavaDoc {
154         DateMidnight test = new DateMidnight(GregorianChronology.getInstance());
155         assertEquals(GregorianChronology.getInstance(), test.getChronology());
156         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
157     }
158
159     /**
160      * Test constructor (Chronology=null)
161      */

162     public void testConstructor_nullChronology() throws Throwable JavaDoc {
163         DateMidnight test = new DateMidnight((Chronology) null);
164         assertEquals(ISOChronology.getInstance(), test.getChronology());
165         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
166     }
167
168     //-----------------------------------------------------------------------
169
/**
170      * Test constructor (long)
171      */

172     public void testConstructor_long1() throws Throwable JavaDoc {
173         DateMidnight test = new DateMidnight(TEST_TIME1_UTC);
174         assertEquals(ISOChronology.getInstance(), test.getChronology());
175         assertEquals(TEST_TIME1_LONDON, test.getMillis());
176     }
177
178     /**
179      * Test constructor (long)
180      */

181     public void testConstructor_long2() throws Throwable JavaDoc {
182         DateMidnight test = new DateMidnight(TEST_TIME2_UTC);
183         assertEquals(ISOChronology.getInstance(), test.getChronology());
184         assertEquals(TEST_TIME2_LONDON, test.getMillis());
185     }
186
187     /**
188      * Test constructor (long, DateTimeZone)
189      */

190     public void testConstructor_long1_DateTimeZone() throws Throwable JavaDoc {
191         DateMidnight test = new DateMidnight(TEST_TIME1_UTC, PARIS);
192         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
193         assertEquals(TEST_TIME1_PARIS, test.getMillis());
194     }
195
196     /**
197      * Test constructor (long, DateTimeZone)
198      */

199     public void testConstructor_long2_DateTimeZone() throws Throwable JavaDoc {
200         DateMidnight test = new DateMidnight(TEST_TIME2_UTC, PARIS);
201         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
202         assertEquals(TEST_TIME2_PARIS, test.getMillis());
203     }
204
205     /**
206      * Test constructor (long, DateTimeZone=null)
207      */

208     public void testConstructor_long_nullDateTimeZone() throws Throwable JavaDoc {
209         DateMidnight test = new DateMidnight(TEST_TIME1_UTC, (DateTimeZone) null);
210         assertEquals(ISOChronology.getInstance(), test.getChronology());
211         assertEquals(TEST_TIME1_LONDON, test.getMillis());
212     }
213
214     /**
215      * Test constructor (long, Chronology)
216      */

217     public void testConstructor_long1_Chronology() throws Throwable JavaDoc {
218         DateMidnight test = new DateMidnight(TEST_TIME1_UTC, GregorianChronology.getInstance());
219         assertEquals(GregorianChronology.getInstance(), test.getChronology());
220         assertEquals(TEST_TIME1_LONDON, test.getMillis());
221     }
222
223     /**
224      * Test constructor (long, Chronology)
225      */

226     public void testConstructor_long2_Chronology() throws Throwable JavaDoc {
227         DateMidnight test = new DateMidnight(TEST_TIME2_UTC, GregorianChronology.getInstance());
228         assertEquals(GregorianChronology.getInstance(), test.getChronology());
229         assertEquals(TEST_TIME2_LONDON, test.getMillis());
230     }
231
232     /**
233      * Test constructor (long, Chronology=null)
234      */

235     public void testConstructor_long_nullChronology() throws Throwable JavaDoc {
236         DateMidnight test = new DateMidnight(TEST_TIME1_UTC, (Chronology) null);
237         assertEquals(ISOChronology.getInstance(), test.getChronology());
238         assertEquals(TEST_TIME1_LONDON, test.getMillis());
239     }
240
241     //-----------------------------------------------------------------------
242
/**
243      * Test constructor (Object)
244      */

245     public void testConstructor_Object() throws Throwable JavaDoc {
246         Date JavaDoc date = new Date JavaDoc(TEST_TIME1_UTC);
247         DateMidnight test = new DateMidnight(date);
248         assertEquals(ISOChronology.getInstance(), test.getChronology());
249         assertEquals(TEST_TIME1_LONDON, test.getMillis());
250     }
251
252     /**
253      * Test constructor (Object)
254      */

255     public void testConstructor_invalidObject() throws Throwable JavaDoc {
256         try {
257             new DateMidnight(new Object JavaDoc());
258             fail();
259         } catch (IllegalArgumentException JavaDoc ex) {}
260     }
261
262     /**
263      * Test constructor (Object=null)
264      */

265     public void testConstructor_nullObject() throws Throwable JavaDoc {
266         DateMidnight test = new DateMidnight((Object JavaDoc) null);
267         assertEquals(ISOChronology.getInstance(), test.getChronology());
268         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
269     }
270
271     /**
272      * Test constructor (Object=null)
273      */

274     public void testConstructor_badconverterObject() throws Throwable JavaDoc {
275         try {
276             ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
277             DateMidnight test = new DateMidnight(new Integer JavaDoc(0));
278             assertEquals(ISOChronology.getInstance(), test.getChronology());
279             assertEquals(0L - DateTimeConstants.MILLIS_PER_HOUR, test.getMillis());
280         } finally {
281             ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
282         }
283     }
284
285     /**
286      * Test constructor (Object, DateTimeZone)
287      */

288     public void testConstructor_Object_DateTimeZone() throws Throwable JavaDoc {
289         Date JavaDoc date = new Date JavaDoc(TEST_TIME1_UTC);
290         DateMidnight test = new DateMidnight(date, PARIS);
291         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
292         assertEquals(TEST_TIME1_PARIS, test.getMillis());
293     }
294
295     /**
296      * Test constructor (Object, DateTimeZone)
297      */

298     public void testConstructor_invalidObject_DateTimeZone() throws Throwable JavaDoc {
299         try {
300             new DateMidnight(new Object JavaDoc(), PARIS);
301             fail();
302         } catch (IllegalArgumentException JavaDoc ex) {}
303     }
304
305     /**
306      * Test constructor (Object=null, DateTimeZone)
307      */

308     public void testConstructor_nullObject_DateTimeZone() throws Throwable JavaDoc {
309         DateMidnight test = new DateMidnight((Object JavaDoc) null, PARIS);
310         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
311         assertEquals(TEST_TIME_NOW_PARIS, test.getMillis());
312     }
313
314     /**
315      * Test constructor (Object, DateTimeZone=null)
316      */

317     public void testConstructor_Object_nullDateTimeZone() throws Throwable JavaDoc {
318         Date JavaDoc date = new Date JavaDoc(TEST_TIME1_UTC);
319         DateMidnight test = new DateMidnight(date, (DateTimeZone) null);
320         assertEquals(ISOChronology.getInstance(), test.getChronology());
321         assertEquals(TEST_TIME1_LONDON, test.getMillis());
322     }
323
324     /**
325      * Test constructor (Object=null, DateTimeZone=null)
326      */

327     public void testConstructor_nullObject_nullDateTimeZone() throws Throwable JavaDoc {
328         DateMidnight test = new DateMidnight((Object JavaDoc) null, (DateTimeZone) null);
329         assertEquals(ISOChronology.getInstance(), test.getChronology());
330         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
331     }
332
333     /**
334      * Test constructor (Object, DateTimeZone)
335      */

336     public void testConstructor_badconverterObject_DateTimeZone() throws Throwable JavaDoc {
337         try {
338             ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
339             DateMidnight test = new DateMidnight(new Integer JavaDoc(0), GregorianChronology.getInstance());
340             assertEquals(ISOChronology.getInstance(), test.getChronology());
341             assertEquals(0L - DateTimeConstants.MILLIS_PER_HOUR, test.getMillis());
342         } finally {
343             ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
344         }
345     }
346
347     /**
348      * Test constructor (Object, Chronology)
349      */

350     public void testConstructor_Object_Chronology() throws Throwable JavaDoc {
351         Date JavaDoc date = new Date JavaDoc(TEST_TIME1_UTC);
352         DateMidnight test = new DateMidnight(date, GregorianChronology.getInstance());
353         assertEquals(GregorianChronology.getInstance(), test.getChronology());
354         assertEquals(TEST_TIME1_LONDON, test.getMillis());
355     }
356
357     /**
358      * Test constructor (Object, Chronology)
359      */

360     public void testConstructor_invalidObject_Chronology() throws Throwable JavaDoc {
361         try {
362             new DateMidnight(new Object JavaDoc(), GregorianChronology.getInstance());
363             fail();
364         } catch (IllegalArgumentException JavaDoc ex) {}
365     }
366
367     /**
368      * Test constructor (Object=null, Chronology)
369      */

370     public void testConstructor_nullObject_Chronology() throws Throwable JavaDoc {
371         DateMidnight test = new DateMidnight((Object JavaDoc) null, GregorianChronology.getInstance());
372         assertEquals(GregorianChronology.getInstance(), test.getChronology());
373         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
374     }
375
376     /**
377      * Test constructor (Object, Chronology=null)
378      */

379     public void testConstructor_Object_nullChronology() throws Throwable JavaDoc {
380         Date JavaDoc date = new Date JavaDoc(TEST_TIME1_UTC);
381         DateMidnight test = new DateMidnight(date, (Chronology) null);
382         assertEquals(ISOChronology.getInstance(), test.getChronology());
383         assertEquals(TEST_TIME1_LONDON, test.getMillis());
384     }
385
386     /**
387      * Test constructor (Object=null, Chronology=null)
388      */

389     public void testConstructor_nullObject_nullChronology() throws Throwable JavaDoc {
390         DateMidnight test = new DateMidnight((Object JavaDoc) null, (Chronology) null);
391         assertEquals(ISOChronology.getInstance(), test.getChronology());
392         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
393     }
394
395     /**
396      * Test constructor (Object, Chronology)
397      */

398     public void testConstructor_badconverterObject_Chronology() throws Throwable JavaDoc {
399         try {
400             ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
401             DateMidnight test = new DateMidnight(new Integer JavaDoc(0), GregorianChronology.getInstance());
402             assertEquals(ISOChronology.getInstance(), test.getChronology());
403             assertEquals(0L - DateTimeConstants.MILLIS_PER_HOUR, test.getMillis());
404         } finally {
405             ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
406         }
407     }
408
409     //-----------------------------------------------------------------------
410
/**
411      * Test constructor (int, int, int)
412      */

413     public void testConstructor_int_int_int() throws Throwable JavaDoc {
414         DateMidnight test = new DateMidnight(2002, 6, 9);
415         assertEquals(ISOChronology.getInstance(), test.getChronology());
416         assertEquals(LONDON, test.getZone());
417         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
418         assertEquals(2002, test.getYear());
419         assertEquals(6, test.getMonthOfYear());
420         assertEquals(9, test.getDayOfMonth());
421         try {
422             new DateMidnight(Integer.MIN_VALUE, 6, 9);
423             fail();
424         } catch (IllegalArgumentException JavaDoc ex) {}
425         try {
426             new DateMidnight(Integer.MAX_VALUE, 6, 9);
427             fail();
428         } catch (IllegalArgumentException JavaDoc ex) {}
429         try {
430             new DateMidnight(2002, 0, 9);
431             fail();
432         } catch (IllegalArgumentException JavaDoc ex) {}
433         try {
434             new DateMidnight(2002, 13, 9);
435             fail();
436         } catch (IllegalArgumentException JavaDoc ex) {}
437         try {
438             new DateMidnight(2002, 6, 0);
439             fail();
440         } catch (IllegalArgumentException JavaDoc ex) {}
441         try {
442             new DateMidnight(2002, 6, 31);
443             fail();
444         } catch (IllegalArgumentException JavaDoc ex) {}
445         new DateMidnight(2002, 7, 31);
446         try {
447             new DateMidnight(2002, 7, 32);
448             fail();
449         } catch (IllegalArgumentException JavaDoc ex) {}
450     }
451
452     /**
453      * Test constructor (int, int, int, DateTimeZone)
454      */

455     public void testConstructor_int_int_int_DateTimeZone() throws Throwable JavaDoc {
456         DateMidnight test = new DateMidnight(2002, 6, 9, PARIS);
457         assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
458         assertEquals(TEST_TIME_NOW_PARIS, test.getMillis());
459         assertEquals(2002, test.getYear());
460         assertEquals(6, test.getMonthOfYear());
461         assertEquals(9, test.getDayOfMonth());
462         try {
463             new DateMidnight(Integer.MIN_VALUE, 6, 9, PARIS);
464             fail();
465         } catch (IllegalArgumentException JavaDoc ex) {}
466         try {
467             new DateMidnight(Integer.MAX_VALUE, 6, 9, PARIS);
468             fail();
469         } catch (IllegalArgumentException JavaDoc ex) {}
470         try {
471             new DateMidnight(2002, 0, 9, PARIS);
472             fail();
473         } catch (IllegalArgumentException JavaDoc ex) {}
474         try {
475             new DateMidnight(2002, 13, 9, PARIS);
476             fail();
477         } catch (IllegalArgumentException JavaDoc ex) {}
478         try {
479             new DateMidnight(2002, 6, 0, PARIS);
480             fail();
481         } catch (IllegalArgumentException JavaDoc ex) {}
482         try {
483             new DateMidnight(2002, 6, 31, PARIS);
484             fail();
485         } catch (IllegalArgumentException JavaDoc ex) {}
486         new DateMidnight(2002, 7, 31, PARIS);
487         try {
488             new DateMidnight(2002, 7, 32, PARIS);
489             fail();
490         } catch (IllegalArgumentException JavaDoc ex) {}
491     }
492
493     /**
494      * Test constructor (int, int, int, DateTimeZone=null)
495      */

496     public void testConstructor_int_int_int_nullDateTimeZone() throws Throwable JavaDoc {
497         DateMidnight test = new DateMidnight(2002, 6, 9, (DateTimeZone) null);
498         assertEquals(ISOChronology.getInstance(), test.getChronology());
499         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
500         assertEquals(2002, test.getYear());
501         assertEquals(6, test.getMonthOfYear());
502         assertEquals(9, test.getDayOfMonth());
503     }
504
505     /**
506      * Test constructor (int, int, int, Chronology)
507      */

508     public void testConstructor_int_int_int_Chronology() throws Throwable JavaDoc {
509         DateMidnight test = new DateMidnight(2002, 6, 9, GregorianChronology.getInstance());
510         assertEquals(GregorianChronology.getInstance(), test.getChronology());
511         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
512         assertEquals(2002, test.getYear());
513         assertEquals(6, test.getMonthOfYear());
514         assertEquals(9, test.getDayOfMonth());
515         try {
516             new DateMidnight(Integer.MIN_VALUE, 6, 9, GregorianChronology.getInstance());
517             fail();
518         } catch (IllegalArgumentException JavaDoc ex) {}
519         try {
520             new DateMidnight(Integer.MAX_VALUE, 6, 9, GregorianChronology.getInstance());
521             fail();
522         } catch (IllegalArgumentException JavaDoc ex) {}
523         try {
524             new DateMidnight(2002, 0, 9, GregorianChronology.getInstance());
525             fail();
526         } catch (IllegalArgumentException JavaDoc ex) {}
527         try {
528             new DateMidnight(2002, 13, 9, GregorianChronology.getInstance());
529             fail();
530         } catch (IllegalArgumentException JavaDoc ex) {}
531         try {
532             new DateMidnight(2002, 6, 0, GregorianChronology.getInstance());
533             fail();
534         } catch (IllegalArgumentException JavaDoc ex) {}
535         try {
536             new DateMidnight(2002, 6, 31, GregorianChronology.getInstance());
537             fail();
538         } catch (IllegalArgumentException JavaDoc ex) {}
539         new DateMidnight(2002, 7, 31, GregorianChronology.getInstance());
540         try {
541             new DateMidnight(2002, 7, 32, GregorianChronology.getInstance());
542             fail();
543         } catch (IllegalArgumentException JavaDoc ex) {}
544     }
545
546     /**
547      * Test constructor (int, int, int, Chronology=null)
548      */

549     public void testConstructor_int_int_int_nullChronology() throws Throwable JavaDoc {
550         DateMidnight test = new DateMidnight(2002, 6, 9, (Chronology) null);
551         assertEquals(ISOChronology.getInstance(), test.getChronology());
552         assertEquals(TEST_TIME_NOW_LONDON, test.getMillis());
553         assertEquals(2002, test.getYear());
554         assertEquals(6, test.getMonthOfYear());
555         assertEquals(9, test.getDayOfMonth());
556     }
557
558 }
559
Popular Tags