maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1076673 - in /maven/surefire/trunk: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ surefire-booter/src/main/java/org/apache/maven/sur...
Date Thu, 03 Mar 2011 16:39:20 GMT
Author: krosenvold
Date: Thu Mar  3 16:39:19 2011
New Revision: 1076673

URL: http://svn.apache.org/viewvc?rev=1076673&view=rev
Log:
o Minor cleanups around classpath construction

Modified:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
    maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
Thu Mar  3 16:39:19 2011
@@ -357,58 +357,45 @@ public abstract class AbstractSurefireMo
                                                                ClassLoaderConfiguration classLoaderConfiguration
)
         throws MojoExecutionException, MojoFailureException
     {
-        final ClasspathConfiguration classpathConfiguration =
-            new ClasspathConfiguration( isEnableAssertions(), isChildDelegation() );
 
-        String providerName;
         try
         {
             provider.addProviderProperties();
-            provider.addProviderArtifactToSurefireClasspath( classpathConfiguration );
-            providerName = provider.getProviderName();
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new MojoExecutionException(
-                "Unable to locate required surefire provider dependency: " + e.getMessage(),
e );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new MojoExecutionException( "Error to resolving surefire provider dependency:
" + e.getMessage(), e );
-        }
+            String providerName = provider.getProviderName();
+            final Classpath providerClasspath = provider.getProviderClasspath();
+            final Classpath testClasspath = generateTestClasspath();
+
+            logClasspath(  testClasspath, "test classpath" );
+            logClasspath(  testClasspath, "provider classpath" );
+             final ClasspathConfiguration classpathConfiguration =new ClasspathConfiguration(
testClasspath, providerClasspath,
+                                        isEnableAssertions(), isChildDelegation() );
 
-        List classpathElements;
-        try
-        {
-            classpathElements = generateTestClasspath();
+            return new StartupConfiguration( providerName, classpathConfiguration, classLoaderConfiguration,
+                                             forkConfiguration.isForking(), false, isRedirectTestOutputToFile()
);
         }
         catch ( DependencyResolutionRequiredException e )
         {
-            throw new MojoExecutionException( "Unable to generate test classpath: " + e,
e );
+            throw new MojoExecutionException( "Unable to generate classpath: " + e, e );
         }
         catch ( ArtifactResolutionException e )
         {
-            throw new MojoExecutionException( "Unable to generate test classpath: " + e,
e );
+            throw new MojoExecutionException( "Unable to generate classpath: " + e, e );
         }
         catch ( ArtifactNotFoundException e )
         {
-            throw new MojoExecutionException( "Unable to generate test classpath: " + e,
e );
+            throw new MojoExecutionException( "Unable to generate classpath: " + e, e );
         }
         catch ( InvalidVersionSpecificationException e )
         {
-            throw new MojoExecutionException( "Unable to generate test classpath: " + e,
e );
+            throw new MojoExecutionException( "Unable to generate classpath: " + e, e );
         }
 
-        addClasspathElementsToClasspathConfiguration( classpathElements, classpathConfiguration
);
-        return new StartupConfiguration( providerName, classpathConfiguration, classLoaderConfiguration,
-                                         forkConfiguration.isForking(), false, isRedirectTestOutputToFile()
);
     }
 
-    private void addClasspathElementsToClasspathConfiguration( List classpathElements,
-                                                               ClasspathConfiguration classpathConfiguration
)
+    public void logClasspath( Classpath classpath, String descriptor )
     {
-        getLog().debug( "Test classpath:" );
-        for ( Iterator i = classpathElements.iterator(); i.hasNext(); )
+        getLog().debug( descriptor + " classpath:" );
+        for ( Iterator i = classpath.getClassPath().iterator(); i.hasNext(); )
         {
             String classpathElement = (String) i.next();
             if ( classpathElement == null )
@@ -418,11 +405,11 @@ public abstract class AbstractSurefireMo
             else
             {
                 getLog().debug( "  " + classpathElement );
-                classpathConfiguration.addClasspathUrl( classpathElement );
             }
         }
     }
 
+
     private boolean isSpecificTestSpecified()
     {
         return getTest() != null;
@@ -727,13 +714,14 @@ public abstract class AbstractSurefireMo
      *          when dependency resolution fails
      * @throws org.apache.maven.plugin.MojoExecutionException
      *          upon other problems
-     * @throws InvalidVersionSpecificationException 
-     * @throws MojoFailureException 
-     * @throws ArtifactNotFoundException 
-     * @throws ArtifactResolutionException 
+     * @throws InvalidVersionSpecificationException when it happens
+     * @throws MojoFailureException when it happens
+     * @throws ArtifactNotFoundException when it happens
+     * @throws ArtifactResolutionException when it happens
      */
-    public List generateTestClasspath()
-        throws DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException,
InvalidVersionSpecificationException, ArtifactResolutionException, ArtifactNotFoundException
+    public Classpath generateTestClasspath()
+        throws DependencyResolutionRequiredException, MojoExecutionException, InvalidVersionSpecificationException,
+        MojoFailureException, ArtifactResolutionException, ArtifactNotFoundException
     {
         List classpath = new ArrayList( 2 + getProject().getArtifacts().size() );
 
@@ -774,11 +762,14 @@ public abstract class AbstractSurefireMo
             for ( Iterator iter = getAdditionalClasspathElements().iterator(); iter.hasNext();
)
             {
                 String classpathElement = (String) iter.next();
-                classpath.add( classpathElement );
+                if (classpathElement != null){
+                    classpath.add( classpathElement );
+                }
             }
         }
         
         // adding TestNG MethodSelector to the classpath
+        // Todo: move
         if ( getTestNgArtifact() != null )
         {
             Artifact testNgUtils = getTestNgUtilsArtifact();
@@ -787,7 +778,7 @@ public abstract class AbstractSurefireMo
 
         }
 
-        return classpath;
+        return new Classpath(classpath);
     }
     
     protected Artifact getTestNgUtilsArtifact()
@@ -1099,13 +1090,13 @@ public abstract class AbstractSurefireMo
             convertTestNGParameters();
         }
 
