michael-o commented on issue #2715:
URL:
https://github.com/apache/maven-surefire/issues/2715#issuecomment-3645736134
@thomasmey Please try:
```
index c0643fd92..1b0693cc7 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
@@ -114,7 +114,7 @@ public void startElement(String uri, String localName,
String qName, Attributes
currentSuite = defaultSuite;
String timeStr = attributes.getValue("time");
if (timeStr != null) {
-
defaultSuite.setTimeElapsed(Float.parseFloat(timeStr));
+
defaultSuite.setTimeElapsed(Float.parseFloat(timeStr.replaceAll(",", "")));
} else {
consoleLogger.warning("No time attribute found
on testsuite element");
}
@@ -157,7 +157,7 @@ public void startElement(String uri, String localName,
String qName, Attributes
testCase.setFullClassName(currentSuite.getFullClassName())
.setClassName(currentSuite.getName())
.setFullName(currentSuite.getFullClassName() + "." + testCase.getName())
- .setTime(timeStr != null ?
Float.parseFloat(timeStr) : 0.0f);
+ .setTime(timeStr != null ?
Float.parseFloat(timeStr.replaceAll(",", "")) : 0.0f);
if (currentSuite != defaultSuite) {
currentSuite.setTimeElapsed(testCase.getTime()
+ currentSuite.getTimeElapsed());
@@ -228,7 +228,7 @@ public void endElement(String uri, String localName,
String qName) throws SAXExc
break;
case "time":
try {
-
defaultSuite.setTimeElapsed(Float.parseFloat(currentElement.toString()));
+
defaultSuite.setTimeElapsed(Float.parseFloat(currentElement.toString().replaceAll(",",
"")));
} catch (NumberFormatException e) {
throw new SAXException("Failed to parse time value", e);
}
```
No fuzz, simple and stupid patch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]