Java Code Examples for java.time.ZonedDateTime#withEarlierOffsetAtOverlap()

The following examples show how to use java.time.ZonedDateTime#withEarlierOffsetAtOverlap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKZonedDateTime.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 2
Source File: TCKZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 3
Source File: TCKZonedDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 4
Source File: TCKZonedDateTime.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 5
Source File: TCKZonedDateTime.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 6
Source File: TCKZonedDateTime.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 7
Source File: TCKZonedDateTime.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 8
Source File: TCKZonedDateTime.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test.getOffset(), OFFSET_0200);  // offset changed to earlier
    assertEquals(test.toLocalDateTime(), base.toLocalDateTime());  // date-time not changed
}
 
Example 9
Source File: TCKZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 10
Source File: TCKZonedDateTime.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 11
Source File: TCKZonedDateTime.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 12
Source File: TCKZonedDateTime.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 13
Source File: TCKZonedDateTime.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 14
Source File: TCKZonedDateTime.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 15
Source File: TCKZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 16
Source File: TCKZonedDateTime.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 17
Source File: TCKZonedDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 18
Source File: TCKZonedDateTime.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 19
Source File: TCKZonedDateTime.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}
 
Example 20
Source File: TCKZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
    ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
    ZonedDateTime test = base.withEarlierOffsetAtOverlap();
    assertEquals(test, base);  // not changed
}