use of com.fasterxml.jackson.core.ObjectReadContext in project jackson-dataformats-binary by FasterXML.
the class IonParserTest method testFloatType.
@Test
public void testFloatType() throws IOException {
final ObjectReadContext ctxt = ObjectReadContext.empty();
final byte[] data = "{ score:0.291e0 }".getBytes();
IonSystem ion = IonSystemBuilder.standard().build();
final IonValue ionFloat = ion.newFloat(Float.MAX_VALUE);
IonReader reader = ionFloat.getSystem().newReader(data, 0, data.length);
// Find the object
reader.next();
// Step into the object
reader.stepIn();
// Step next.
reader.next();
final IonParser floatParser = ionFactory.createParser(ctxt, reader);
Assert.assertEquals(JsonParser.NumberType.DOUBLE, floatParser.getNumberType());
}
use of com.fasterxml.jackson.core.ObjectReadContext in project jackson-core by FasterXML.
the class JsonParserClosedCaseTest method parsers.
/**
* Creates a list of parsers to tests.
*
* @return List of Object[2]. Object[0] is is the name of the class, Object[1] is instance itself.
* @throws IOException when closing stream fails.
*/
@Parameters(name = "{0}")
public static Collection<Object[]> parsers() throws IOException {
ByteArrayInputStream inputStream = new ByteArrayInputStream(new byte[] { '{', '}' });
ObjectReadContext ctxt = ObjectReadContext.empty();
return closeParsers(JSON_F.createParser(ctxt, new InputStreamReader(inputStream)), JSON_F.createParser(ctxt, inputStream), JSON_F.createParser(ctxt, new MockDataInput("{}")));
}
Aggregations