use of java.time.zone.ZoneRules in project jdk8u_jdk by JetBrains.
the class TCKZoneRules method test_London_getOffsetInfo.
public void test_London_getOffsetInfo() {
ZoneRules test = europeLondon();
checkOffset(test, createLDT(2008, 1, 1), OFFSET_ZERO, 1);
checkOffset(test, createLDT(2008, 2, 1), OFFSET_ZERO, 1);
checkOffset(test, createLDT(2008, 3, 1), OFFSET_ZERO, 1);
checkOffset(test, createLDT(2008, 4, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 5, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 6, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 7, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 8, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 9, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 10, 1), OFFSET_PONE, 1);
checkOffset(test, createLDT(2008, 11, 1), OFFSET_ZERO, 1);
checkOffset(test, createLDT(2008, 12, 1), OFFSET_ZERO, 1);
}
use of java.time.zone.ZoneRules in project jdk8u_jdk by JetBrains.
the class TCKZoneRules method test_NewYork_getOffsetInfo_fromDST.
public void test_NewYork_getOffsetInfo_fromDST() {
ZoneRules test = americaNewYork();
checkOffset(test, createLDT(2008, 11, 1), ZoneOffset.ofHours(-4), 1);
checkOffset(test, createLDT(2008, 11, 2), ZoneOffset.ofHours(-4), 1);
checkOffset(test, createLDT(2008, 11, 3), ZoneOffset.ofHours(-5), 1);
checkOffset(test, createLDT(2008, 11, 4), ZoneOffset.ofHours(-5), 1);
checkOffset(test, createLDT(2008, 11, 5), ZoneOffset.ofHours(-5), 1);
checkOffset(test, createLDT(2008, 11, 6), ZoneOffset.ofHours(-5), 1);
checkOffset(test, createLDT(2008, 11, 7), ZoneOffset.ofHours(-5), 1);
// cutover at 02:00 local
checkOffset(test, LocalDateTime.of(2008, 11, 2, 0, 59, 59, 999999999), ZoneOffset.ofHours(-4), 1);
checkOffset(test, LocalDateTime.of(2008, 11, 2, 2, 0, 0, 0), ZoneOffset.ofHours(-5), 1);
}
use of java.time.zone.ZoneRules in project jdk8u_jdk by JetBrains.
the class TCKZoneRules method test_getTransitions_immutable.
//-------------------------------------------------------------------------
@Test(expectedExceptions = UnsupportedOperationException.class)
public void test_getTransitions_immutable() {
ZoneRules test = europeParis();
test.getTransitions().clear();
}
use of java.time.zone.ZoneRules in project jdk8u_jdk by JetBrains.
the class TCKZoneRules method test_Kathmandu_nextTransition_historic.
public void test_Kathmandu_nextTransition_historic() {
ZoneRules test = asiaKathmandu();
List<ZoneOffsetTransition> trans = test.getTransitions();
ZoneOffsetTransition first = trans.get(0);
assertEquals(test.nextTransition(first.getInstant().minusNanos(1)), first);
for (int i = 0; i < trans.size() - 1; i++) {
ZoneOffsetTransition cur = trans.get(i);
ZoneOffsetTransition next = trans.get(i + 1);
assertEquals(test.nextTransition(cur.getInstant()), next);
assertEquals(test.nextTransition(next.getInstant().minusNanos(1)), next);
}
}
use of java.time.zone.ZoneRules in project jdk8u_jdk by JetBrains.
the class TCKFixedZoneRules method test_getTransitionRules_immutable.
@Test(expectedExceptions = UnsupportedOperationException.class)
public void test_getTransitionRules_immutable() {
ZoneRules test = make(OFFSET_PTWO);
test.getTransitionRules().add(ZoneOffsetTransitionRule.of(Month.JULY, 2, null, LocalTime.of(12, 30), false, TimeDefinition.STANDARD, OFFSET_PONE, OFFSET_PTWO, OFFSET_PONE));
}
Aggregations