maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r427080 - /maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
Date Mon, 31 Jul 2006 11:45:30 GMT
Author: brett
Date: Mon Jul 31 04:45:30 2006
New Revision: 427080

URL: http://svn.apache.org/viewvc?rev=427080&view=rev
Log:
[MSUREFIRE-148] try to make the test work on Linux

Modified:
    maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java

Modified: maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java?rev=427080&r1=427079&r2=427080&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
(original)
+++ maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
Mon Jul 31 04:45:30 2006
@@ -28,26 +28,28 @@
 public class UrlUtilsTest
     extends TestCase
 {
+    private String homeDir = System.getProperty( "user.dir" );
+
     public void testTestNoSpecialCharacters()
         throws IOException
     {
-        File f = new File( "C:/Temp/foo.txt" );
-        assertEquals( new URL( "file:/C:/Temp/foo.txt" ), UrlUtils.getURL( f ) );
-        f = new File( "C:/Temp/qwertyuiopasdfghjklzxcvbnm.txt" );
-        assertEquals( new URL( "file:/C:/Temp/qwertyuiopasdfghjklzxcvbnm.txt" ), UrlUtils.getURL(
f ) );
-        f = new File( "C:/Temp/QWERTYUIOPASDFGHJKLZXCVBNM.txt" );
-        assertEquals( new URL( "file:/C:/Temp/QWERTYUIOPASDFGHJKLZXCVBNM.txt" ), UrlUtils.getURL(
f ) );
-        f = new File( "C:/Temp/1234567890.txt" );
-        assertEquals( new URL( "file:/C:/Temp/1234567890.txt" ), UrlUtils.getURL( f ) );
-        f = new File( "C:/Temp/)('*~!._-.txt" );
-        assertEquals( new URL( "file:/C:/Temp/)('*~!._-.txt" ), UrlUtils.getURL( f ) );
+        File f = new File( homeDir, "foo.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/foo.txt" ), UrlUtils.getURL( f ) );
+        f = new File( homeDir, "qwertyuiopasdfghjklzxcvbnm.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/qwertyuiopasdfghjklzxcvbnm.txt" ),
UrlUtils.getURL( f ) );
+        f = new File( homeDir, "QWERTYUIOPASDFGHJKLZXCVBNM.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/QWERTYUIOPASDFGHJKLZXCVBNM.txt" ),
UrlUtils.getURL( f ) );
+        f = new File( homeDir, "1234567890.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/1234567890.txt" ), UrlUtils.getURL(
f ) );
+        f = new File( homeDir, ")('*~!._-.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/)('*~!._-.txt" ), UrlUtils.getURL(
f ) );
     }
 
     public void testTestWithSpaces()
         throws IOException
     {
-        File f = new File( "C:/Temp/foo bar.txt" );
-        assertEquals( new URL( "file:/C:/Temp/foo%20bar.txt" ), UrlUtils.getURL( f ) );
+        File f = new File( homeDir, "foo bar.txt" );
+        assertEquals( new URL( "file:/" + homeDir + "/foo%20bar.txt" ), UrlUtils.getURL(
f ) );
     }
 
 }



Mime
View raw message