-        public void addProviderArtifactToSurefireClasspath( ClasspathConfiguration bootclasspath
)
+        public Classpath getProviderClasspath()
             throws ArtifactResolutionException, ArtifactNotFoundException
         {
             Artifact surefireArtifact =
                 (Artifact) getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter"
);
-            dependencyResolver.addProviderToClasspath( bootclasspath, "surefire-testng",
-                                                       surefireArtifact.getBaseVersion(),
testNgArtifact );
+            return dependencyResolver.getProviderClasspath( "surefire-testng", surefireArtifact.getBaseVersion(),
+                                                            testNgArtifact );
         }
     }
 
@@ -1126,13 +1117,13 @@ public abstract class AbstractSurefireMo
         {
         }
 
-        public void addProviderArtifactToSurefireClasspath( ClasspathConfiguration classpathConfiguration
)
+        public Classpath getProviderClasspath()
             throws ArtifactResolutionException, ArtifactNotFoundException
         {
             // add the JUnit provider as default - it doesn't require JUnit to be present,
             // since it supports POJO tests.
-            dependencyResolver.addProviderToClasspath( classpathConfiguration, "surefire-junit3",
-                                                       surefireArtifact.getBaseVersion(),
null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit3", surefireArtifact.getBaseVersion(),
+                                                            null );
 
         }
 
@@ -1165,11 +1156,11 @@ public abstract class AbstractSurefireMo
         {
         }
 
-        public void addProviderArtifactToSurefireClasspath( ClasspathConfiguration classpathConfiguration
)
+        public Classpath getProviderClasspath()
             throws ArtifactResolutionException, ArtifactNotFoundException
         {
-            dependencyResolver.addProviderToClasspath( classpathConfiguration, "surefire-junit4",
-                                                       surefireArtifact.getBaseVersion(),
null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit4", surefireArtifact.getBaseVersion(),
+                                                            null );
 
         }
 
@@ -1209,11 +1200,11 @@ public abstract class AbstractSurefireMo
             convertJunitCoreParameters();
         }
 
-        public void addProviderArtifactToSurefireClasspath( ClasspathConfiguration classpathConfiguration
)
+        public Classpath getProviderClasspath()
             throws ArtifactResolutionException, ArtifactNotFoundException
         {
-            dependencyResolver.addProviderToClasspath( classpathConfiguration, "surefire-junit47",
-                                                       surefireArtifact.getBaseVersion(),
null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit47", surefireArtifact.getBaseVersion(),
+                                                            null );
         }
 
     }
@@ -1250,12 +1241,13 @@ public abstract class AbstractSurefireMo
             convertTestNGParameters();
         }
 
