Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Commit

Permalink
switched to nullJsonHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Krause committed Apr 26, 2016
1 parent 2704015 commit 5c72af6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import net.markenwerk.utils.json.common.JsonSyntaxError;
import net.markenwerk.utils.json.common.JsonSyntaxException;
import net.markenwerk.utils.json.handler.NullJsonHandler;
import net.markenwerk.utils.json.parser.events.ArrayBeginJsonEvent;
import net.markenwerk.utils.json.parser.events.ArrayEndJsonEvent;
import net.markenwerk.utils.json.parser.events.BooleanJsonEvent;
Expand Down Expand Up @@ -70,7 +71,7 @@ public void emptyDocument() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource(""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -89,7 +90,7 @@ public void nonEmpty_invalidStart() throws IOException {
JsonParserMode.STRICT_STRUCT_MODE);
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -283,7 +284,7 @@ public void literal_singleInvalidLiteal() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("x"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -408,7 +409,7 @@ public void string_singleNonEmptyStringDangelingEscapeSequence() throws IOExcept
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -426,7 +427,7 @@ public void string_singleNonEmptyStringUnterminatedEscapeSequence() throws IOExc
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\\""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -444,7 +445,7 @@ public void string_singleNonEmptyStringInvalidEscapeSequence() throws IOExceptio
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\x\""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -462,7 +463,7 @@ public void string_singleNonEmptyStringDangelingUnicodeEscapeSequence() throws I
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\u"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -480,7 +481,7 @@ public void string_singleNonEmptyStringUnterminatedUnicodeEscapeSequence() throw
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\u\""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -498,7 +499,7 @@ public void string_singleNonEmptyStringInvalidUnicodeEscapeSequence() throws IOE
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("\"\\uNOPE\""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -596,7 +597,7 @@ public void emptyArray_unfinished() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("["));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -614,7 +615,7 @@ public void emptyArray_wrongFinish() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[}"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -632,7 +633,7 @@ public void emptyArray_trailingNonWhitespace() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[]X"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -715,7 +716,7 @@ public void nonEmptyArray_unfinishedDangelingValue() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[null"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -733,7 +734,7 @@ public void nonEmptyArray_wrongFinish() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[null}"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -751,7 +752,7 @@ public void nonEmptyArray_unfinishedDangelingComma() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[null,"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -769,7 +770,7 @@ public void nonEmptyArray_dengelingCommaWrongFinish() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("[null,]"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -807,7 +808,7 @@ public void emptyObject_unfinished() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -825,7 +826,7 @@ public void emptyObject_wrongFinish() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{]"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -912,7 +913,7 @@ public void nonEmptyObject_unfinishedNoName() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{null}"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -930,7 +931,7 @@ public void nonEmptyObject_unfinishedDangelingName() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\""));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -948,7 +949,7 @@ public void nonEmptyObject_unfinishedDangelingColon() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\":"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -966,7 +967,7 @@ public void nonEmptyObject_unfinishedDangelingValue() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\":null"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -984,7 +985,7 @@ public void nonEmptyObject_unfinishedDangelingComma() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\":null,"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -1002,7 +1003,7 @@ public void nonEmptyObject_unfinishedNoValue() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\",null}"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -1020,7 +1021,7 @@ public void nonEmptyObject_unfinishedKeyAfterComma() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\":null,null}"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand All @@ -1038,7 +1039,7 @@ public void nonEmptyObject_wrongFinish() throws IOException {
DefaultJsonPushParser jsonParser = new DefaultJsonPushParser(getSource("{\"foo\":null]"));
try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException exception) {
Expand Down Expand Up @@ -1174,7 +1175,7 @@ public void syntaxError_position() throws IOException {

try {

jsonParser.handle(new NullHandler());
jsonParser.handle(new NullJsonHandler());

throw new RuntimeException("Expected JsonSyntaxException");
} catch (JsonSyntaxException e) {
Expand Down
65 changes: 0 additions & 65 deletions src/test/java/net/markenwerk/utils/json/parser/NullHandler.java

This file was deleted.

0 comments on commit 5c72af6

Please sign in to comment.