Skip to content

Commit

Permalink
fix SAX bug
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed May 23, 2023
1 parent e27ff14 commit 2fe0ad0
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -131,6 +131,8 @@ public void startElement(String uri, String localName, String qName, Attributes
classesToSuitesIndex.put(defaultSuite.getFullClassName(), suites.size() - 1);
break;
case "testcase":
// Although this element does not contain any text, this line must be retained because the
// nested elements do have text content.
currentElement = new StringBuilder();

testCase = new ReportTestCase().setName(attributes.getValue("name"));
Expand Down Expand Up @@ -162,10 +164,14 @@ public void startElement(String uri, String localName, String qName, Attributes
}
break;
case "failure":
currentElement = new StringBuilder();

testCase.setFailure(attributes.getValue("message"), attributes.getValue("type"));
currentSuite.incrementNumberOfFailures();
break;
case "error":
currentElement = new StringBuilder();

testCase.setError(attributes.getValue("message"), attributes.getValue("type"));
currentSuite.incrementNumberOfErrors();
break;
Expand All @@ -181,6 +187,9 @@ public void startElement(String uri, String localName, String qName, Attributes
case "failsafe-summary":
valid = false;
break;
case "time":
currentElement = new StringBuilder();
break;
default:
break;
}
Expand Down

0 comments on commit 2fe0ad0

Please sign in to comment.