-
-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix failing tests * Move test to failing directory
- Loading branch information
Showing
3 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/test/java/com/fasterxml/jackson/failing/filter/BasicParserFilteringTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.fasterxml.jackson.failing.filter; | ||
|
||
import com.fasterxml.jackson.core.BaseTest; | ||
import com.fasterxml.jackson.core.JsonFactory; | ||
import com.fasterxml.jackson.core.JsonParser; | ||
import com.fasterxml.jackson.core.filter.FilteringParserDelegate; | ||
import com.fasterxml.jackson.core.filter.TokenFilter; | ||
import com.fasterxml.jackson.core.filter.TokenFilter.Inclusion; | ||
|
||
public class BasicParserFilteringTest extends BaseTest { | ||
|
||
private final JsonFactory JSON_F = new JsonFactory(); | ||
|
||
static class NoArraysFilter extends TokenFilter | ||
{ | ||
@Override | ||
public TokenFilter filterStartArray() { | ||
return null; | ||
} | ||
} | ||
|
||
// for [core#649] | ||
public void testValueOmitsFieldName1() throws Exception | ||
{ | ||
String jsonString = aposToQuotes("{'a':123,'array':[1,2]}"); | ||
JsonParser p0 = JSON_F.createParser(jsonString); | ||
FilteringParserDelegate p = new FilteringParserDelegate(p0, | ||
new NoArraysFilter(), | ||
Inclusion.INCLUDE_NON_NULL, | ||
true // multipleMatches | ||
); | ||
String result = readAndWrite(JSON_F, p); | ||
assertEquals(aposToQuotes("{'a':123}"), result); | ||
assertEquals(0, p.getMatchCount()); | ||
} | ||
} |