Search in sources :

Example 76 with ZoneOffsetTransitionRule

use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.

the class TCKZoneOffsetTransitionRule method test_equals_standardOffsetDifferent.

@Test
public void test_equals_standardOffsetDifferent() {
    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_0300, OFFSET_0200, OFFSET_0300);
    assertEquals(a.equals(a), true);
    assertEquals(a.equals(b), false);
    assertEquals(b.equals(a), false);
    assertEquals(b.equals(b), true);
}
Also used : ZoneOffsetTransitionRule(java.time.zone.ZoneOffsetTransitionRule) Test(org.junit.Test) AbstractTCKTest(tck.java.time.AbstractTCKTest)

Example 77 with ZoneOffsetTransitionRule

use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.

the class TCKZoneOffsetTransitionRule method test_equals_dayOfWeekDifferent.

@Test
public void test_equals_dayOfWeekDifferent() {
    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.SATURDAY, 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);
}
Also used : ZoneOffsetTransitionRule(java.time.zone.ZoneOffsetTransitionRule) Test(org.junit.Test) AbstractTCKTest(tck.java.time.AbstractTCKTest)

Example 78 with ZoneOffsetTransitionRule

use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.

the class TCKZoneOffsetTransitionRule method test_equals_timeDefinitionDifferent.

@Test
public void test_equals_timeDefinitionDifferent() {
    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.STANDARD, 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);
}
Also used : ZoneOffsetTransitionRule(java.time.zone.ZoneOffsetTransitionRule) Test(org.junit.Test) AbstractTCKTest(tck.java.time.AbstractTCKTest)

Example 79 with ZoneOffsetTransitionRule

use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.

the class TCKZoneOffsetTransitionRule method test_hashCode_fixedDate.

@Test
public void test_hashCode_fixedDate() {
    ZoneOffsetTransitionRule a = ZoneOffsetTransitionRule.of(Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.STANDARD, OFFSET_0200, OFFSET_0200, OFFSET_0300);
    ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of(Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.STANDARD, OFFSET_0200, OFFSET_0200, OFFSET_0300);
    assertEquals(a.hashCode(), b.hashCode());
}
Also used : ZoneOffsetTransitionRule(java.time.zone.ZoneOffsetTransitionRule) Test(org.junit.Test) AbstractTCKTest(tck.java.time.AbstractTCKTest)

Example 80 with ZoneOffsetTransitionRule

use of java.time.zone.ZoneOffsetTransitionRule in project j2objc by google.

the class TCKZoneOffsetTransitionRule method test_toString_floatingWeekBackwards_secondLast.

@Test
public void test_toString_floatingWeekBackwards_secondLast() {
    ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(Month.MARCH, -2, 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 minus 1 of MARCH at 01:00 WALL, standard offset +02:00]");
}
Also used : ZoneOffsetTransitionRule(java.time.zone.ZoneOffsetTransitionRule) Test(org.junit.Test) AbstractTCKTest(tck.java.time.AbstractTCKTest)

Aggregations

ZoneOffsetTransitionRule (java.time.zone.ZoneOffsetTransitionRule)84 AbstractTCKTest (tck.java.time.AbstractTCKTest)72 Test (org.junit.Test)36 Test (org.testng.annotations.Test)36 ZoneOffsetTransition (java.time.zone.ZoneOffsetTransition)22 ZoneRules (java.time.zone.ZoneRules)10 Instant (java.time.Instant)2 LocalDateTime (java.time.LocalDateTime)2 OffsetDateTime (java.time.OffsetDateTime)2 ZoneId (java.time.ZoneId)2 ZoneOffset (java.time.ZoneOffset)2 ZonedDateTime (java.time.ZonedDateTime)2 TimeDefinition (java.time.zone.ZoneOffsetTransitionRule.TimeDefinition)2 ArrayList (java.util.ArrayList)2 RuntimeMXBean (java.lang.management.RuntimeMXBean)1 ThreadMXBean (java.lang.management.ThreadMXBean)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1