Exemplo n.º 1
0
 // -----------------------------------------------------------------------
 public void test_setInstant() {
   for (int i = -1100; i < 1100; i++) {
     Instant instant = Instant.ofEpochMilli(i);
     GregorianCalendar test = new GregorianCalendar();
     test.setInstant(instant);
     assertEquals(test.getTimeInMillis(), i);
   }
 }
Exemplo n.º 2
0
 // -----------------------------------------------------------------------
 public void test_toInstant() {
   for (int i = -1100; i < 1100; i++) {
     GregorianCalendar gcal = new GregorianCalendar();
     gcal.setTimeInMillis(i);
     Instant test = gcal.toInstant();
     assertEquals(test, Instant.ofEpochMilli(i));
   }
 }