Search in sources :

Example 96 with OffsetTime

use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.

the class TCKOffsetTime method factory_ofInstant_maxYear.

//-----------------------------------------------------------------------
@Test
public void factory_ofInstant_maxYear() {
    OffsetTime test = OffsetTime.ofInstant(Instant.MAX, ZoneOffset.UTC);
    assertEquals(test.getHour(), 23);
    assertEquals(test.getMinute(), 59);
    assertEquals(test.getSecond(), 59);
    assertEquals(test.getNano(), 999_999_999);
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Example 97 with OffsetTime

use of java.time.OffsetTime in project cxf by apache.

the class JavaTimeTypesParamConverterProviderTest method offsetTime.

@Test
public void offsetTime() {
    OffsetTime offsetTime = OffsetTime.of(10, 33, 24, 5, ZoneOffset.ofHours(2));
    ParamConverter<OffsetTime> converter = (ParamConverter<OffsetTime>) provider.getConverter(offsetTime.getClass(), offsetTime.getClass(), offsetTime.getClass().getAnnotations());
    Assert.assertEquals(offsetTime, converter.fromString(converter.toString(offsetTime)));
}
Also used : ParamConverter(javax.ws.rs.ext.ParamConverter) OffsetTime(java.time.OffsetTime) Test(org.junit.Test)

Example 98 with OffsetTime

use of java.time.OffsetTime in project drools by kiegroup.

the class CodeFunctionTest method invokeOffsetTime.

@Test
public void invokeOffsetTime() {
    final OffsetTime offsetTime = OffsetTime.now();
    FunctionTestUtil.assertResult(codeFunction.invoke(offsetTime), "time( \"" + TimeFunction.FEEL_TIME.format(offsetTime) + "\" )");
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.junit.Test)

Example 99 with OffsetTime

use of java.time.OffsetTime in project drools by kiegroup.

the class StringFunctionTest method invokeOffsetTime.

@Test
public void invokeOffsetTime() {
    final OffsetTime offsetTime = OffsetTime.now();
    FunctionTestUtil.assertResult(stringFunction.invoke(offsetTime), TimeFunction.FEEL_TIME.format(offsetTime));
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.junit.Test)

Aggregations

OffsetTime (java.time.OffsetTime)99 Test (org.testng.annotations.Test)86 ZonedDateTime (java.time.ZonedDateTime)9 LocalTime (java.time.LocalTime)8 Instant (java.time.Instant)7 OffsetDateTime (java.time.OffsetDateTime)7 Time (java.sql.Time)6 LocalDate (java.time.LocalDate)6 LocalDateTime (java.time.LocalDateTime)6 Test (org.junit.Test)6 Date (java.sql.Date)3 ResultSet (java.sql.ResultSet)3 Clock (java.time.Clock)3 PostgresUtils.toPGArrayString (org.jooq.util.postgres.PostgresUtils.toPGArrayString)3 BigDecimal (java.math.BigDecimal)2 PreparedStatement (java.sql.PreparedStatement)2 Timestamp (java.sql.Timestamp)2 Duration (java.time.Duration)2 Period (java.time.Period)2 ZoneId (java.time.ZoneId)2