use of java.time.zone.ZoneOffsetTransitionRule in project jdk8u_jdk by JetBrains.
the class TCKZoneRules method test_London_nextTransition_lastYear.
public void test_London_nextTransition_lastYear() {
ZoneRules test = europeLondon();
List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
ZoneOffsetTransition zot = rules.get(1).createTransition(Year.MAX_VALUE);
assertEquals(test.nextTransition(zot.getInstant()), null);
}
use of java.time.zone.ZoneOffsetTransitionRule in project jdk8u_jdk by JetBrains.
the class TCKZoneOffsetTransitionRule method test_equals_dayOfMonthDifferent.
@Test
public void test_equals_dayOfMonthDifferent() {
ZoneOffsetTransitionRule a = ZoneOffsetTransitionRule.of(Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of(Month.MARCH, 21, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
assertEquals(a.equals(a), true);
assertEquals(a.equals(b), false);
assertEquals(b.equals(a), false);
assertEquals(b.equals(b), true);
}
use of java.time.zone.ZoneOffsetTransitionRule in project jdk8u_jdk by JetBrains.
the class TCKZoneOffsetTransitionRule method test_toString_floatingWeekBackwards_last.
@Test
public void test_toString_floatingWeekBackwards_last() {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
assertEquals(test.toString(), "TransitionRule[Gap +02:00 to +03:00, SUNDAY on or before last day of MARCH at 01:00 WALL, standard offset +02:00]");
}
use of java.time.zone.ZoneOffsetTransitionRule in project jdk8u_jdk by JetBrains.
the class TCKZoneOffsetTransitionRule method test_createTransition_floatingWeek_overlap_endOfDay.
@Test
public void test_createTransition_floatingWeek_overlap_endOfDay() {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, 20, DayOfWeek.SUNDAY, LocalTime.MIDNIGHT, true, TimeDefinition.WALL, OFFSET_0200, OFFSET_0300, OFFSET_0200);
ZoneOffsetTransition trans = ZoneOffsetTransition.of(LocalDateTime.of(2000, Month.MARCH, 27, 0, 0), OFFSET_0300, OFFSET_0200);
assertEquals(test.createTransition(2000), trans);
}
use of java.time.zone.ZoneOffsetTransitionRule in project jdk8u_jdk by JetBrains.
the class TCKZoneOffsetTransitionRule method test_equals_offsetAfterDifferent.
@Test
public void test_equals_offsetAfterDifferent() {
ZoneOffsetTransitionRule a = ZoneOffsetTransitionRule.of(Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of(Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0200);
assertEquals(a.equals(a), true);
assertEquals(a.equals(b), false);
assertEquals(b.equals(a), false);
assertEquals(b.equals(b), true);
}
Aggregations