Java Code Examples for java.util.GregorianCalendar#JANUARY
The following examples show how to use
java.util.GregorianCalendar#JANUARY .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonDateReaderTest.java From dropbox-sdk-java with MIT License | 6 votes |
@Test public void parseDropboxDateTestMany() { GregorianCalendar current = new GregorianCalendar(1970, GregorianCalendar.JANUARY, 1, 0, 0, 0); current.setTimeZone(JsonDateReader.UTC); GregorianCalendar end = new GregorianCalendar(3000, GregorianCalendar.JANUARY, 1, 0, 0, 0); end.setTimeZone(JsonDateReader.UTC); int count = 0; while (current.compareTo(end) < 0) { count++; validateDropboxDateParser(dateFormatHolder.get().format(current.getTime())); current.add(GregorianCalendar.DAY_OF_MONTH, 1); validateDropboxDateParser(dateFormatHolder.get().format(current.getTime())); current.add(GregorianCalendar.HOUR, 1); validateDropboxDateParser(dateFormatHolder.get().format(current.getTime())); current.add(GregorianCalendar.MINUTE, 1); validateDropboxDateParser(dateFormatHolder.get().format(current.getTime())); current.add(GregorianCalendar.SECOND, 1); } if (count < 1000) throw new AssertionError("Loop didn't run enough: " + count); }