[ 
https://issues.apache.org/jira/browse/SUREFIRE-2164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726372#comment-17726372
 ] 

ASF GitHub Bot commented on SUREFIRE-2164:
------------------------------------------

michael-o commented on code in PR #645:
URL: https://github.com/apache/maven-surefire/pull/645#discussion_r1205937494


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java:
##########
@@ -387,7 +390,9 @@ private void startTestElement(XMLWriter ppw, 
WrappedReportEntry report) throws I
             ppw.addAttribute("classname", extraEscapeAttribute(className));
         }
 
-        ppw.addAttribute("time", report.elapsedTimeAsString());

Review Comment:
   Yet another problem is that it was used only in one dir, not in both which 
is inconsistent and non-portable. I have basically applied what Ant does: 
https://github.com/apache/ant/blob/6f68fbdefad521741b37304cfdfc6d8646cf1839/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java#L189-L190





> Simplify serialization of elapsed time in StatelessXmlReporter
> --------------------------------------------------------------
>
>                 Key: SUREFIRE-2164
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2164
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: xml generation
>    Affects Versions: 3.1.0
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: 3.1.1
>
>
> The current code uses a convoluted solution based on {{NumberFormat}} which 
> refers to an outdated defintion on Ant's XML report file. These days, we can 
> use {{String#valueOf()}} to serialize the string representation of a float 
> value since:
> * Easier to understand and this is not human output (separation of concerns)
> * Ant's XMLJUnitResultFormatter does exactly the same with a double value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to