Author: brett
Date: Fri Apr 28 20:01:54 2006
New Revision: 398072

URL: http://svn.apache.org/viewcvs?rev=398072&view=rev
Log:
fix surefire booter tests that were missing a required dependency and didn't 
compile

Modified:
    maven/surefire/branches/surefire-testng/surefire-booter/pom.xml
    
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
    
maven/surefire/branches/surefire-testng/surefire-booter/src/test/java/org/apache/maven/surefire/SurefireBooterTest.java

Modified: maven/surefire/branches/surefire-testng/surefire-booter/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/pom.xml?rev=398072&r1=398071&r2=398072&view=diff
==============================================================================
--- maven/surefire/branches/surefire-testng/surefire-booter/pom.xml (original)
+++ maven/surefire/branches/surefire-testng/surefire-booter/pom.xml Fri Apr 28 
20:01:54 2006
@@ -30,5 +30,11 @@
       <artifactId>surefire-api</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

Modified: 
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL: 
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=398072&r1=398071&r2=398072&view=diff
==============================================================================
--- 
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
 (original)
+++ 
maven/surefire/branches/surefire-testng/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
 Fri Apr 28 20:01:54 2006
@@ -194,7 +194,7 @@
             Method run = surefireClass.getMethod( "run", new 
Class[]{List.class, List.class, ClassLoader.class,
                 ClassLoader.class} );
 
-            ClassLoader oldContextClassLoader = Thread.currentThread() 
.getContextClassLoader();
+            ClassLoader oldContextClassLoader = 
Thread.currentThread().getContextClassLoader();
 
             Thread.currentThread().setContextClassLoader( testsClassLoader );
 
@@ -701,11 +701,11 @@
 
     /**
      * Split a string in a List of Strings using a delimiter. Same as Java 1.4 
String.split( String )
-     * 
-     * @since 1.5.4
-     * @param s the string to be splitted
+     *
+     * @param s         the string to be splitted
      * @param delimiter the delimiter to be used
      * @return an array with the Strings between the delimiters
+     * @since 1.5.4
      */
     public static String[] split( String s, String delimiter )
     {
@@ -714,7 +714,7 @@
         {
             delim = "|";
         }
-        if ( s.equals(delim) )
+        if ( s.equals( delim ) )
         {
             return new String[0];
         }

Modified: 
maven/surefire/branches/surefire-testng/surefire-booter/src/test/java/org/apache/maven/surefire/SurefireBooterTest.java
URL: 
http://svn.apache.org/viewcvs/maven/surefire/branches/surefire-testng/surefire-booter/src/test/java/org/apache/maven/surefire/SurefireBooterTest.java?rev=398072&r1=398071&r2=398072&view=diff
==============================================================================
--- 
maven/surefire/branches/surefire-testng/surefire-booter/src/test/java/org/apache/maven/surefire/SurefireBooterTest.java
 (original)
+++ 
maven/surefire/branches/surefire-testng/surefire-booter/src/test/java/org/apache/maven/surefire/SurefireBooterTest.java
 Fri Apr 28 20:01:54 2006
@@ -1,11 +1,5 @@
 package org.apache.maven.surefire;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
 /*
  * Copyright 2001-2006 The Apache Software Foundation.
  *
@@ -22,6 +16,11 @@
  * limitations under the License.
  */
 
+import junit.framework.TestCase;
+import org.apache.maven.surefire.booter.SurefireBooter;
+
+import java.util.Collections;
+
 /**
  * @author <a href="mailto:[EMAIL PROTECTED]">Carlos Sanchez</a>
  * @version $Id$
@@ -35,63 +34,62 @@
      */
     public void testSplit()
     {
-        String s, d;
-        d = ":";
-        s = "x1:y2:z;j:f";
-        List list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1", "y2", "z;j", "f" } 
), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        String d = ":";
+        String s = "x1:y2:z;j:f";
+        String[] list = SurefireBooter.split( s, d );
+        assertEquals( new String[]{"x1", "y2", "z;j", "f"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "x1";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{"x1"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "x1:";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{"x1"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{""}, list );
+        assertEquals( s.split( d ), list );
 
         s = ":";
         list = SurefireBooter.split( s, d );
         assertEquals( Collections.EMPTY_LIST, list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( s.split( d ), list );
 
         d = "::";
         s = "x1::y2::z;j::f";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1", "y2", "z;j", "f" } 
), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{"x1", "y2", "z;j", "f"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "x1";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{"x1"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "x1::";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "x1" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{"x1"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { "" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{""}, list );
+        assertEquals( s.split( d ), list );
 
         s = ":";
         list = SurefireBooter.split( s, d );
-        assertEquals( Arrays.asList( new String[] { ":" } ), list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( new String[]{":"}, list );
+        assertEquals( s.split( d ), list );
 
         s = "::";
         list = SurefireBooter.split( s, d );
         assertEquals( Collections.EMPTY_LIST, list );
-        assertEquals( Arrays.asList( s.split( d ) ), list );
+        assertEquals( s.split( d ), list );
     }
 
 }


Reply via email to