maven-surefire-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=427104&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=427104&r1=427103&r2=427104&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 05:45:22 2006
@@ -28,28 +28,39 @@
 public class UrlUtilsTest
     extends TestCase
 {
-    private String homeDir = System.getProperty( "user.dir" );
+    private String homeDir;
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+        homeDir = System.getProperty( "user.dir" );
+        if ( !homeDir.startsWith( "/" ) )
+        {
+            homeDir = "/" + homeDir;
+        }
+    }
 
     public void testTestNoSpecialCharacters()
         throws IOException
     {
         File f = new File( homeDir, "foo.txt" );
-        assertEquals( new URL( "file:/" + homeDir + "/foo.txt" ), UrlUtils.getURL( f ) );
+        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 ) );
+        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 ) );
+        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 ) );
+        assertEquals( new URL( "file:" + homeDir + "/1234567890.txt" ), UrlUtils.getURL(
f ) );
         f = new File( homeDir, ")('*~!._-.txt" );
-        assertEquals( new URL( "file:/" + homeDir + "/)('*~!._-.txt" ), UrlUtils.getURL(
f ) );
+        assertEquals( new URL( "file:" + homeDir + "/)('*~!._-.txt" ), UrlUtils.getURL( f
) );
     }
 
     public void testTestWithSpaces()
         throws IOException
     {
         File f = new File( homeDir, "foo bar.txt" );
-        assertEquals( new URL( "file:/" + homeDir + "/foo%20bar.txt" ), UrlUtils.getURL(
f ) );
+        assertEquals( new URL( "file:" + homeDir + "/foo%20bar.txt" ), UrlUtils.getURL( f
) );
     }
 
 }



Mime
View raw message