Search in sources :

Example 1 with WrappedIOException

use of com.fasterxml.jackson.core.exc.WrappedIOException in project jackson-core by FasterXML.

the class Fuzz32208UTF32ParseTest method testFuzz32208ViaParser.

public void testFuzz32208ViaParser() throws Exception {
    final JsonFactory f = newStreamFactory();
    JsonParser p = f.createParser(ObjectReadContext.empty(), DOC);
    try {
        assertToken(JsonToken.VALUE_STRING, p.nextToken());
        String text = p.getText();
        fail("Should not have passed; got text with length of: " + text.length());
    } catch (WrappedIOException e) {
        verifyException(e, "Invalid UTF-32 character ");
    }
    p.close();
}
Also used : JsonFactory(com.fasterxml.jackson.core.json.JsonFactory) WrappedIOException(com.fasterxml.jackson.core.exc.WrappedIOException)

Aggregations

WrappedIOException (com.fasterxml.jackson.core.exc.WrappedIOException)1 JsonFactory (com.fasterxml.jackson.core.json.JsonFactory)1