Search in sources :

Example 1 with MockDataInput

use of com.fasterxml.jackson.core.testsupport.MockDataInput 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("{}")));
}
Also used : MockDataInput(com.fasterxml.jackson.core.testsupport.MockDataInput) ObjectReadContext(com.fasterxml.jackson.core.ObjectReadContext) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

ObjectReadContext (com.fasterxml.jackson.core.ObjectReadContext)1 MockDataInput (com.fasterxml.jackson.core.testsupport.MockDataInput)1 Parameters (org.junit.runners.Parameterized.Parameters)1