/external/jackson-core/src/test/java/com/fasterxml/jackson/core/read/ |
D | ParserWithObjectsTest.java | 41 JsonParser jp = stream ? in testIsClosed() local 46 assertFalse(jp.isClosed()); in testIsClosed() 47 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testIsClosed() 49 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testIsClosed() 50 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testIsClosed() 51 assertFalse(jp.isClosed()); in testIsClosed() 54 jp.close(); in testIsClosed() 55 assertTrue(jp.isClosed()); in testIsClosed() 57 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testIsClosed() 58 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testIsClosed() [all …]
|
D | ArrayParsingTest.java | 17 JsonParser jp = createParserUsingStream(DOC, "UTF-8"); in testValidEmpty() local 18 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testValidEmpty() 19 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testValidEmpty() 20 assertNull(jp.nextToken()); in testValidEmpty() 21 jp.close(); in testValidEmpty() 28 JsonParser jp = createParserUsingStream(DOC, "UTF-8"); in testInvalidEmptyMissingClose() local 29 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testInvalidEmptyMissingClose() 32 jp.nextToken(); in testInvalidEmptyMissingClose() 37 jp.close(); in testInvalidEmptyMissingClose() 44 JsonParser jp = createParserUsingStream(DOC, "UTF-8"); in testInvalidMissingFieldName() local [all …]
|
D | ParserClosingTest.java | 39 JsonParser jp = f.createParser(input); in testNoAutoCloseReader() local 43 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testNoAutoCloseReader() 44 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testNoAutoCloseReader() 45 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testNoAutoCloseReader() 46 assertNull(jp.nextToken()); in testNoAutoCloseReader() 50 jp.close(); in testNoAutoCloseReader() 63 JsonParser jp = f.createParser(input); in testAutoCloseReader() local 65 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testAutoCloseReader() 67 jp.close(); in testAutoCloseReader() 72 jp = f.createParser(input); in testAutoCloseReader() [all …]
|
D | ParserLinefeedsTest.java | 45 JsonParser jp = useStream ? in _testLinefeeds() local 49 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in _testLinefeeds() 50 assertEquals(1, jp.getCurrentLocation().getLineNr()); in _testLinefeeds() 52 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in _testLinefeeds() 53 assertEquals(1, jp.getIntValue()); in _testLinefeeds() 54 assertEquals(1, jp.getCurrentLocation().getLineNr()); in _testLinefeeds() 56 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in _testLinefeeds() 57 assertEquals(2, jp.getIntValue()); in _testLinefeeds() 58 assertEquals(2, jp.getCurrentLocation().getLineNr()); in _testLinefeeds() 60 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in _testLinefeeds() [all …]
|
/external/jackson-core/src/test/java/com/fasterxml/jackson/core/write/ |
D | ObjectWriteTest.java | 51 JsonParser jp = createParserUsingReader(docStr); in testEmptyObjectWrite() local 52 assertEquals(JsonToken.START_OBJECT, jp.nextToken()); in testEmptyObjectWrite() 53 assertEquals(JsonToken.END_OBJECT, jp.nextToken()); in testEmptyObjectWrite() 54 assertEquals(null, jp.nextToken()); in testEmptyObjectWrite() 55 jp.close(); in testEmptyObjectWrite() 89 JsonParser jp = createParserUsingReader(docStr); in testSimpleObjectWrite() local 90 assertEquals(JsonToken.START_OBJECT, jp.nextToken()); in testSimpleObjectWrite() 91 assertEquals(JsonToken.FIELD_NAME, jp.nextToken()); in testSimpleObjectWrite() 92 assertEquals("first", jp.getText()); in testSimpleObjectWrite() 93 assertEquals(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testSimpleObjectWrite() [all …]
|
D | GeneratorCopyTest.java | 22 JsonParser jp = jf.createParser(new StringReader(DOC)); in testCopyRootTokens() local 28 while ((t = jp.nextToken()) != null) { in testCopyRootTokens() 29 gen.copyCurrentEvent(jp); in testCopyRootTokens() 31 assertToken(t, jp.currentToken()); in testCopyRootTokens() 33 jp.close(); in testCopyRootTokens() 44 JsonParser jp = jf.createParser(new StringReader(DOC)); in testCopyArrayTokens() local 48 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testCopyArrayTokens() 49 gen.copyCurrentEvent(jp); in testCopyArrayTokens() 51 assertToken(JsonToken.VALUE_NUMBER_INT, jp.currentToken()); in testCopyArrayTokens() 52 assertEquals(123, jp.getIntValue()); in testCopyArrayTokens() [all …]
|
D | ArrayWriteTest.java | 48 JsonParser jp = createParserUsingReader(docStr); in testEmptyArrayWrite() local 49 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 50 assertEquals(JsonToken.END_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 51 jp.close(); in testEmptyArrayWrite() 62 jp = createParserUsingReader(docStr); in testEmptyArrayWrite() 63 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 64 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 65 assertEquals(JsonToken.END_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 66 assertEquals(JsonToken.END_ARRAY, jp.nextToken()); in testEmptyArrayWrite() 67 assertEquals(null, jp.nextToken()); in testEmptyArrayWrite() [all …]
|
D | GeneratorMiscTest.java | 107 JsonParser jp = createParserUsingReader(sw.toString()); in testRaw() local 108 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testRaw() 109 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testRaw() 110 assertEquals(-123, jp.getIntValue()); in testRaw() 111 assertToken(JsonToken.VALUE_TRUE, jp.nextToken()); in testRaw() 112 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testRaw() 113 assertEquals("x", jp.getText()); in testRaw() 114 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testRaw() 115 jp.close(); in testRaw() 129 JsonParser jp = createParserUsingReader(sw.toString()); in testRawValue() local [all …]
|
D | PrettyPrinterTest.java | 235 JsonParser jp = createParserUsingReader(docStr); in _verifyPrettyPrinter() local 237 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in _verifyPrettyPrinter() 239 assertEquals(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in _verifyPrettyPrinter() 240 assertEquals(3, jp.getIntValue()); in _verifyPrettyPrinter() 241 assertEquals(JsonToken.VALUE_STRING, jp.nextToken()); in _verifyPrettyPrinter() 242 assertEquals("abc", jp.getText()); in _verifyPrettyPrinter() 244 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in _verifyPrettyPrinter() 245 assertEquals(JsonToken.VALUE_TRUE, jp.nextToken()); in _verifyPrettyPrinter() 246 assertEquals(JsonToken.END_ARRAY, jp.nextToken()); in _verifyPrettyPrinter() 248 assertEquals(JsonToken.START_OBJECT, jp.nextToken()); in _verifyPrettyPrinter() [all …]
|
D | GeneratorBasicTest.java | 45 … JsonParser jp = JSON_F.createParser(new ByteArrayInputStream(bout.toByteArray())); in testStringWrite() local 47 JsonToken t = jp.nextToken(); in testStringWrite() 50 assertEquals(input, jp.getText()); in testStringWrite() 51 assertEquals(null, jp.nextToken()); in testStringWrite() 52 jp.close(); in testStringWrite() 91 JsonParser jp = createParserUsingReader(docStr); in testBooleanWrite() local 92 JsonToken t = jp.nextToken(); in testBooleanWrite() 94 if (!exp.equals(jp.getText())) { in testBooleanWrite() 95 fail("Expected '"+exp+"', got '"+jp.getText()); in testBooleanWrite() 98 assertEquals(null, jp.nextToken()); in testBooleanWrite() [all …]
|
D | RawStringWriteTest.java | 33 JsonParser jp = JSON_F.createParser(json); in testUtf8RawStrings() local 34 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testUtf8RawStrings() 36 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testUtf8RawStrings() 37 String string = jp.getText(); in testUtf8RawStrings() 42 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testUtf8RawStrings() 43 jp.close(); in testUtf8RawStrings() 67 JsonParser jp = JSON_F.createParser(json); in testUtf8StringsWithEscaping() local 68 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testUtf8StringsWithEscaping() 70 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testUtf8StringsWithEscaping() 71 String string = jp.getText(); in testUtf8StringsWithEscaping() [all …]
|
/external/jackson-core/src/test/java/com/fasterxml/jackson/core/json/ |
D | TestParserOverrides.java | 45 JsonParser jp = useStream ? in _testTokenAccess() local 48 assertNull(jp.currentToken()); in _testTokenAccess() 49 jp.clearCurrentToken(); in _testTokenAccess() 50 assertNull(jp.currentToken()); in _testTokenAccess() 51 assertNull(jp.getEmbeddedObject()); in _testTokenAccess() 52 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in _testTokenAccess() 53 assertToken(JsonToken.START_ARRAY, jp.currentToken()); in _testTokenAccess() 54 jp.clearCurrentToken(); in _testTokenAccess() 55 assertNull(jp.currentToken()); in _testTokenAccess() 58 jp.readValueAsTree(); in _testTokenAccess() [all …]
|
D | RequestPayloadOnExceptionTest.java | 60 … JsonParser jp = isStream ? createParserUsingStream(doc, "UTF-8") : createParserUsingReader(doc); in testRequestPayloadAsBytesOnParseExceptionInternal() local 61 jp.setRequestPayloadOnError(doc.getBytes(), "UTF-8"); in testRequestPayloadAsBytesOnParseExceptionInternal() 62 assertToken(JsonToken.START_OBJECT, jp.nextToken()); in testRequestPayloadAsBytesOnParseExceptionInternal() 64 jp.nextToken(); in testRequestPayloadAsBytesOnParseExceptionInternal() 70 jp.close(); in testRequestPayloadAsBytesOnParseExceptionInternal() 75 … JsonParser jp = isStream ? createParserUsingStream(doc, "UTF-8") : createParserUsingReader(doc); in testRequestPayloadAsStringOnParseExceptionInternal() local 76 jp.setRequestPayloadOnError(doc); in testRequestPayloadAsStringOnParseExceptionInternal() 77 assertToken(JsonToken.START_OBJECT, jp.nextToken()); in testRequestPayloadAsStringOnParseExceptionInternal() 79 jp.nextToken(); in testRequestPayloadAsStringOnParseExceptionInternal() 85 jp.close(); in testRequestPayloadAsStringOnParseExceptionInternal() [all …]
|
D | TestCharEscaping.java | 55 JsonParser jp = createParser(JSON_F, readMode, DOC); in _testMissingEscaping() local 56 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in _testMissingEscaping() 59 JsonToken t = jp.nextToken(); in _testMissingEscaping() 62 jp.getText(); in _testMissingEscaping() 67 jp.close(); in _testMissingEscaping() 82 JsonParser jp = createParser(JSON_F, readMode, DOC); in _testSimpleEscaping() local 83 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in _testSimpleEscaping() 84 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in _testSimpleEscaping() 85 assertEquals("LF=\n", jp.getText()); in _testSimpleEscaping() 86 jp.close(); in _testSimpleEscaping() [all …]
|
D | TestUnicode.java | 26 JsonParser jp = f.createParser(json); in _testSurrogates() local 27 assertToken(JsonToken.START_OBJECT, jp.nextToken()); in _testSurrogates() 28 assertToken(JsonToken.FIELD_NAME, jp.nextToken()); in _testSurrogates() 30 assertEquals("text", jp.getText()); in _testSurrogates() 32 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in _testSurrogates() 34 assertEquals("\uD83D\uDE03", jp.getText()); in _testSurrogates() 36 assertToken(JsonToken.END_OBJECT, jp.nextToken()); in _testSurrogates() 37 jp.close(); in _testSurrogates()
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/ser/jdk/ |
D | UntypedSerializationTest.java | 36 JsonParser jp = f.createParser(str); in testFromArray() local 37 assertEquals(JsonToken.START_ARRAY, jp.nextToken()); in testFromArray() 39 assertEquals(JsonToken.VALUE_STRING, jp.nextToken()); in testFromArray() 40 assertEquals("Elem1", getAndVerifyText(jp)); in testFromArray() 42 assertEquals(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testFromArray() 43 assertEquals(3, jp.getIntValue()); in testFromArray() 45 assertEquals(JsonToken.START_OBJECT, jp.nextToken()); in testFromArray() 46 assertEquals(JsonToken.FIELD_NAME, jp.nextToken()); in testFromArray() 47 assertEquals("first", getAndVerifyText(jp)); in testFromArray() 49 assertEquals(JsonToken.VALUE_TRUE, jp.nextToken()); in testFromArray() [all …]
|
D | CollectionSerializationTest.java | 127 JsonParser jp = new JsonFactory().createParser(json); in testCollections() local 128 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testCollections() 130 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testCollections() 131 assertEquals(i, jp.getIntValue()); in testCollections() 133 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testCollections() 134 jp.close(); in testCollections() 148 JsonParser jp = null; in testBigCollection() local 153 jp = new JsonFactory().createParser(data); in testBigCollection() 160 jp = createParserUsingReader(sw.toString()); in testBigCollection() 166 jp = createParserUsingReader(str); in testBigCollection() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/ |
D | BaseTest.java | 137 protected void verifyJsonSpecSampleDoc(JsonParser jp, boolean verifyContents) in verifyJsonSpecSampleDoc() argument 140 verifyJsonSpecSampleDoc(jp, verifyContents, true); in verifyJsonSpecSampleDoc() 143 protected void verifyJsonSpecSampleDoc(JsonParser jp, boolean verifyContents, in verifyJsonSpecSampleDoc() argument 147 if (!jp.hasCurrentToken()) { in verifyJsonSpecSampleDoc() 148 jp.nextToken(); in verifyJsonSpecSampleDoc() 150 assertToken(JsonToken.START_OBJECT, jp.currentToken()); // main object in verifyJsonSpecSampleDoc() 152 assertToken(JsonToken.FIELD_NAME, jp.nextToken()); // 'Image' in verifyJsonSpecSampleDoc() 154 verifyFieldName(jp, "Image"); in verifyJsonSpecSampleDoc() 157 assertToken(JsonToken.START_OBJECT, jp.nextToken()); // 'image' object in verifyJsonSpecSampleDoc() 159 assertToken(JsonToken.FIELD_NAME, jp.nextToken()); // 'Width' in verifyJsonSpecSampleDoc() [all …]
|
/external/jackson-core/src/test/java/com/fasterxml/jackson/core/sym/ |
D | SymbolTableMergingTest.java | 38 JsonParser jp = _getParser(f, JSON, true); in testByteSymbolsWithEOF() local 39 while (jp.nextToken() != null) { in testByteSymbolsWithEOF() 45 jp.close(); in testByteSymbolsWithEOF() 66 JsonParser jp = _getParser(f, JSON, false); in testCharSymbolsWithEOF() local 67 while (jp.nextToken() != null) { in testCharSymbolsWithEOF() 73 jp.close(); in testCharSymbolsWithEOF() 86 JsonParser jp = _getParser(f, JSON, useBytes); in _testWithClose() local 88 assertToken(JsonToken.START_OBJECT, jp.nextToken()); in _testWithClose() 89 assertToken(JsonToken.FIELD_NAME, jp.nextToken()); in _testWithClose() 90 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in _testWithClose() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/ser/ |
D | TestArraySerialization.java | 21 JsonParser jp = MAPPER.createParser(data); in testLongStringArray() local 22 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testLongStringArray() 23 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testLongStringArray() 24 assertEquals("abc", jp.getText()); in testLongStringArray() 25 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testLongStringArray() 26 String actual = jp.getText(); in testLongStringArray() 29 assertToken(JsonToken.VALUE_NULL, jp.nextToken()); in testLongStringArray() 30 assertToken(JsonToken.VALUE_STRING, jp.nextToken()); in testLongStringArray() 31 assertEquals(str, jp.getText()); in testLongStringArray() 32 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testLongStringArray() [all …]
|
/external/jackson-core/src/test/java/com/fasterxml/jackson/core/format/ |
D | TestJsonFormatDetection.java | 25 JsonParser jp = matcher.createParserWithMatch(); in testSimpleValidArray() local 26 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testSimpleValidArray() 27 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testSimpleValidArray() 28 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testSimpleValidArray() 29 assertToken(JsonToken.END_ARRAY, jp.nextToken()); in testSimpleValidArray() 30 assertNull(jp.nextToken()); in testSimpleValidArray() 31 jp.close(); in testSimpleValidArray() 47 JsonParser jp = matcher.createParserWithMatch(); in testSimpleValidObject() local 48 assertToken(JsonToken.START_OBJECT, jp.nextToken()); in testSimpleValidObject() 49 assertToken(JsonToken.FIELD_NAME, jp.nextToken()); in testSimpleValidObject() [all …]
|
/external/geojson-jackson/src/main/java/org/geojson/jackson/ |
D | LngLatAltDeserializer.java | 16 public LngLatAlt deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { in deserialize() argument 17 if (jp.isExpectedStartArrayToken()) { in deserialize() 18 return deserializeArray(jp, ctxt); in deserialize() 23 …protected LngLatAlt deserializeArray(JsonParser jp, DeserializationContext ctxt) throws IOExceptio… in deserializeArray() argument 25 node.setLongitude(extractDouble(jp, ctxt, false)); in deserializeArray() 26 node.setLatitude(extractDouble(jp, ctxt, false)); in deserializeArray() 27 node.setAltitude(extractDouble(jp, ctxt, true)); in deserializeArray() 29 while (jp.hasCurrentToken() && jp.getCurrentToken() != JsonToken.END_ARRAY) { in deserializeArray() 30 double element = extractDouble(jp, ctxt, true); in deserializeArray() 43 …private double extractDouble(JsonParser jp, DeserializationContext ctxt, boolean optional) throws … in extractDouble() argument [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/module/ |
D | TestTypeModifiers.java | 160 … public MapMarker<?,?> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { in deserialize() argument 161 …if (jp.currentToken() != JsonToken.START_OBJECT) throw new IOException("Wrong token: "+jp.currentT… in deserialize() 162 …if (jp.nextToken() != JsonToken.FIELD_NAME) throw new IOException("Wrong token: "+jp.currentToken(… in deserialize() 163 String key = jp.currentName(); in deserialize() 164 …if (jp.nextToken() != JsonToken.VALUE_NUMBER_INT) throw new IOException("Wrong token: "+jp.current… in deserialize() 165 int value = jp.getIntValue(); in deserialize() 166 …if (jp.nextToken() != JsonToken.END_OBJECT) throw new IOException("Wrong token: "+jp.currentToken(… in deserialize() 183 …public MyCollectionLikeType deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExcep… in deserialize() argument 184 …if (jp.currentToken() != JsonToken.START_ARRAY) throw new IOException("Wrong token: "+jp.currentTo… in deserialize() 185 …if (jp.nextToken() != JsonToken.VALUE_NUMBER_INT) throw new IOException("Wrong token: "+jp.current… in deserialize() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/seq/ |
D | ReadValuesTest.java | 169 JsonParser jp = MAPPER.createParser(JSON); in testRootBeansWithParser() local 171 Iterator<Bean> it = jp.readValuesAs(Bean.class); in testRootBeansWithParser() 185 JsonParser jp = MAPPER.createParser(JSON); in testRootArraysWithParser() local 189 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testRootArraysWithParser() 191 Iterator<int[]> it = MAPPER.readerFor(int[].class).readValues(jp); in testRootArraysWithParser() 205 JsonParser jp = MAPPER.createParser(JSON); in testHasNextWithEndArray() local 209 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testHasNextWithEndArray() 210 jp.nextToken(); in testHasNextWithEndArray() 212 Iterator<Integer> it = MAPPER.readerFor(Integer.class).readValues(jp); in testHasNextWithEndArray() 246 JsonParser jp = MAPPER.createParser(JSON); in testNonRootBeans() local [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/misc/ |
D | TestBlocking.java | 25 JsonParser jp = createParserUsingReader("[ 1 "); in testEagerAdvance() local 26 assertToken(JsonToken.START_ARRAY, jp.nextToken()); in testEagerAdvance() 27 assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken()); in testEagerAdvance() 30 Integer I = mapper.readValue(jp, Integer.class); in testEagerAdvance() 35 jp.nextToken(); in testEagerAdvance() 39 jp.close(); in testEagerAdvance()
|