-        public void addProviderArtifactToSurefireClasspath( ClasspathConfiguration classpathConfiguration
)
+
+        public Classpath getProviderClasspath()
             throws ArtifactResolutionException, ArtifactNotFoundException
         {
             final Map pluginArtifactMap = getPluginArtifactMap();
             Artifact plugin = (Artifact) pluginArtifactMap.get( "org.apache.maven.plugins:maven-surefire-plugin"
);
-            dependencyResolver.addProviderToClasspath( classpathConfiguration, pluginArtifactMap,
plugin );
+            return dependencyResolver.addProviderToClasspath( pluginArtifactMap, plugin );
         }
 
     }

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
Thu Mar  3 16:39:19 2011
@@ -21,7 +21,7 @@ package org.apache.maven.plugin.surefire
 
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.surefire.booter.ClasspathConfiguration;
+import org.apache.maven.surefire.booter.Classpath;
 
 /**
 * @author Kristian Rosenvold
@@ -32,7 +32,7 @@ public interface ProviderInfo
 
     boolean isApplicable();
 
-    void addProviderArtifactToSurefireClasspath( ClasspathConfiguration bootclasspath )
+    Classpath getProviderClasspath()
         throws ArtifactResolutionException, ArtifactNotFoundException;
 
     void addProviderProperties();

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
Thu Mar  3 16:39:19 2011
@@ -35,8 +35,8 @@ import org.apache.maven.artifact.version
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.surefire.booter.Classpath;
-import org.apache.maven.surefire.booter.ClasspathConfiguration;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
@@ -151,14 +151,14 @@ public class SurefireDependencyResolver
                                                      filter );
     }
 
-    public void addProviderToClasspath( ClasspathConfiguration classpathConfiguration, String
provider, String version,
-                                        Artifact filteredArtifact )
+    public Classpath getProviderClasspath( String provider, String version, Artifact filteredArtifact
)
         throws ArtifactNotFoundException, ArtifactResolutionException
     {
         Artifact providerArtifact = artifactFactory.createDependencyArtifact( "org.apache.maven.surefire",
provider,
                                                                               VersionRange.createFromVersion(
version ),
                                                                               "jar", null,
Artifact.SCOPE_TEST );
         ArtifactResolutionResult result = resolveArtifact( filteredArtifact, providerArtifact
);
+        List files = new ArrayList();
 
         for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
         {
@@ -168,30 +168,15 @@ public class SurefireDependencyResolver
                 "Adding to " + pluginName + " test classpath: " + artifact.getFile().getAbsolutePath()
+ " Scope: "
                     + artifact.getScope() );
 
-            classpathConfiguration.addSurefireClasspathUrl( artifact.getFile().getAbsolutePath()
);
+            files.add( artifact.getFile().getAbsolutePath() );
         }
+        return new Classpath( files );
     }
 
-    public void addResolvedArtifactToClasspath( Classpath bootClasspath, Artifact surefireArtifact
)
-        throws ArtifactNotFoundException, ArtifactResolutionException
-    {
-        ArtifactResolutionResult result = resolveArtifact( null, surefireArtifact );
-
-        for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
-        {
-            Artifact artifact = (Artifact) i.next();
-
-            log.debug( "Adding to " + pluginName + " booter test classpath: " + artifact.getFile().getAbsolutePath()
-                           + " Scope: " + artifact.getScope() );
-
-            bootClasspath.addClassPathElementUrl( artifact.getFile().getAbsolutePath() );
-        }
-    }
-
-    public void addProviderToClasspath( ClasspathConfiguration classpathConfiguration, Map
pluginArtifactMap,
-                                        Artifact surefireArtifact )
+    public Classpath addProviderToClasspath( Map pluginArtifactMap, Artifact surefireArtifact
)
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
+        List files = new ArrayList();
         if ( surefireArtifact != null )
         {
             final ArtifactResolutionResult artifactResolutionResult = resolveArtifact( null,
surefireArtifact );
@@ -200,7 +185,7 @@ public class SurefireDependencyResolver
                 Artifact artifact = (Artifact) iterator.next();
                 if ( !artifactResolutionResult.getArtifacts().contains( artifact ) )
                 {
-                    classpathConfiguration.addClasspathUrl( artifact.getFile().getPath()
);
+                    files.add( artifact.getFile().getAbsolutePath() );
                 }
             }
         }
@@ -210,8 +195,25 @@ public class SurefireDependencyResolver
             for ( Iterator iterator = pluginArtifactMap.values().iterator(); iterator.hasNext();
)
             {
                 Artifact artifact = (Artifact) iterator.next();
-                classpathConfiguration.addClasspathUrl( artifact.getFile().getPath() );
+                files.add( artifact.getFile().getPath() );
             }
         }
+        return new Classpath( files );
     }
+
+    public Classpath getResolvedArtifactClasspath( Artifact surefireArtifact )
+        throws ArtifactNotFoundException, ArtifactResolutionException
+    {
+        ArtifactResolutionResult result = resolveArtifact( null, surefireArtifact );
+        List classpath = new ArrayList();
+
+        for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
+        {
+            Artifact artifact = (Artifact) i.next();
+
+            classpath.add( artifact.getFile().getAbsolutePath() );
+        }
+        return new Classpath( classpath);
+    }
+
 }

Modified: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
Thu Mar  3 16:39:19 2011
@@ -19,17 +19,9 @@ package org.apache.maven.plugin.surefire
  * under the License.
  */
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
 import org.apache.maven.surefire.booter.BooterDeserializer;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
