Search in sources :

Example 1 with ReaderBasedJsonParser

use of com.fasterxml.jackson.core.json.ReaderBasedJsonParser in project jackson-core by FasterXML.

the class JsonParserSequenceTest method testClose.

@Test
public void testClose() throws IOException {
    IOContext ioContext = new IOContext(new BufferRecycler(), this, true);
    ReaderBasedJsonParser readerBasedJsonParser = new ReaderBasedJsonParser(ObjectReadContext.empty(), ioContext, 2, null, CharsToNameCanonicalizer.createRoot());
    JsonParserSequence jsonParserSequence = JsonParserSequence.createFlattened(true, readerBasedJsonParser, readerBasedJsonParser);
    assertFalse(jsonParserSequence.isClosed());
    jsonParserSequence.close();
    assertTrue(jsonParserSequence.isClosed());
    assertNull(jsonParserSequence.nextToken());
}
Also used : IOContext(com.fasterxml.jackson.core.io.IOContext) ReaderBasedJsonParser(com.fasterxml.jackson.core.json.ReaderBasedJsonParser) BaseTest(com.fasterxml.jackson.core.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.fasterxml.jackson.core.BaseTest)1 IOContext (com.fasterxml.jackson.core.io.IOContext)1 ReaderBasedJsonParser (com.fasterxml.jackson.core.json.ReaderBasedJsonParser)1 Test (org.junit.Test)1