You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/05/24 13:23:57 UTC
[maven-surefire] branch fix-sax-bug updated (2fe0ad0c1 -> ab2e7b429)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch fix-sax-bug
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
discard 2fe0ad0c1 fix SAX bug
new ab2e7b429 [SUREFIRE-2165] TestSuiteXmlParser does not capture text per element causing concatenated text produced
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (2fe0ad0c1)
\
N -- N -- N refs/heads/fix-sax-bug (ab2e7b429)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
[maven-surefire] 01/01: [SUREFIRE-2165] TestSuiteXmlParser does not capture text per element causing concatenated text produced
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch fix-sax-bug
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit ab2e7b42984852cd8f9029b46930e0e61401bd58
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon May 22 19:06:39 2023 +0200
[SUREFIRE-2165] TestSuiteXmlParser does not capture text per element causing concatenated text produced
This closes #642
---
.../apache/maven/plugins/surefire/report/TestSuiteXmlParser.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
index 83ccc0619..3cc15a670 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
@@ -131,6 +131,8 @@ public final class TestSuiteXmlParser extends DefaultHandler {
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"));
@@ -162,10 +164,14 @@ public final class TestSuiteXmlParser extends DefaultHandler {
}
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;
@@ -181,6 +187,9 @@ public final class TestSuiteXmlParser extends DefaultHandler {
case "failsafe-summary":
valid = false;
break;
+ case "time":
+ currentElement = new StringBuilder();
+ break;
default:
break;
}