}
@Test
public void testJacksonDataCodec() throws IOException
{
JacksonDataCodec codec = new JacksonDataCodec();
testDataCodec(codec, referenceDataMap1);
DataList list1 = codec.bytesToList("[7,27,279]".getBytes());
assertEquals(list1, new DataList(Arrays.asList(7, 27, 279)));
DataList list2 = new DataList(Arrays.asList(321, 21, 1));
assertEquals(codec.listToBytes(list2), "[321,21,1]".getBytes());
DataMap map3 = getMapFromJson(codec, "{ \"a\" : null }");
// out.println(map3.getError());
assertSame(map3.get("a"), Data.NULL);
DataMap map4 = getMapFromJson(codec, "{ \"b\" : 123456789012345678901234567890 }");
// out.println(map4.getError());
assertTrue(map4.getError().indexOf(" value: 123456789012345678901234567890, token: VALUE_NUMBER_INT, number type: BIG_INTEGER not parsed.") != -1);
DataMap map5 = getMapFromJson(codec, "{ \"a\" : null, \"b\" : 123456789012345678901234567890 }");
// out.println(map5.getError());
assertTrue(map5.getError().indexOf(" value: 123456789012345678901234567890, token: VALUE_NUMBER_INT, number type: BIG_INTEGER not parsed.") != -1);
// Test comments
codec.setAllowComments(true);
DataMap map6 = getMapFromJson(codec, "/* abc */ { \"a\" : \"b\" }");
assertEquals(map6.get("a"), "b");
// Test getStringEncoding
String encoding = codec.getStringEncoding();
assertEquals(encoding, "UTF-8");
assertEquals(encoding, JsonEncoding.UTF8.getJavaName());
}