use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatters method test_print_isoOrdinalDate_zoned_largeYear.
@Test
public void test_print_isoOrdinalDate_zoned_largeYear() {
TemporalAccessor test = buildAccessor(LocalDateTime.of(123456, 6, 3, 11, 5, 30), "Z", null);
assertEquals(DateTimeFormatter.ISO_ORDINAL_DATE.format(test), "+123456-155Z");
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatters method test_print_isoOrdinalDate_offset.
@Test
public void test_print_isoOrdinalDate_offset() {
TemporalAccessor test = buildAccessor(LocalDateTime.of(2008, 6, 3, 11, 5, 30), "Z", null);
assertEquals(DateTimeFormatter.ISO_ORDINAL_DATE.format(test), "2008-155Z");
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatters method test_print_isoInstant.
@Test(dataProvider = "sample_isoInstant")
public void test_print_isoInstant(long instantSecs, Integer nano, String expected, Class<?> expectedEx) {
TemporalAccessor test = buildAccessorInstant(instantSecs, nano);
if (expectedEx == null) {
assertEquals(DateTimeFormatter.ISO_INSTANT.format(test), expected);
} else {
try {
DateTimeFormatter.ISO_INSTANT.format(test);
fail();
} catch (Exception ex) {
assertTrue(expectedEx.isInstance(ex));
}
}
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatters method test_print_isoOrdinalDate.
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
@Test
public void test_print_isoOrdinalDate() {
TemporalAccessor test = buildAccessor(LocalDateTime.of(2008, 6, 3, 11, 5, 30), null, null);
assertEquals(DateTimeFormatter.ISO_ORDINAL_DATE.format(test), "2008-155");
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatters method test_print_basicIsoDate_zoned.
@Test
public void test_print_basicIsoDate_zoned() {
TemporalAccessor test = buildAccessor(LocalDateTime.of(2008, 6, 3, 11, 5, 30), "+02:00", "Europe/Paris");
assertEquals(DateTimeFormatter.BASIC_ISO_DATE.format(test), "20080603+0200");
}
Aggregations