From continuum-commits-return-3292-apmail-maven-continuum-commits-archive=maven.apache.org@maven.apache.org Tue Aug 07 16:06:15 2007 Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 86640 invoked from network); 7 Aug 2007 16:06:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2007 16:06:14 -0000 Received: (qmail 30901 invoked by uid 500); 7 Aug 2007 16:06:13 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 30882 invoked by uid 500); 7 Aug 2007 16:06:13 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 30869 invoked by uid 99); 7 Aug 2007 16:06:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2007 09:06:13 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2007 16:06:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8FBA51A981A; Tue, 7 Aug 2007 09:05:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: continuum-commits@maven.apache.org From: evenisse@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070807160551.8FBA51A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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