use of java.time.OffsetDateTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_minusDays.
//-----------------------------------------------------------------------
// minusDays()
//-----------------------------------------------------------------------
@Test
public void test_minusDays() {
OffsetDateTime base = OffsetDateTime.of(2008, 6, 30, 11, 30, 59, 0, OFFSET_PONE);
OffsetDateTime test = base.minusDays(1);
assertEquals(test, OffsetDateTime.of(2008, 6, 29, 11, 30, 59, 0, OFFSET_PONE));
}
use of java.time.OffsetDateTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_plusSeconds.
//-----------------------------------------------------------------------
// plusSeconds()
//-----------------------------------------------------------------------
@Test
public void test_plusSeconds() {
OffsetDateTime base = OffsetDateTime.of(2008, 6, 30, 11, 30, 59, 0, OFFSET_PONE);
OffsetDateTime test = base.plusSeconds(1);
assertEquals(test, OffsetDateTime.of(2008, 6, 30, 11, 31, 0, 0, OFFSET_PONE));
}
use of java.time.OffsetDateTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_toString.
@Test(dataProvider = "sampleToString")
public void test_toString(int y, int o, int d, int h, int m, int s, int n, String offsetId, String expected) {
OffsetDateTime t = OffsetDateTime.of(y, o, d, h, m, s, n, ZoneOffset.of(offsetId));
String str = t.toString();
assertEquals(str, expected);
}
use of java.time.OffsetDateTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_minusYears.
//-----------------------------------------------------------------------
// minusYears()
//-----------------------------------------------------------------------
@Test
public void test_minusYears() {
OffsetDateTime base = OffsetDateTime.of(2008, 6, 30, 11, 30, 59, 0, OFFSET_PONE);
OffsetDateTime test = base.minusYears(1);
assertEquals(test, OffsetDateTime.of(2007, 6, 30, 11, 30, 59, 0, OFFSET_PONE));
}
use of java.time.OffsetDateTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_until_convertedType.
@Test
public void test_until_convertedType() {
OffsetDateTime odt = OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE);
ZonedDateTime zdt = odt.plusSeconds(3).toZonedDateTime();
assertEquals(odt.until(zdt, SECONDS), 3);
}
Aggregations