continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r563538 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Date Tue, 07 Aug 2007 16:05:51 GMT
Author: evenisse
Date: Tue Aug  7 09:05:50 2007
New Revision: 563538

URL: http://svn.apache.org/viewvc?view=rev&rev=563538
Log:
[CONTINUUM-1346] Fix time parsing error in test results when time is greater than 1000s

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?view=diff&rev=563538&r1=563537&r2=563538
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Tue Aug  7 09:05:50 2007
@@ -47,11 +47,14 @@
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+import java.text.NumberFormat;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -316,7 +319,20 @@
                 int suiteFailureCount = Integer.parseInt( parser.getAttributeValue( null,
"errors" ) ) +
                     Integer.parseInt( parser.getAttributeValue( null, "failures" ) );
 
-                long suiteTotalTime = (long) ( 1000 * Double.parseDouble( parser.getAttributeValue(
null, "time" ) ) );
+                String time = parser.getAttributeValue( null, "time" );
+                NumberFormat nf = NumberFormat.getInstance( Locale.ENGLISH );
+                double dTime = 0;
+
+                try
+                {
+                    dTime = nf.parse( time ).doubleValue();
+                }
+                catch ( ParseException nfe )
+                {
+                    getLogger().warn( "Can't parse time value (" + time + ") in " + xmlFile.getAbsolutePath()
);
+                }
+
+                long suiteTotalTime = (long) ( 1000 * dTime );
 
                 // TODO: add tests attribute to testsuite element so we only
                 // have to parse the rest of the file if there are failures



Mime
View raw message