Skip to content

Commit

Permalink
#62 fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Jun 16, 2015
1 parent 098c9dd commit 7077062
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/test/java/com/cflint/TestJSONOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.io.StringWriter;
import java.io.Writer;

import org.json.simple.JSONArray;
import org.json.simple.JSONValue;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -29,7 +31,7 @@ public void testOutput1() throws IOException {
BugInfo bugInfo = new BugInfo.BugInfoBuilder().setFunction("testf").setMessageCode("PARSE_ERROR").setFilename("c:\\temp\\test.cfc").build();
bugList.add(bugInfo);
outputer.output(bugList, writer);
assertEquals("[{\"severity\":\"\",\"locations\":[{\"fileName\":\"test.cfc\",\"file\":\"c:\\\\temp\\\\test.cfc\",\"expression\":\"\",\"line\":\"0\",\"column\":\"0\",\"variable\":\"\",\"message\":\"\"}],\"id\":\"PARSE_ERROR\",\"abbrev\":\"PE\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\"}]",
writer.toString());
String expectedText = "[{\"severity\":\"\",\"locations\":[{\"fileName\":\"test.cfc\",\"file\":\"c:\\\\temp\\\\test.cfc\",\"expression\":\"\",\"line\":\"0\",\"column\":\"0\",\"variable\":\"\",\"message\":\"\"}],\"id\":\"PARSE_ERROR\",\"abbrev\":\"PE\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\"}]";
assertEquals(JSONValue.parse(expectedText),JSONValue.parse(writer.toString()));
}
}

0 comments on commit 7077062

Please sign in to comment.