Author: hboutemy
Date: Sat Apr 5 04:45:53 2008
New Revision: 645082
URL: http://svn.apache.org/viewvc?rev=645082&view=rev
Log:
fixed tests when there are spaces in directory name
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java?rev=645082&r1=645081&r2=645082&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
(original)
+++
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
Sat Apr 5 04:45:53 2008
@@ -23,7 +23,9 @@
import org.apache.maven.reporting.MavenReportException;
import java.io.File;
+import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.net.URLDecoder;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Iterator;
@@ -47,7 +49,7 @@
}
public void testParseXMLReportFiles()
- throws MavenReportException
+ throws MavenReportException, UnsupportedEncodingException
{
report.setReportsDirectory( getTestDir( "/test-reports" ) );
@@ -65,10 +67,11 @@
}
}
- private File getTestDir( String path )
+ private File getTestDir( String path ) throws UnsupportedEncodingException
{
URL resource = getClass().getResource( path );
- return new File( resource.getPath() );
+ // URLDecoder.decode necessary for JDK 1.5+, where spaces are escaped
to %20
+ return new File( URLDecoder.decode( resource.getPath(), "UTF-8" )
).getAbsoluteFile();
}
public void testParseTestSuiteName()