use of com.fasterxml.jackson.core.json.JsonFactory in project jackson-core by FasterXML.
the class AsyncSimpleNestedTest method testStuffInObject.
/*
/**********************************************************************
/* Test methods, success
/**********************************************************************
*/
public void testStuffInObject() throws Exception {
byte[] data = _jsonDoc(aposToQuotes("{'foobar':[1,2,-999],'emptyObject':{},'emptyArray':[], 'other':{'':null} }"));
JsonFactory f = JSON_F;
_testStuffInObject(f, data, 0, 100);
_testStuffInObject(f, data, 0, 3);
_testStuffInObject(f, data, 0, 1);
_testStuffInObject(f, data, 1, 100);
_testStuffInObject(f, data, 1, 3);
_testStuffInObject(f, data, 1, 1);
}
use of com.fasterxml.jackson.core.json.JsonFactory in project jackson-core by FasterXML.
the class AsyncSimpleNestedTest method testStuffInArray2.
public void testStuffInArray2() throws Exception {
byte[] data = _jsonDoc(aposToQuotes(String.format("[{'%s':true},{'%s':false},{'%s':true},{'%s':false}]", SHORT_NAME, LONG_NAME, LONG_NAME, SHORT_NAME)));
JsonFactory f = JSON_F;
_testStuffInArray2(f, data, 0, 100);
_testStuffInArray2(f, data, 0, 3);
_testStuffInArray2(f, data, 0, 1);
_testStuffInArray2(f, data, 3, 100);
_testStuffInArray2(f, data, 3, 3);
_testStuffInArray2(f, data, 3, 1);
}
use of com.fasterxml.jackson.core.json.JsonFactory in project jackson-core by FasterXML.
the class AsyncSimpleNestedTest method testMismatchedObject.
public void testMismatchedObject() throws Exception {
byte[] data = _jsonDoc(aposToQuotes("{ ]"));
JsonFactory f = JSON_F;
_testMismatchedObject(f, data, 0, 99);
_testMismatchedObject(f, data, 0, 3);
_testMismatchedObject(f, data, 0, 2);
_testMismatchedObject(f, data, 0, 1);
_testMismatchedObject(f, data, 1, 3);
_testMismatchedObject(f, data, 1, 1);
}
use of com.fasterxml.jackson.core.json.JsonFactory in project jackson-core by FasterXML.
the class AsyncStringArrayTest method testShortAsciiStrings.
public void testShortAsciiStrings() throws IOException {
final String[] input = new String[] { "Test", "", "1", // 60 chars, to stay short
String.format("%s%s%s%s%s%s%s", str0to9, str0to9, str0to9, str0to9, str0to9, str0to9, str0to9), // plus let's do back refs:
"Test", "124" };
JsonFactory f = JSON_F;
byte[] data = _stringDoc(f, input);
// first: require headers, no offsets
_testStrings(f, input, data, 0, 100);
_testStrings(f, input, data, 0, 3);
_testStrings(f, input, data, 0, 1);
// then with some offsets:
_testStrings(f, input, data, 1, 100);
_testStrings(f, input, data, 1, 3);
_testStrings(f, input, data, 1, 1);
}
use of com.fasterxml.jackson.core.json.JsonFactory in project jackson-core by FasterXML.
the class AsyncStringArrayTest method testLongUnicodeStrings.
public void testLongUnicodeStrings() throws IOException {
// ~100 chars for long(er) content
final String LONG = String.format("%s %s %s %s %s%s %s %s %s %s %s %s%c %s", str0to9, str0to9, UNICODE_2BYTES, str0to9, UNICODE_3BYTES, UNICODE_3BYTES, str0to9, str0to9, UNICODE_3BYTES, str0to9, str0to9, UNICODE_2BYTES, UNICODE_2BYTES, str0to9);
final String[] input = new String[] { // let's vary length slightly to try to trigger edge conditions
LONG, LONG + ".", LONG + "..", LONG + "..." };
JsonFactory f = JSON_F;
byte[] data = _stringDoc(f, input);
// first: require headers, no offsets
_testStrings(f, input, data, 0, 9000);
_testStrings(f, input, data, 0, 3);
_testStrings(f, input, data, 0, 1);
// then with some offsets:
_testStrings(f, input, data, 1, 9000);
_testStrings(f, input, data, 1, 3);
_testStrings(f, input, data, 1, 1);
}
Aggregations