use of com.amazon.ion.Timestamp in project jackson-dataformats-binary by FasterXML.
the class IonTimestampOffsetDateTimeDeserializerTest method testDeserializationAsIonTimestamp01.
/*
**********************************************************************
* Deserialization from Ion timestamp value
**********************************************************************
*/
@Test
public void testDeserializationAsIonTimestamp01() throws Exception {
OffsetDateTime expected = OffsetDateTime.ofInstant(Instant.ofEpochSecond(0L), UTC);
Timestamp timestamp = TimestampUtils.toTimestamp(expected.toInstant(), expected.getOffset());
OffsetDateTime actual = READER_UTC_DEFAULT.readValue(timestamp.toString());
assertEquals("The value is not correct.", expected, actual);
}
use of com.amazon.ion.Timestamp in project jackson-dataformats-binary by FasterXML.
the class IonTimestampOffsetDateTimeDeserializerTest method testDeserializationAsIonTimestamp03NonUTCTimeOffset.
@Test
public void testDeserializationAsIonTimestamp03NonUTCTimeOffset() throws Exception {
OffsetDateTime expected = OffsetDateTime.now(Z1);
Timestamp timestamp = TimestampUtils.toTimestamp(expected.toInstant(), expected.getOffset());
OffsetDateTime actual = READER_UTC_DEFAULT.readValue(timestamp.toString());
assertEquals("The value is not correct.", expected, actual);
}
use of com.amazon.ion.Timestamp in project jackson-dataformats-binary by FasterXML.
the class IonTimestampOffsetDateTimeDeserializerTest method testDeserializationAsIonTimestamp02NonUTCTimeOffset.
@Test
public void testDeserializationAsIonTimestamp02NonUTCTimeOffset() throws Exception {
OffsetDateTime expected = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 183917322), Z1);
Timestamp timestamp = TimestampUtils.toTimestamp(expected.toInstant(), expected.getOffset());
OffsetDateTime actual = READER_UTC_DEFAULT.readValue(timestamp.toString());
assertEquals("The value is not correct.", expected, actual);
}
use of com.amazon.ion.Timestamp in project jackson-dataformats-binary by FasterXML.
the class IonTimestampOffsetDateTimeDeserializerTest method testDeserializationAsIonTimestamp01NonUTCTimeOffset.
@Test
public void testDeserializationAsIonTimestamp01NonUTCTimeOffset() throws Exception {
OffsetDateTime expected = OffsetDateTime.ofInstant(Instant.ofEpochSecond(0L), Z1);
Timestamp timestamp = TimestampUtils.toTimestamp(expected.toInstant(), expected.getOffset());
OffsetDateTime actual = READER_UTC_DEFAULT.readValue(timestamp.toString());
assertEquals("The value is not correct.", expected, actual);
}
use of com.amazon.ion.Timestamp in project jackson-dataformats-binary by FasterXML.
the class IonTimestampOffsetDateTimeDeserializerTest method testDeserializationAsIonTimestamp02.
@Test
public void testDeserializationAsIonTimestamp02() throws Exception {
OffsetDateTime expected = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 183917322), UTC);
Timestamp timestamp = TimestampUtils.toTimestamp(expected.toInstant(), expected.getOffset());
OffsetDateTime actual = READER_UTC_DEFAULT.readValue(timestamp.toString());
assertEquals("The value is not correct.", expected, actual);
}
Aggregations