+import org.apache.maven.surefire.booter.Classpath;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
 import org.apache.maven.surefire.booter.PropertiesWrapper;
 import org.apache.maven.surefire.booter.ProviderConfiguration;
@@ -40,6 +32,15 @@ import org.apache.maven.surefire.testset
 import org.apache.maven.surefire.testset.TestArtifactInfo;
 import org.apache.maven.surefire.testset.TestRequest;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
 /**
  * Performs roundtrip testing of serialization/deserialization of The StartupConfiguration
  *
@@ -99,12 +100,9 @@ public class BooterDeserializerStartupCo
 
     private ClasspathConfiguration createClasspathConfiguration()
     {
-        ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( true,
true );
-        classpathConfiguration.addClasspathUrl( "CP1" );
-        classpathConfiguration.addClasspathUrl( "CP2" );
-        classpathConfiguration.addSurefireClasspathUrl( "SP1" );
-        classpathConfiguration.addSurefireClasspathUrl( "SP2" );
-        return classpathConfiguration;
+        Classpath testClassPath = new Classpath( Arrays.asList( new String[]{"CP1" , "CP2"
} ) );
+        Classpath providerClasspath = new Classpath( Arrays.asList( new String[]{"SP1" ,
"SP2" } ) );
+        return new ClasspathConfiguration( testClassPath, providerClasspath, true, true );
     }
 
     public static ClassLoaderConfiguration getSystemClassLoaderConfiguration()

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
Thu Mar  3 16:39:19 2011
@@ -24,11 +24,12 @@ import org.apache.maven.surefire.util.Ur
 import java.io.File;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
 /**
- * An ordered set of classpath elements
+ * An ordered list of classpath elements with set behaviour
  *
  * @author Kristian Rosenvold
  */
@@ -85,7 +86,7 @@ public class Classpath
 
     public List getClassPath()
     {
-        return new ArrayList( elements );
+        return Collections.unmodifiableList( elements );
     }
 
     public List getAsUrlList()

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
Thu Mar  3 16:39:19 2011
@@ -65,6 +65,7 @@ public class ClasspathConfiguration
         this( new Classpath(), new Classpath(), enableAssertions, childDelegation );
     }
 
+
     ClasspathConfiguration( PropertiesWrapper properties )
     {
         this( properties.getClasspath( CLASSPATH ),
@@ -72,19 +73,19 @@ public class ClasspathConfiguration
               properties.getBooleanProperty( ENABLE_ASSERTIONS ), properties.getBooleanProperty(
CHILD_DELEGATION ) );
     }
 
-    private ClasspathConfiguration( Classpath classPathUrls, Classpath surefireClassPathUrls,
boolean enableAssertions,
+    public ClasspathConfiguration( Classpath testClasspath, Classpath surefireClassPathUrls,
boolean enableAssertions,
                                     boolean childDelegation )
     {
         this.enableAssertions = enableAssertions;
         this.childDelegation = childDelegation;
-        this.classpathUrls = classPathUrls;
+        this.classpathUrls = testClasspath;
         this.surefireClasspathUrls = surefireClassPathUrls;
     }
 
     public void setForkProperties( PropertiesWrapper properties )
     {
         properties.setClasspath( CLASSPATH, classpathUrls );
-        properties.setClasspath( SUREFIRE_CLASSPATH, classpathUrls );
+        properties.setClasspath( SUREFIRE_CLASSPATH, surefireClasspathUrls );
         properties.setProperty( ENABLE_ASSERTIONS, String.valueOf( enableAssertions ) );
         properties.setProperty( CHILD_DELEGATION, String.valueOf( childDelegation ) );
     }

Modified: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java?rev=1076673&r1=1076672&r2=1076673&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
Thu Mar  3 16:39:19 2011
@@ -103,9 +103,12 @@ public class ClasspathTest
     public void testShouldNotBeAbleToRemoveElement()
         throws Exception
     {
+        try {
         Classpath classpath = createClasspathWithTwoElements();
         classpath.getClassPath().remove( 0 );
-        assertEquals(2, classpath.getClassPath().size());
+        } catch (java.lang.UnsupportedOperationException ignore){
+
+        }
     }
 
     private void assertClasspathConsistsOfElements( Classpath classpath, String[] elements
)



Mime
View raw message