Java Code Examples for java.time.chrono.ChronoZonedDateTime#from()

The following examples show how to use java.time.chrono.ChronoZonedDateTime#from() . 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: TCKChronoZonedDateTime.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="calendars")
public void test_from_TemporalAccessor(Chronology chrono) {
    ZonedDateTime refDateTime = ZonedDateTime.of(2013, 1, 1, 12, 30, 0, 0, ZoneId.of("Europe/Paris"));
    ChronoZonedDateTime<?> dateTime = chrono.zonedDateTime(refDateTime);
    ChronoZonedDateTime<?> test1 = ChronoZonedDateTime.from(dateTime);
    assertEquals(test1, dateTime);
}
 
Example 2
Source File: TCKChronoZonedDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="calendars")
public void test_from_TemporalAccessor(Chronology chrono) {
    ZonedDateTime refDateTime = ZonedDateTime.of(2013, 1, 1, 12, 30, 0, 0, ZoneId.of("Europe/Paris"));
    ChronoZonedDateTime<?> dateTime = chrono.zonedDateTime(refDateTime);
    ChronoZonedDateTime<?> test1 = ChronoZonedDateTime.from(dateTime);
    assertEquals(test1, dateTime);
}
 
Example 3
Source File: TCKChronoZonedDateTime.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="calendars")
public void test_from_TemporalAccessor(Chronology chrono) {
    ZonedDateTime refDateTime = ZonedDateTime.of(2013, 1, 1, 12, 30, 0, 0, ZoneId.of("Europe/Paris"));
    ChronoZonedDateTime<?> dateTime = chrono.zonedDateTime(refDateTime);
    ChronoZonedDateTime<?> test1 = ChronoZonedDateTime.from(dateTime);
    assertEquals(test1, dateTime);
}
 
Example 4
Source File: TCKChronoZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="calendars")
public void test_from_TemporalAccessor(Chronology chrono) {
    ZonedDateTime refDateTime = ZonedDateTime.of(2013, 1, 1, 12, 30, 0, 0, ZoneId.of("Europe/Paris"));
    ChronoZonedDateTime<?> dateTime = chrono.zonedDateTime(refDateTime);
    ChronoZonedDateTime<?> test1 = ChronoZonedDateTime.from(dateTime);
    assertEquals(test1, dateTime);
}
 
Example 5
Source File: TCKChronoZonedDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 6
Source File: TCKChronoZonedDateTime.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 7
Source File: TCKChronoZonedDateTime.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 8
Source File: TCKChronoZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 9
Source File: TCKChronoZonedDateTime.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = NullPointerException.class)
public void test_from_TemporalAccessor_null() {
    ChronoZonedDateTime.from(null);
}
 
Example 10
Source File: TCKChronoZonedDateTime.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = NullPointerException.class)
public void test_from_TemporalAccessor_null() {
    ChronoZonedDateTime.from(null);
}
 
Example 11
Source File: TCKChronoZonedDateTime.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 12
Source File: TCKChronoZonedDateTime.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Test(expected = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 13
Source File: TCKChronoZonedDateTime.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 14
Source File: TCKChronoZonedDateTime.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 15
Source File: TCKChronoZonedDateTime.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}
 
Example 16
Source File: TCKChronoZonedDateTime.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = NullPointerException.class)
public void test_from_TemporalAccessor_null() {
    ChronoZonedDateTime.from(null);
}
 
Example 17
Source File: TCKChronoZonedDateTime.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 18
Source File: TCKChronoZonedDateTime.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 19
Source File: TCKChronoZonedDateTime.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_dateOnly() {
    ChronoZonedDateTime.from(LocalDate.of(2013, 1, 1));
}
 
Example 20
Source File: TCKChronoZonedDateTime.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = DateTimeException.class)
public void test_from_TemporalAccessor_timeOnly() {
    ChronoZonedDateTime.from(LocalTime.of(12, 30));
}