use of com.amazon.ion.IonInt in project jackson-dataformats-binary by FasterXML.
the class IonTimestampInstantSerializerTest method testSerializationWithTypeInfo02.
@Test
public void testSerializationWithTypeInfo02() throws Exception {
IonObjectMapper mapper = newMapperBuilder().enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS).disable(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS).addMixIn(Instant.class, MockObjectConfiguration.class).build();
Instant date = Instant.ofEpochSecond(123456789L, 183917322);
IonInt value = (IonInt) mapper.writeValueAsIonValue(date);
assertEquals("The value is not correct.", 123456789183L, value.longValue());
assertEquals("The does does not contain the expected number of annotations.", 1, value.getTypeAnnotations().length);
assertEquals("The does does not contain the expected annotation.", Instant.class.getName(), value.getTypeAnnotations()[0]);
}
use of com.amazon.ion.IonInt in project ion-java by amzn.
the class _Private_CurriedValueFactory method newInt.
public IonInt newInt(int value) {
IonInt v = myFactory.newInt(value);
handle(v);
return v;
}
use of com.amazon.ion.IonInt in project ion-java by amzn.
the class _Private_CurriedValueFactory method newNullInt.
// -------------------------------------------------------------------------
public IonInt newNullInt() {
IonInt v = myFactory.newNullInt();
handle(v);
return v;
}
use of com.amazon.ion.IonInt in project ion-java by amzn.
the class SymbolTableTest method testSystemIdOnNonStruct.
// -------------------------------------------------------------------------
// Testing symbols field
@Test
public void testSystemIdOnNonStruct() {
String text = "$ion_1_0::12";
IonInt v = (IonInt) oneValue(text);
checkInt(12, v);
}
use of com.amazon.ion.IonInt in project ion-java by amzn.
the class SymbolTableTest method testSymbolTableOnNonStruct.
@Test
public void testSymbolTableOnNonStruct() {
String text = "$ion_symbol_table::12";
IonInt v = (IonInt) oneValue(text);
checkInt(12, v);
}
Aggregations