You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ma...@apache.org on 2007/07/03 13:46:03 UTC
svn commit: r552791 -
/maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
Author: markh
Date: Tue Jul 3 04:46:02 2007
New Revision: 552791
URL: http://svn.apache.org/viewvc?view=rev&rev=552791
Log:
Fix test to use proper encoding when path contains spaces.
Modified:
maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
Modified: maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java?view=diff&rev=552791&r1=552790&r2=552791
==============================================================================
--- maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java (original)
+++ maven/shared/trunk/maven-invoker/src/test/java/org/apache/maven/shared/invoker/DefaultInvokerTest.java Tue Jul 3 04:46:02 2007
@@ -2,6 +2,8 @@
import java.io.File;
import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -17,7 +19,7 @@
{
public void testBuildShouldSucceed()
- throws IOException, MavenInvocationException
+ throws IOException, MavenInvocationException, URISyntaxException
{
File basedir = getBasedirForBuild();
@@ -43,7 +45,7 @@
}
public void testBuildShouldFail()
- throws IOException, MavenInvocationException
+ throws IOException, MavenInvocationException, URISyntaxException
{
File basedir = getBasedirForBuild();
@@ -84,6 +86,7 @@
}
private File getBasedirForBuild()
+ throws URISyntaxException
{
StackTraceElement element = new NullPointerException().getStackTrace()[1];
String methodName = element.getMethodName();
@@ -98,7 +101,7 @@
throw new IllegalStateException( "Project: " + dirName + " for test method: " + methodName + " is missing." );
}
- return new File( dirResource.getPath() );
+ return new File( new URI( dirResource.toString() ).getPath() );
}
}