use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.
the class TCKZoneRules method test_London_nextTransition_rulesBased.
public void test_London_nextTransition_rulesBased() {
ZoneRules test = europeLondon();
List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
List<ZoneOffsetTransition> trans = test.getTransitions();
ZoneOffsetTransition last = trans.get(trans.size() - 1);
assertEquals(test.nextTransition(last.getInstant()), rules.get(0).createTransition(1998));
for (int year = 1998; year < 2010; year++) {
ZoneOffsetTransition a = rules.get(0).createTransition(year);
ZoneOffsetTransition b = rules.get(1).createTransition(year);
ZoneOffsetTransition c = rules.get(0).createTransition(year + 1);
assertEquals(test.nextTransition(a.getInstant()), b);
assertEquals(test.nextTransition(b.getInstant().minusNanos(1)), b);
assertEquals(test.nextTransition(b.getInstant()), c);
assertEquals(test.nextTransition(c.getInstant().minusNanos(1)), c);
}
}
use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.
the class TCKZoneOffsetTransitionRule method test_getters_floatingWeekBackwards.
@Test
public void test_getters_floatingWeekBackwards() throws Exception {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
assertEquals(test.getMonth(), Month.MARCH);
assertEquals(test.getDayOfMonthIndicator(), -1);
assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY);
assertEquals(test.getLocalTime(), TIME_0100);
assertEquals(test.isMidnightEndOfDay(), false);
assertEquals(test.getTimeDefinition(), TimeDefinition.WALL);
assertEquals(test.getStandardOffset(), OFFSET_0200);
assertEquals(test.getOffsetBefore(), OFFSET_0200);
assertEquals(test.getOffsetAfter(), OFFSET_0300);
}
use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.
the class TCKZoneOffsetTransitionRuleSerialization method test_serialization_unusualOffsets.
// -----------------------------------------------------------------------
// Test serialization
// -----------------------------------------------------------------------
@Test
public void test_serialization_unusualOffsets() throws Exception {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.STANDARD, ZoneOffset.ofHoursMinutesSeconds(-12, -20, -50), ZoneOffset.ofHoursMinutesSeconds(-4, -10, -34), ZoneOffset.ofHours(-18));
assertSerializable(test);
}
use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.
the class TCKZoneOffsetTransitionRuleSerialization method test_serialization_fixedDate.
@Test
public void test_serialization_fixedDate() throws Exception {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300);
assertSerializable(test);
}
use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.
the class TCKZoneOffsetTransitionRuleSerialization method test_serialization_endOfDay.
@Test
public void test_serialization_endOfDay() throws Exception {
ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, 20, DayOfWeek.FRIDAY, LocalTime.MIDNIGHT, true, TimeDefinition.UTC, OFFSET_0200, OFFSET_0200, OFFSET_0300);
assertSerializable(test);
}
Aggregations