Author: hboutemy
Date: Sat Apr  5 04:24:10 2008
New Revision: 645079

URL: http://svn.apache.org/viewvc?rev=645079&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/SurefireReportMojoTest.java

Modified: 
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
URL: 
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java?rev=645079&r1=645078&r2=645079&view=diff
==============================================================================
--- 
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
 (original)
+++ 
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
 Sat Apr  5 04:24:10 2008
@@ -23,7 +23,9 @@
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
+import java.io.UnsupportedEncodingException;
 import java.net.URL;
+import java.net.URLDecoder;
 
 /**
  * @author <a href="mailto:[EMAIL PROTECTED]">Allan Ramirez</a>
@@ -81,10 +83,11 @@
         assertTrue( idx >= 0 );
     }
 
-    private File getUnitBaseDir()
+    private File getUnitBaseDir() throws UnsupportedEncodingException
     {
         URL resource = getClass().getResource( "/unit" );
-        return new File( resource.getPath() ).getAbsoluteFile();
+        // 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 testBasicSurefireReportIfShowSuccessIsFalse()


Reply via email to