Permalink
Browse files

Fixed a few minor issues

  • Loading branch information...
1 parent 8d70a2e commit 6615b898bc4a79371653fde97de7b10c528b4d4f Nicholas committed Mar 5, 2011
View
@@ -1,4 +1,6 @@
nbproject/
tmp/
+_tmp/
+_tests/
src/com/yahoo/platform/yuitest/coverage/ES3YUITestLexer.java
src/com/yahoo/platform/yuitest/coverage/ES3YUITestParser.java
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -70,16 +70,28 @@ public SummaryCoverageReport(File[] files) throws IOException, JSONException {
public SummaryCoverageReport(Reader in) throws IOException, JSONException {
StringBuilder builder = new StringBuilder();
int c;
-
+
while((c = in.read()) != -1){
builder.append((char)c);
}
-
+
this.data = new JSONObject(builder.toString());
this.directories = new HashMap<String,DirectoryCoverageReport>();
generateFileReports();
}
-
+
+ /**
+ * Creates a new report object from a reader.
+ * @param in The reader containing JSON information.
+ * @throws java.io.IOException
+ * @throws org.json.JSONException
+ */
+ public SummaryCoverageReport(String input) throws IOException, JSONException {
+ this.data = new JSONObject(input);
+ this.directories = new HashMap<String,DirectoryCoverageReport>();
+ generateFileReports();
+ }
+
/**
* Creates a new report object from a JSON object.
* @param data The JSON object containing coverage data.
@@ -387,7 +387,7 @@ private SessionResult runTestPage(Selenium selenium, String browser,
SummaryCoverageReport coverageReport = null;
if (coverageResults != null){
- coverageReport = new SummaryCoverageReport(new StringReader(coverageResults));
+ coverageReport = new SummaryCoverageReport(coverageResults);
result.setCoverageReport(coverageReport);
}
View
Binary file not shown.

0 comments on commit 6615b89

Please sign in to comment.