001 /*
002 * Copyright 2001-2010 Stephen Colebourne
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.joda.time;
017
018 import java.util.Date;
019 import java.util.Locale;
020
021 import junit.framework.TestCase;
022 import junit.framework.TestSuite;
023
024 import org.joda.time.chrono.GregorianChronology;
025 import org.joda.time.chrono.ISOChronology;
026 import org.joda.time.convert.ConverterManager;
027 import org.joda.time.convert.MockZeroNullIntegerConverter;
028 import org.joda.time.format.DateTimeFormat;
029 import org.joda.time.format.DateTimeFormatter;
030
031 /**
032 * This class is a Junit unit test for MutableDateTime.
033 *
034 * @author Stephen Colebourne
035 */
036 public class TestMutableDateTime_Constructors extends TestCase {
037 // Test in 2002/03 as time zones are more well known
038 // (before the late 90's they were all over the place)
039
040 private static final DateTimeZone PARIS = DateTimeZone.forID("Europe/Paris");
041 private static final DateTimeZone LONDON = DateTimeZone.forID("Europe/London");
042
043 long y2002days = 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
044 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 +
045 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
046 366 + 365;
047 long y2003days = 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
048 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 +
049 365 + 365 + 366 + 365 + 365 + 365 + 366 + 365 + 365 + 365 +
050 366 + 365 + 365;
051
052 // 2002-06-09
053 private long TEST_TIME_NOW =
054 (y2002days + 31L + 28L + 31L + 30L + 31L + 9L -1L) * DateTimeConstants.MILLIS_PER_DAY;
055
056 // 2002-04-05
057 private long TEST_TIME1 =
058 (y2002days + 31L + 28L + 31L + 5L -1L) * DateTimeConstants.MILLIS_PER_DAY
059 + 12L * DateTimeConstants.MILLIS_PER_HOUR
060 + 24L * DateTimeConstants.MILLIS_PER_MINUTE;
061
062 // 2003-05-06
063 private long TEST_TIME2 =
064 (y2003days + 31L + 28L + 31L + 30L + 6L -1L) * DateTimeConstants.MILLIS_PER_DAY
065 + 14L * DateTimeConstants.MILLIS_PER_HOUR
066 + 28L * DateTimeConstants.MILLIS_PER_MINUTE;
067
068 private DateTimeZone zone = null;
069 private Locale locale = null;
070
071 public static void main(String[] args) {
072 junit.textui.TestRunner.run(suite());
073 }
074
075 public static TestSuite suite() {
076 return new TestSuite(TestMutableDateTime_Constructors.class);
077 }
078
079 public TestMutableDateTime_Constructors(String name) {
080 super(name);
081 }
082
083 protected void setUp() throws Exception {
084 DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
085 zone = DateTimeZone.getDefault();
086 locale = Locale.getDefault();
087 DateTimeZone.setDefault(LONDON);
088 java.util.TimeZone.setDefault(LONDON.toTimeZone());
089 Locale.setDefault(Locale.UK);
090 }
091
092 protected void tearDown() throws Exception {
093 DateTimeUtils.setCurrentMillisSystem();
094 DateTimeZone.setDefault(zone);
095 java.util.TimeZone.setDefault(zone.toTimeZone());
096 Locale.setDefault(locale);
097 zone = null;
098 }
099
100 //-----------------------------------------------------------------------
101 public void testTest() {
102 assertEquals("2002-06-09T00:00:00.000Z", new Instant(TEST_TIME_NOW).toString());
103 assertEquals("2002-04-05T12:24:00.000Z", new Instant(TEST_TIME1).toString());
104 assertEquals("2003-05-06T14:28:00.000Z", new Instant(TEST_TIME2).toString());
105 }
106
107 //-----------------------------------------------------------------------
108 /**
109 * Test now ()
110 */
111 public void test_now() throws Throwable {
112 MutableDateTime test = MutableDateTime.now();
113 assertEquals(ISOChronology.getInstance(), test.getChronology());
114 assertEquals(TEST_TIME_NOW, test.getMillis());
115 }
116
117 /**
118 * Test now (DateTimeZone)
119 */
120 public void test_now_DateTimeZone() throws Throwable {
121 MutableDateTime test = MutableDateTime.now(PARIS);
122 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
123 assertEquals(TEST_TIME_NOW, test.getMillis());
124 }
125
126 /**
127 * Test now (DateTimeZone=null)
128 */
129 public void test_now_nullDateTimeZone() throws Throwable {
130 try {
131 MutableDateTime.now((DateTimeZone) null);
132 fail();
133 } catch (NullPointerException ex) {}
134 }
135
136 /**
137 * Test now (Chronology)
138 */
139 public void test_now_Chronology() throws Throwable {
140 MutableDateTime test = MutableDateTime.now(GregorianChronology.getInstance());
141 assertEquals(GregorianChronology.getInstance(), test.getChronology());
142 assertEquals(TEST_TIME_NOW, test.getMillis());
143 }
144
145 /**
146 * Test now (Chronology=null)
147 */
148 public void test_now_nullChronology() throws Throwable {
149 try {
150 MutableDateTime.now((Chronology) null);
151 fail();
152 } catch (NullPointerException ex) {}
153 }
154
155 //-----------------------------------------------------------------------
156 public void testParse_noFormatter() throws Throwable {
157 assertEquals(new MutableDateTime(2010, 6, 30, 1, 20, 0, 0, ISOChronology.getInstance(DateTimeZone.forOffsetHours(2))), MutableDateTime.parse("2010-06-30T01:20+02:00"));
158 assertEquals(new MutableDateTime(2010, 1, 2, 14, 50, 0, 0, ISOChronology.getInstance(LONDON)), MutableDateTime.parse("2010-002T14:50"));
159 }
160
161 public void testParse_formatter() throws Throwable {
162 DateTimeFormatter f = DateTimeFormat.forPattern("yyyy--dd MM HH").withChronology(ISOChronology.getInstance(PARIS));
163 assertEquals(new MutableDateTime(2010, 6, 30, 13, 0, 0, 0, ISOChronology.getInstance(PARIS)), MutableDateTime.parse("2010--30 06 13", f));
164 }
165
166 //-----------------------------------------------------------------------
167 /**
168 * Test constructor ()
169 */
170 public void testConstructor() throws Throwable {
171 MutableDateTime test = new MutableDateTime();
172 assertEquals(ISOChronology.getInstance(), test.getChronology());
173 assertEquals(TEST_TIME_NOW, test.getMillis());
174 }
175
176 /**
177 * Test constructor (DateTimeZone)
178 */
179 public void testConstructor_DateTimeZone() throws Throwable {
180 MutableDateTime test = new MutableDateTime(PARIS);
181 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
182 assertEquals(TEST_TIME_NOW, test.getMillis());
183 }
184
185 /**
186 * Test constructor (DateTimeZone=null)
187 */
188 public void testConstructor_nullDateTimeZone() throws Throwable {
189 MutableDateTime test = new MutableDateTime((DateTimeZone) null);
190 assertEquals(ISOChronology.getInstance(), test.getChronology());
191 assertEquals(TEST_TIME_NOW, test.getMillis());
192 }
193
194 /**
195 * Test constructor (Chronology)
196 */
197 public void testConstructor_Chronology() throws Throwable {
198 MutableDateTime test = new MutableDateTime(GregorianChronology.getInstance());
199 assertEquals(GregorianChronology.getInstance(), test.getChronology());
200 assertEquals(TEST_TIME_NOW, test.getMillis());
201 }
202
203 /**
204 * Test constructor (Chronology=null)
205 */
206 public void testConstructor_nullChronology() throws Throwable {
207 MutableDateTime test = new MutableDateTime((Chronology) null);
208 assertEquals(ISOChronology.getInstance(), test.getChronology());
209 assertEquals(TEST_TIME_NOW, test.getMillis());
210 }
211
212 //-----------------------------------------------------------------------
213 /**
214 * Test constructor (long)
215 */
216 public void testConstructor_long1() throws Throwable {
217 MutableDateTime test = new MutableDateTime(TEST_TIME1);
218 assertEquals(ISOChronology.getInstance(), test.getChronology());
219 assertEquals(TEST_TIME1, test.getMillis());
220 }
221
222 /**
223 * Test constructor (long)
224 */
225 public void testConstructor_long2() throws Throwable {
226 MutableDateTime test = new MutableDateTime(TEST_TIME2);
227 assertEquals(ISOChronology.getInstance(), test.getChronology());
228 assertEquals(TEST_TIME2, test.getMillis());
229 }
230
231 /**
232 * Test constructor (long, DateTimeZone)
233 */
234 public void testConstructor_long1_DateTimeZone() throws Throwable {
235 MutableDateTime test = new MutableDateTime(TEST_TIME1, PARIS);
236 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
237 assertEquals(TEST_TIME1, test.getMillis());
238 }
239
240 /**
241 * Test constructor (long, DateTimeZone)
242 */
243 public void testConstructor_long2_DateTimeZone() throws Throwable {
244 MutableDateTime test = new MutableDateTime(TEST_TIME2, PARIS);
245 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
246 assertEquals(TEST_TIME2, test.getMillis());
247 }
248
249 /**
250 * Test constructor (long, DateTimeZone=null)
251 */
252 public void testConstructor_long_nullDateTimeZone() throws Throwable {
253 MutableDateTime test = new MutableDateTime(TEST_TIME1, (DateTimeZone) null);
254 assertEquals(ISOChronology.getInstance(), test.getChronology());
255 assertEquals(TEST_TIME1, test.getMillis());
256 }
257
258 /**
259 * Test constructor (long, Chronology)
260 */
261 public void testConstructor_long1_Chronology() throws Throwable {
262 MutableDateTime test = new MutableDateTime(TEST_TIME1, GregorianChronology.getInstance());
263 assertEquals(GregorianChronology.getInstance(), test.getChronology());
264 assertEquals(TEST_TIME1, test.getMillis());
265 }
266
267 /**
268 * Test constructor (long, Chronology)
269 */
270 public void testConstructor_long2_Chronology() throws Throwable {
271 MutableDateTime test = new MutableDateTime(TEST_TIME2, GregorianChronology.getInstance());
272 assertEquals(GregorianChronology.getInstance(), test.getChronology());
273 assertEquals(TEST_TIME2, test.getMillis());
274 }
275
276 /**
277 * Test constructor (long, Chronology=null)
278 */
279 public void testConstructor_long_nullChronology() throws Throwable {
280 MutableDateTime test = new MutableDateTime(TEST_TIME1, (Chronology) null);
281 assertEquals(ISOChronology.getInstance(), test.getChronology());
282 assertEquals(TEST_TIME1, test.getMillis());
283 }
284
285 //-----------------------------------------------------------------------
286 /**
287 * Test constructor (Object)
288 */
289 public void testConstructor_Object() throws Throwable {
290 Date date = new Date(TEST_TIME1);
291 MutableDateTime test = new MutableDateTime(date);
292 assertEquals(ISOChronology.getInstance(), test.getChronology());
293 assertEquals(TEST_TIME1, test.getMillis());
294 }
295
296 /**
297 * Test constructor (Object)
298 */
299 public void testConstructor_invalidObject() throws Throwable {
300 try {
301 new MutableDateTime(new Object());
302 fail();
303 } catch (IllegalArgumentException ex) {}
304 }
305
306 /**
307 * Test constructor (Object=null)
308 */
309 public void testConstructor_nullObject() throws Throwable {
310 MutableDateTime test = new MutableDateTime((Object) null);
311 assertEquals(ISOChronology.getInstance(), test.getChronology());
312 assertEquals(TEST_TIME_NOW, test.getMillis());
313 }
314
315 /**
316 * Test constructor (Object=null)
317 */
318 public void testConstructor_badconverterObject() throws Throwable {
319 try {
320 ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
321 MutableDateTime test = new MutableDateTime(new Integer(0));
322 assertEquals(ISOChronology.getInstance(), test.getChronology());
323 assertEquals(0L, test.getMillis());
324 } finally {
325 ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
326 }
327 }
328
329 /**
330 * Test constructor (Object, DateTimeZone)
331 */
332 public void testConstructor_Object_DateTimeZone() throws Throwable {
333 Date date = new Date(TEST_TIME1);
334 MutableDateTime test = new MutableDateTime(date, PARIS);
335 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
336 assertEquals(TEST_TIME1, test.getMillis());
337 }
338
339 /**
340 * Test constructor (Object, DateTimeZone)
341 */
342 public void testConstructor_invalidObject_DateTimeZone() throws Throwable {
343 try {
344 new MutableDateTime(new Object(), PARIS);
345 fail();
346 } catch (IllegalArgumentException ex) {}
347 }
348
349 /**
350 * Test constructor (Object=null, DateTimeZone)
351 */
352 public void testConstructor_nullObject_DateTimeZone() throws Throwable {
353 MutableDateTime test = new MutableDateTime((Object) null, PARIS);
354 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
355 assertEquals(TEST_TIME_NOW, test.getMillis());
356 }
357
358 /**
359 * Test constructor (Object, DateTimeZone=null)
360 */
361 public void testConstructor_Object_nullDateTimeZone() throws Throwable {
362 Date date = new Date(TEST_TIME1);
363 MutableDateTime test = new MutableDateTime(date, (DateTimeZone) null);
364 assertEquals(ISOChronology.getInstance(), test.getChronology());
365 assertEquals(TEST_TIME1, test.getMillis());
366 }
367
368 /**
369 * Test constructor (Object=null, DateTimeZone=null)
370 */
371 public void testConstructor_nullObject_nullDateTimeZone() throws Throwable {
372 MutableDateTime test = new MutableDateTime((Object) null, (DateTimeZone) null);
373 assertEquals(ISOChronology.getInstance(), test.getChronology());
374 assertEquals(TEST_TIME_NOW, test.getMillis());
375 }
376
377 /**
378 * Test constructor (Object, DateTimeZone)
379 */
380 public void testConstructor_badconverterObject_DateTimeZone() throws Throwable {
381 try {
382 ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
383 MutableDateTime test = new MutableDateTime(new Integer(0), GregorianChronology.getInstance());
384 assertEquals(ISOChronology.getInstance(), test.getChronology());
385 assertEquals(0L, test.getMillis());
386 } finally {
387 ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
388 }
389 }
390
391 /**
392 * Test constructor (Object, Chronology)
393 */
394 public void testConstructor_Object_Chronology() throws Throwable {
395 Date date = new Date(TEST_TIME1);
396 MutableDateTime test = new MutableDateTime(date, GregorianChronology.getInstance());
397 assertEquals(GregorianChronology.getInstance(), test.getChronology());
398 assertEquals(TEST_TIME1, test.getMillis());
399 }
400
401 /**
402 * Test constructor (Object, Chronology)
403 */
404 public void testConstructor_invalidObject_Chronology() throws Throwable {
405 try {
406 new MutableDateTime(new Object(), GregorianChronology.getInstance());
407 fail();
408 } catch (IllegalArgumentException ex) {}
409 }
410
411 /**
412 * Test constructor (Object=null, Chronology)
413 */
414 public void testConstructor_nullObject_Chronology() throws Throwable {
415 MutableDateTime test = new MutableDateTime((Object) null, GregorianChronology.getInstance());
416 assertEquals(GregorianChronology.getInstance(), test.getChronology());
417 assertEquals(TEST_TIME_NOW, test.getMillis());
418 }
419
420 /**
421 * Test constructor (Object, Chronology=null)
422 */
423 public void testConstructor_Object_nullChronology() throws Throwable {
424 Date date = new Date(TEST_TIME1);
425 MutableDateTime test = new MutableDateTime(date, (Chronology) null);
426 assertEquals(ISOChronology.getInstance(), test.getChronology());
427 assertEquals(TEST_TIME1, test.getMillis());
428 }
429
430 /**
431 * Test constructor (Object=null, Chronology=null)
432 */
433 public void testConstructor_nullObject_nullChronology() throws Throwable {
434 MutableDateTime test = new MutableDateTime((Object) null, (Chronology) null);
435 assertEquals(ISOChronology.getInstance(), test.getChronology());
436 assertEquals(TEST_TIME_NOW, test.getMillis());
437 }
438
439 /**
440 * Test constructor (Object, Chronology)
441 */
442 public void testConstructor_badconverterObject_Chronology() throws Throwable {
443 try {
444 ConverterManager.getInstance().addInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
445 MutableDateTime test = new MutableDateTime(new Integer(0), GregorianChronology.getInstance());
446 assertEquals(ISOChronology.getInstance(), test.getChronology());
447 assertEquals(0L, test.getMillis());
448 } finally {
449 ConverterManager.getInstance().removeInstantConverter(MockZeroNullIntegerConverter.INSTANCE);
450 }
451 }
452
453 //-----------------------------------------------------------------------
454 /**
455 * Test constructor (int, int, int)
456 */
457 public void testConstructor_int_int_int_int_int_int_int() throws Throwable {
458 MutableDateTime test = new MutableDateTime(2002, 6, 9, 1, 0, 0, 0); // +01:00
459 assertEquals(ISOChronology.getInstance(), test.getChronology());
460 assertEquals(LONDON, test.getZone());
461 assertEquals(TEST_TIME_NOW, test.getMillis());
462 try {
463 new MutableDateTime(Integer.MIN_VALUE, 6, 9, 0, 0, 0, 0);
464 fail();
465 } catch (IllegalArgumentException ex) {}
466 try {
467 new MutableDateTime(Integer.MAX_VALUE, 6, 9, 0, 0, 0, 0);
468 fail();
469 } catch (IllegalArgumentException ex) {}
470 try {
471 new MutableDateTime(2002, 0, 9, 0, 0, 0, 0);
472 fail();
473 } catch (IllegalArgumentException ex) {}
474 try {
475 new MutableDateTime(2002, 13, 9, 0, 0, 0, 0);
476 fail();
477 } catch (IllegalArgumentException ex) {}
478 try {
479 new MutableDateTime(2002, 6, 0, 0, 0, 0, 0);
480 fail();
481 } catch (IllegalArgumentException ex) {}
482 try {
483 new MutableDateTime(2002, 6, 31, 0, 0, 0, 0);
484 fail();
485 } catch (IllegalArgumentException ex) {}
486 new MutableDateTime(2002, 7, 31, 0, 0, 0, 0);
487 try {
488 new MutableDateTime(2002, 7, 32, 0, 0, 0, 0);
489 fail();
490 } catch (IllegalArgumentException ex) {}
491 }
492
493 /**
494 * Test constructor (int, int, int, DateTimeZone)
495 */
496 public void testConstructor_int_int_int_int_int_int_int_DateTimeZone() throws Throwable {
497 MutableDateTime test = new MutableDateTime(2002, 6, 9, 2, 0, 0, 0, PARIS); // +02:00
498 assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
499 assertEquals(TEST_TIME_NOW, test.getMillis());
500 try {
501 new MutableDateTime(Integer.MIN_VALUE, 6, 9, 0, 0, 0, 0, PARIS);
502 fail();
503 } catch (IllegalArgumentException ex) {}
504 try {
505 new MutableDateTime(Integer.MAX_VALUE, 6, 9, 0, 0, 0, 0, PARIS);
506 fail();
507 } catch (IllegalArgumentException ex) {}
508 try {
509 new MutableDateTime(2002, 0, 9, 0, 0, 0, 0, PARIS);
510 fail();
511 } catch (IllegalArgumentException ex) {}
512 try {
513 new MutableDateTime(2002, 13, 9, 0, 0, 0, 0, PARIS);
514 fail();
515 } catch (IllegalArgumentException ex) {}
516 try {
517 new MutableDateTime(2002, 6, 0, 0, 0, 0, 0, PARIS);
518 fail();
519 } catch (IllegalArgumentException ex) {}
520 try {
521 new MutableDateTime(2002, 6, 31, 0, 0, 0, 0, PARIS);
522 fail();
523 } catch (IllegalArgumentException ex) {}
524 new MutableDateTime(2002, 7, 31, 0, 0, 0, 0, PARIS);
525 try {
526 new MutableDateTime(2002, 7, 32, 0, 0, 0, 0, PARIS);
527 fail();
528 } catch (IllegalArgumentException ex) {}
529 }
530
531 /**
532 * Test constructor (int, int, int, DateTimeZone=null)
533 */
534 public void testConstructor_int_int_int_int_int_int_int_nullDateTimeZone() throws Throwable {
535 MutableDateTime test = new MutableDateTime(2002, 6, 9, 1, 0, 0, 0, (DateTimeZone) null); // +01:00
536 assertEquals(ISOChronology.getInstance(), test.getChronology());
537 assertEquals(TEST_TIME_NOW, test.getMillis());
538 }
539
540 /**
541 * Test constructor (int, int, int, Chronology)
542 */
543 public void testConstructor_int_int_int_int_int_int_int_Chronology() throws Throwable {
544 MutableDateTime test = new MutableDateTime(2002, 6, 9, 1, 0, 0, 0, GregorianChronology.getInstance()); // +01:00
545 assertEquals(GregorianChronology.getInstance(), test.getChronology());
546 assertEquals(TEST_TIME_NOW, test.getMillis());
547 try {
548 new MutableDateTime(Integer.MIN_VALUE, 6, 9, 0, 0, 0, 0, GregorianChronology.getInstance());
549 fail();
550 } catch (IllegalArgumentException ex) {}
551 try {
552 new MutableDateTime(Integer.MAX_VALUE, 6, 9, 0, 0, 0, 0, GregorianChronology.getInstance());
553 fail();
554 } catch (IllegalArgumentException ex) {}
555 try {
556 new MutableDateTime(2002, 0, 9, 0, 0, 0, 0, GregorianChronology.getInstance());
557 fail();
558 } catch (IllegalArgumentException ex) {}
559 try {
560 new MutableDateTime(2002, 13, 9, 0, 0, 0, 0, GregorianChronology.getInstance());
561 fail();
562 } catch (IllegalArgumentException ex) {}
563 try {
564 new MutableDateTime(2002, 6, 0, 0, 0, 0, 0, GregorianChronology.getInstance());
565 fail();
566 } catch (IllegalArgumentException ex) {}
567 try {
568 new MutableDateTime(2002, 6, 31, 0, 0, 0, 0, GregorianChronology.getInstance());
569 fail();
570 } catch (IllegalArgumentException ex) {}
571 new MutableDateTime(2002, 7, 31, 0, 0, 0, 0, GregorianChronology.getInstance());
572 try {
573 new MutableDateTime(2002, 7, 32, 0, 0, 0, 0, GregorianChronology.getInstance());
574 fail();
575 } catch (IllegalArgumentException ex) {}
576 }
577
578 /**
579 * Test constructor (int, int, int, Chronology=null)
580 */
581 public void testConstructor_int_int_int_int_int_int_int_nullChronology() throws Throwable {
582 MutableDateTime test = new MutableDateTime(2002, 6, 9, 1, 0, 0, 0, (Chronology) null); // +01:00
583 assertEquals(ISOChronology.getInstance(), test.getChronology());
584 assertEquals(TEST_TIME_NOW, test.getMillis());
585 }
586
587 }