maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1040704 [1/2] - in /maven/surefire/trunk: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ maven-surefire-common/src/test/java/org/apac...
Date Tue, 30 Nov 2010 19:08:42 GMT
Author: krosenvold
Date: Tue Nov 30 19:08:41 2010
New Revision: 1040704

URL: http://svn.apache.org/viewvc?rev=1040704&view=rev
Log:
o Extracted SurefireStarterConfiguration from booterConfiguration to increase separation of concerns

Added:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java   (contents, props changed)
      - copied, changed from r1040703, maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSuiteDefinition.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java   (with props)
Removed:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ApiReflector.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/ProviderConfiguration.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSuiteDefinition.java
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/booterclient/BooterSerializer.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
    maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerTest.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ProviderInvoker.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/FileScanningProvider.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/TestSuiteDefinitionAware.java
    maven/surefire/trunk/surefire-booter/pom.xml
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConfiguration.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
    maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
    maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
    maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.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=1040704&r1=1040703&r2=1040704&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 Tue Nov 30 19:08:41 2010
@@ -39,7 +39,7 @@ import org.apache.maven.shared.artifact.
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.Classpath;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
 import org.apache.maven.surefire.report.BriefConsoleReporter;
 import org.apache.maven.surefire.report.BriefFileReporter;
 import org.apache.maven.surefire.report.ConsoleReporter;
@@ -50,7 +50,7 @@ import org.apache.maven.surefire.report.
 import org.apache.maven.surefire.report.XMLReporter;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 import org.apache.maven.toolchain.Toolchain;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -272,8 +272,8 @@ public abstract class AbstractSurefireMo
         final boolean isTestNg = testNgArtifact != null;
         TestArtifactInfo testNg =
             isTestNg ? new TestArtifactInfo( testNgArtifact.getVersion(), testNgArtifact.getClassifier() ) : null;
-        TestSuiteDefinition testSuiteDefinition =
-            new TestSuiteDefinition( getSuiteXmlFiles(), getTestSourceDirectory(), getTest() );
+        TestRequest testSuiteDefinition =
+            new TestRequest( getSuiteXmlFiles(), getTestSourceDirectory(), getTest() );
         final boolean failIfNoTests;
 
         if ( isValidSuiteXmlFileConfig() && getTest() == null )
@@ -283,9 +283,6 @@ public abstract class AbstractSurefireMo
             {
                 throw new MojoExecutionException( "suiteXmlFiles is configured, but there is no TestNG dependency" );
             }
-
-            testSuiteDefinition =
-                new TestSuiteDefinition( getSuiteXmlFiles(), getTestSourceDirectory(), getTest() );
         }
         else
         {
@@ -307,18 +304,20 @@ public abstract class AbstractSurefireMo
                                                                          Boolean.valueOf( failIfNoTests ) );
         }
 
-        ProviderConfiguration providerConfiguration = new ProviderConfiguration( providerName );
         List reports = getReporters( forkConfiguration.isForking() );
         Properties providerProperties = getProperties();
         if ( providerProperties == null )
         {
             providerProperties = new Properties();
         }
+        ProviderConfiguration surefireStarterConfiguration =
+            new ProviderConfiguration( providerName, classpathConfiguration,
+                                       forkConfiguration.getClassLoaderConfiguration(), forkConfiguration.isForking(),
+                                       false, isRedirectTestOutputToFile() );
+
         BooterConfiguration booterConfiguration =
-            new BooterConfiguration( providerProperties, forkConfiguration.isForking(),
-                                     forkConfiguration.getClassLoaderConfiguration(), classpathConfiguration,
-                                     isRedirectTestOutputToFile(), reporterConfiguration, testNg, testSuiteDefinition,
-                                     directoryScannerParameters, failIfNoTests, reports, providerConfiguration );
+            new BooterConfiguration( surefireStarterConfiguration, reports, directoryScannerParameters, failIfNoTests,
+                                     reporterConfiguration, testNg, testSuiteDefinition, providerProperties, null );
 
         List classpathElements;
         try

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java (original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java Tue Nov 30 19:08:41 2010
@@ -21,11 +21,12 @@ package org.apache.maven.plugin.surefire
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.BooterConstants;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
 import org.apache.maven.surefire.booter.SystemPropertyManager;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -51,12 +52,11 @@ import java.util.Properties;
  * @author Kristian Rosenvold
  * @version $Id$
  */
-public class BooterSerializer implements BooterConstants
+public class BooterSerializer
+    implements BooterConstants
 {
     private final ForkConfiguration forkConfiguration;
 
-    public final String TESTSET = "testSet";
-
     public BooterSerializer( ForkConfiguration forkConfiguration )
     {
         this.forkConfiguration = forkConfiguration;
@@ -67,18 +67,14 @@ public class BooterSerializer implements
                            ForkConfiguration forkConfiguration, Object testSet )
         throws IOException
     {
-        setForkProperties( properties, booterConfiguration );
+        setForkProperties( properties, booterConfiguration, testSet );
 
-        if ( testSet != null && testSet instanceof String )
-        {
-            properties.setProperty( this.TESTSET, (String) testSet );
-        }
         SystemPropertyManager systemPropertyManager = new SystemPropertyManager();
         return systemPropertyManager.writePropertiesFile( properties, forkConfiguration.getTempDirectory(), "surefire",
                                                           forkConfiguration.isDebug() );
     }
 
-    public void setForkProperties( Properties properties, BooterConfiguration booterConfiguration )
+    public void setForkProperties( Properties properties, BooterConfiguration booterConfiguration, Object testSet )
     {
         if ( properties == null )
         {
@@ -89,7 +85,9 @@ public class BooterSerializer implements
         params.add( new Object[]{ DIRSCANNER_OPTIONS, booterConfiguration.getDirScannerParamsArray() } );
         addPropertiesForTypeHolder( params, properties, BooterConstants.DIRSCANNER_PROPERTY_PREFIX );
 
-        booterConfiguration.getClasspathConfiguration().setForkProperties( properties );
+        final ProviderConfiguration surefireStarterConfiguration =
+            booterConfiguration.getSurefireStarterConfiguration();
+        surefireStarterConfiguration.getClasspathConfiguration().setForkProperties( properties );
 
         ReporterConfiguration reporterConfiguration = booterConfiguration.getReporterConfiguration();
 
@@ -106,13 +104,14 @@ public class BooterSerializer implements
             }
         }
 
-        TestSuiteDefinition testSuiteDefinition = booterConfiguration.getTestSuiteDefinition();
+        if ( testSet != null )
+        {
+            properties.setProperty( BooterConstants.FORKTESTSET, getTypeEncoded( testSet ) );
+        }
+
+        TestRequest testSuiteDefinition = booterConfiguration.getTestSuiteDefinition();
         if ( testSuiteDefinition != null )
         {
-            if ( testSuiteDefinition.getTestForFork() != null )
-            {
-                properties.setProperty( BooterConstants.TESTSUITEDEFINITIONTEST, testSuiteDefinition.getTestForFork() );
-            }
             if ( testSuiteDefinition.getTestSourceDirectory() != null )
             {
                 properties.setProperty( BooterConstants.SOURCE_DIRECTORY,
@@ -120,7 +119,8 @@ public class BooterSerializer implements
             }
             if ( testSuiteDefinition.getSuiteXmlFiles() != null )
             {
-                properties.setProperty( BooterConstants.TEST_SUITE_XML_FILES, getValues( testSuiteDefinition.getSuiteXmlFiles() ) );
+                properties.setProperty( BooterConstants.TEST_SUITE_XML_FILES,
+                                        getValues( testSuiteDefinition.getSuiteXmlFiles() ) );
             }
             if ( testSuiteDefinition.getRequestedTest() != null )
             {
@@ -131,8 +131,9 @@ public class BooterSerializer implements
         DirectoryScannerParameters directoryScannerParameters = booterConfiguration.getDirScannerParams();
         if ( directoryScannerParameters != null )
         {
-            properties.setProperty(BooterConstants.FAILIFNOTESTS, String.valueOf( directoryScannerParameters.isFailIfNoTests() ) );
-            addList( directoryScannerParameters.getIncludes(), properties, BooterConstants.INCLUDES_PROPERTY_PREFIX);
+            properties.setProperty( BooterConstants.FAILIFNOTESTS,
+                                    String.valueOf( directoryScannerParameters.isFailIfNoTests() ) );
+            addList( directoryScannerParameters.getIncludes(), properties, BooterConstants.INCLUDES_PROPERTY_PREFIX );
             addList( directoryScannerParameters.getExcludes(), properties, BooterConstants.EXCLUDES_PROPERTY_PREFIX );
             properties.setProperty( BooterConstants.TEST_CLASSES_DIRECTORY,
                                     directoryScannerParameters.getTestClassesDirectory().toString() );
@@ -140,15 +141,17 @@ public class BooterSerializer implements
 
         Boolean rep = reporterConfiguration.isTrimStackTrace();
         properties.setProperty( BooterConstants.ISTRIMSTACKTRACE, rep.toString() );
-        properties.setProperty( BooterConstants.REPORTSDIRECTORY, reporterConfiguration.getReportsDirectory().toString() );
+        properties.setProperty( BooterConstants.REPORTSDIRECTORY,
+                                reporterConfiguration.getReportsDirectory().toString() );
         ClassLoaderConfiguration classLoaderConfiguration = this.forkConfiguration.getClassLoaderConfiguration();
         properties.setProperty( BooterConstants.USESYSTEMCLASSLOADER,
                                 String.valueOf( classLoaderConfiguration.isUseSystemClassLoader() ) );
         properties.setProperty( BooterConstants.USEMANIFESTONLYJAR,
                                 String.valueOf( classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable() ) );
-        properties.setProperty( BooterConstants.FAILIFNOTESTS, String.valueOf( booterConfiguration.isFailIfNoTests() ) );
+        properties.setProperty( BooterConstants.FAILIFNOTESTS,
+                                String.valueOf( booterConfiguration.isFailIfNoTests() ) );
         properties.setProperty( BooterConstants.PROVIDER_CONFIGURATION,
-                                booterConfiguration.getProviderConfiguration().getClassName() );
+                                surefireStarterConfiguration.getProviderClassName() );
     }
 
     public File writePropertiesFile( String name, Properties properties )
@@ -180,6 +183,10 @@ public class BooterSerializer implements
         }
     }
 
+    private String getTypeEncoded(Object value){
+        return value.getClass().getName() + "|" + value.toString();
+    }
+
     private void addPropertiesForTypeHolder( List typeHolderList, Properties properties, String propertyPrefix )
     {
         for ( int i = 0; i < typeHolderList.size(); i++ )

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java (original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java Tue Nov 30 19:08:41 2010
@@ -26,7 +26,7 @@ import org.apache.maven.plugin.surefire.
 import org.apache.maven.plugin.surefire.booterclient.output.SupressHeaderOutputConsumerProxy;
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.Classpath;
-import org.apache.maven.surefire.booter.ClasspathConfiguration;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
 import org.apache.maven.surefire.booter.ProviderFactory;
 import org.apache.maven.surefire.booter.SurefireBooterForkException;
 import org.apache.maven.surefire.booter.SurefireExecutionException;
@@ -117,11 +117,13 @@ public class ForkStarter
 
         ClassLoader testsClassLoader;
         ClassLoader surefireClassLoader;
+        final ProviderConfiguration starterConfiguration = booterConfiguration.getSurefireStarterConfiguration();
         try
         {
-            testsClassLoader = getClasspathConfiguration().createTestClassLoader( false );
+            testsClassLoader = starterConfiguration.getClasspathConfiguration().createTestClassLoader( false );
             // TODO: assertions = true shouldn't be required if we had proper separation (see TestNG)
-            surefireClassLoader = getClasspathConfiguration().createSurefireClassLoader( testsClassLoader );
+            surefireClassLoader =
+                starterConfiguration.getClasspathConfiguration().createSurefireClassLoader( testsClassLoader );
         }
         catch ( SurefireExecutionException e )
         {
@@ -151,11 +153,6 @@ public class ForkStarter
         return globalResult;
     }
 
-    private ClasspathConfiguration getClasspathConfiguration()
-    {
-        return booterConfiguration.getClasspathConfiguration();
-    }
-
     private int fork( Object testSet, Properties properties, boolean showHeading, boolean showFooter )
         throws SurefireBooterForkException
     {
@@ -181,9 +178,10 @@ public class ForkStarter
             throw new SurefireBooterForkException( "Error creating properties files for forking", e );
         }
 
+        final ProviderConfiguration starterConfiguration = booterConfiguration.getSurefireStarterConfiguration();
         final Classpath bootClasspathConfiguration = forkConfiguration.getBootClasspathConfiguration();
-        final Classpath additionlClassPathUrls = booterConfiguration.useSystemClassLoader()
-            ? booterConfiguration.getClasspathConfiguration().getTestClasspath()
+        final Classpath additionlClassPathUrls = starterConfiguration.useSystemClassLoader()
+            ? starterConfiguration.getClasspathConfiguration().getTestClasspath()
             : null;
 
         Classpath bootClasspath = bootClasspathConfiguration.append( additionlClassPathUrls );
@@ -198,17 +196,18 @@ public class ForkStarter
         }
 
         ForkingStreamConsumer out =
-            getForkingStreamConsumer( showHeading, showFooter, booterConfiguration.isRedirectTestOutputToFile() );
+            getForkingStreamConsumer( showHeading, showFooter, starterConfiguration.isRedirectTestOutputToFile() );
 
         StreamConsumer err;
 
-        if ( booterConfiguration.isRedirectTestOutputToFile() )
+        if ( starterConfiguration.isRedirectTestOutputToFile() )
         {
             err = out;
         }
         else
         {
-            err = getForkingStreamConsumer( showHeading, showFooter, booterConfiguration.isRedirectTestOutputToFile() );
+            err =
+                getForkingStreamConsumer( showHeading, showFooter, starterConfiguration.isRedirectTestOutputToFile() );
         }
 
         if ( forkConfiguration.isDebug() )
@@ -227,7 +226,7 @@ public class ForkStarter
             throw new SurefireBooterForkException( "Error while executing forked tests.", e );
         }
 
-        if ( booterConfiguration.isRedirectTestOutputToFile() )
+        if ( starterConfiguration.isRedirectTestOutputToFile() )
         {
             // ensure the FileOutputConsumerProxy flushes/closes the output file
             try

Modified: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerTest.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerTest.java (original)
+++ maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerTest.java Tue Nov 30 19:08:41 2010
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.surefire.booterclient;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -24,11 +25,11 @@ import org.apache.maven.surefire.booter.
 import org.apache.maven.surefire.booter.BooterDeserializer;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -47,6 +48,7 @@ public class BooterDeserializerTest
 {
 
     private final String aTest = "aTest";
+
     private final String aUserRequestedTest = "aUserRequestedTest";
 
     public static ClassLoaderConfiguration getForkConfiguration()
@@ -67,13 +69,13 @@ public class BooterDeserializerTest
         excludes.add( "xx1" );
         excludes.add( "xx2" );
 
-        DirectoryScannerParameters directoryScannerParameters = new DirectoryScannerParameters( aDir, includes, excludes, Boolean.TRUE );
+        DirectoryScannerParameters directoryScannerParameters =
+            new DirectoryScannerParameters( aDir, includes, excludes, Boolean.TRUE );
         ClassLoaderConfiguration forkConfiguration = getForkConfiguration();
-        BooterConfiguration booterConfiguration = getTestBooterConfiguration( forkConfiguration, directoryScannerParameters,
-                                                                              new ArrayList(  ));
+        BooterConfiguration booterConfiguration =
+            getTestBooterConfiguration( forkConfiguration, directoryScannerParameters, new ArrayList() );
         BooterConfiguration read = saveAndReload( forkConfiguration, booterConfiguration );
 
-
         Assert.assertEquals( aDir, read.getBaseDir() );
         Assert.assertEquals( includes.get( 0 ), read.getIncludes().get( 0 ) );
         Assert.assertEquals( includes.get( 1 ), read.getIncludes().get( 1 ) );
@@ -87,12 +89,13 @@ public class BooterDeserializerTest
     {
         DirectoryScannerParameters directoryScannerParameters = getDirectoryScannerParameters();
         ClassLoaderConfiguration forkConfiguration = getForkConfiguration();
-        List reports = new ArrayList(  );
+        List reports = new ArrayList();
         reports.add( "abc" );
         reports.add( "cde" );
         reports.add( "efg" );
 
-        BooterConfiguration booterConfiguration = getTestBooterConfiguration( forkConfiguration, directoryScannerParameters, reports );
+        BooterConfiguration booterConfiguration =
+            getTestBooterConfiguration( forkConfiguration, directoryScannerParameters, reports );
 
         booterConfiguration.getReports().add( "abc" );
         booterConfiguration.getReports().add( "cde" );
@@ -110,8 +113,8 @@ public class BooterDeserializerTest
     {
         BooterConfiguration reloaded = getReloladedConfig();
 
-        Assert.assertEquals( "5.0", reloaded.getTestNg().getVersion());
-        Assert.assertEquals( "ABC", reloaded.getTestNg().getClassifier());
+        Assert.assertEquals( "5.0", reloaded.getTestNg().getVersion() );
+        Assert.assertEquals( "ABC", reloaded.getTestNg().getClassifier() );
     }
 
     public void testTestSuiteDefinition()
@@ -119,23 +122,24 @@ public class BooterDeserializerTest
     {
         BooterConfiguration reloaded = getReloladedConfig();
 
-        TestSuiteDefinition testSuiteDefinition = reloaded.getTestSuiteDefinition();
+        TestRequest testSuiteDefinition = reloaded.getTestSuiteDefinition();
         File[] suiteXmlFiles = testSuiteDefinition.getSuiteXmlFiles();
         File[] expected = getSuiteXmlFiles();
         Assert.assertEquals( expected[0], suiteXmlFiles[0] );
         Assert.assertEquals( expected[1], suiteXmlFiles[1] );
-        Assert.assertEquals( aTest, testSuiteDefinition.getTestForFork() );
+        Assert.assertEquals( aTest, reloaded.getTestForForkString() );
         Assert.assertEquals( getTEstSourceDirectory(), testSuiteDefinition.getTestSourceDirectory() );
         Assert.assertEquals( aUserRequestedTest, testSuiteDefinition.getRequestedTest() );
 
 
     }
+
     public void testProvider()
         throws IOException
     {
         BooterConfiguration reloaded = getReloladedConfig();
 
-        assertEquals("com.provider", reloaded.getProviderConfiguration().getClassName());
+        assertEquals( "com.provider", reloaded.getSurefireStarterConfiguration().getProviderClassName() );
 
     }
 
@@ -143,7 +147,7 @@ public class BooterDeserializerTest
         throws IOException
     {
         BooterConfiguration reloaded = getReloladedConfig();
-        assertTrue(reloaded.isFailIfNoTests().booleanValue());
+        assertTrue( reloaded.isFailIfNoTests().booleanValue() );
 
     }
 
@@ -152,8 +156,8 @@ public class BooterDeserializerTest
     {
         DirectoryScannerParameters directoryScannerParameters = getDirectoryScannerParameters();
         ClassLoaderConfiguration forkConfiguration = getForkConfiguration();
-        BooterConfiguration booterConfiguration = getTestBooterConfiguration( forkConfiguration, directoryScannerParameters,
-                                                                              new ArrayList(  ) );
+        BooterConfiguration booterConfiguration =
+            getTestBooterConfiguration( forkConfiguration, directoryScannerParameters, new ArrayList() );
         return saveAndReload( forkConfiguration, booterConfiguration );
     }
 
@@ -174,15 +178,15 @@ public class BooterDeserializerTest
                                                BooterConfiguration booterConfiguration )
         throws IOException
     {
-        BooterSerializer booterSerializer = new BooterSerializer(ForkConfigurationTest.getForkConfiguration());
+        BooterSerializer booterSerializer = new BooterSerializer( ForkConfigurationTest.getForkConfiguration() );
         Properties props = new Properties();
-        booterSerializer.setForkProperties( props, booterConfiguration );
+        booterSerializer.setForkProperties( props, booterConfiguration, aTest );
         final File propsTest = booterSerializer.writePropertiesFile( "propsTest", props );
         BooterDeserializer booterDeserializer = new BooterDeserializer();
         return booterDeserializer.deserialize( new FileInputStream( propsTest ) );
     }
 
-    private BooterConfiguration getTestBooterConfiguration( ClassLoaderConfiguration forkConfiguration,
+    private BooterConfiguration getTestBooterConfiguration( ClassLoaderConfiguration classLoaderConfiguration,
                                                             DirectoryScannerParameters directoryScannerParameters,
                                                             List reports )
         throws IOException
@@ -190,12 +194,15 @@ public class BooterDeserializerTest
         ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( true, true );
 
         ReporterConfiguration reporterConfiguration = new ReporterConfiguration( new File( "." ), Boolean.TRUE );
-        TestSuiteDefinition testSuiteDefinition = new TestSuiteDefinition( getSuiteXmlFiles(), aTest,
-                                                                           getTEstSourceDirectory(), aUserRequestedTest );
-        ProviderConfiguration providerConfiguration = new ProviderConfiguration( "com.provider" );
-        return new BooterConfiguration( new Properties(), false, forkConfiguration, classpathConfiguration, false,
+        TestRequest testSuiteDefinition =
+            new TestRequest( getSuiteXmlFileStrings(), getTEstSourceDirectory(), aUserRequestedTest );
+        ProviderConfiguration surefireStarterConfiguration =
+            new ProviderConfiguration( "com.provider", classpathConfiguration, classLoaderConfiguration, false, false,
+                                       false );
+
+        return new BooterConfiguration( surefireStarterConfiguration, reports, directoryScannerParameters, true,
                                         reporterConfiguration, new TestArtifactInfo( "5.0", "ABC" ),
-                                 testSuiteDefinition, directoryScannerParameters, true, reports, providerConfiguration );
+                                        testSuiteDefinition, new Properties(), aTest );
     }
 
     private File getTEstSourceDirectory()
@@ -205,6 +212,10 @@ public class BooterDeserializerTest
 
     private File[] getSuiteXmlFiles()
     {
-        return new File[]{new File("A1"), new File("A2")};
+        return new File[]{ new File( "A1" ), new File( "A2" ) };
+    }
+    private Object[] getSuiteXmlFileStrings()
+    {
+        return new Object[]{  "A1" , "A2" };
     }
 }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ProviderInvoker.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ProviderInvoker.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ProviderInvoker.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/ProviderInvoker.java Tue Nov 30 19:08:41 2010
@@ -20,7 +20,6 @@ package org.apache.maven.surefire;
  */
 
 import org.apache.maven.surefire.booter.SurefireReflector;
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
 import org.apache.maven.surefire.providerapi.ReporterManagerFactoryAware;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReporterConfiguration;
@@ -31,8 +30,8 @@ import org.apache.maven.surefire.report.
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
+import org.apache.maven.surefire.testset.TestRequest;
 import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
 
 import java.util.List;
 import java.util.Properties;
@@ -51,8 +50,9 @@ public class ProviderInvoker
 
     public int run( ReporterConfiguration reporterConfiguration, List reportDefinitions,
                     ClassLoader surefireClassLoader, ClassLoader testsClassLoader, Properties results,
-                    Boolean failIfNoTests, TestSuiteDefinition testSuiteDefinition, TestArtifactInfo testArtifactInfo,
-                    ProviderConfiguration providerConfiguration, DirectoryScannerParameters directoryScannerParameters )
+                    Boolean failIfNoTests, TestRequest testSuiteDefinition, TestArtifactInfo testArtifactInfo,
+                    String providerClassName, DirectoryScannerParameters directoryScannerParameters,
+                    Object forkTestSet)
         throws ReporterException, TestSetFailedException
     {
         ReporterManagerFactory reporterManagerFactory =
@@ -67,7 +67,7 @@ public class ProviderInvoker
         int totalTests = 0;
 
         SurefireReflector surefireReflector = new SurefireReflector( surefireClassLoader );
-        Object o = surefireReflector.newInstance( providerConfiguration );
+        Object o = surefireReflector.newInstance( providerClassName );
         SurefireProvider provider = (SurefireProvider) o;
         surefireReflector.setIfDirScannerAware( o, directoryScannerParameters );
         surefireReflector.setTestSuiteDefinitionAware( o, testSuiteDefinition );
@@ -80,7 +80,7 @@ public class ProviderInvoker
         surefireReflector.setTestClassLoaderAware( o, testsClassLoader );
         surefireReflector.setTestArtifactInfoAware( o, testArtifactInfo );
 
-        RunResult invoke = provider.invoke();
+        RunResult invoke = provider.invoke(forkTestSet);
         int testCount = invoke.getCompletedCount(); // TODO: Verify that this is correct digit
         if ( testCount > 0 )
         {

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java Tue Nov 30 19:08:41 2010
@@ -21,7 +21,6 @@ package org.apache.maven.surefire.booter
 
 import org.apache.maven.surefire.ProviderInvoker;
 import org.apache.maven.surefire.providerapi.DirectoryScannerParametersAware;
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
 import org.apache.maven.surefire.providerapi.ProviderPropertiesAware;
 import org.apache.maven.surefire.providerapi.ReporterConfigurationAware;
 import org.apache.maven.surefire.providerapi.TestArtifactInfoAware;
@@ -30,7 +29,7 @@ import org.apache.maven.surefire.provide
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 import java.io.File;
 import java.lang.reflect.Constructor;
@@ -59,8 +58,6 @@ public class SurefireReflector
 
     private final Class testArtifactInfo;
 
-    private final Class providerConfiguration;
-
     private final Class testArtifactInfoAware;
 
     private final Class directoryScannerParameters;
@@ -83,7 +80,7 @@ public class SurefireReflector
         {
             providerInvoker = surefireClassLoader.loadClass( ProviderInvoker.class.getName() );
             reporterConfiguration = surefireClassLoader.loadClass( ReporterConfiguration.class.getName() );
-            testSuiteDefinition = surefireClassLoader.loadClass( TestSuiteDefinition.class.getName() );
+            testSuiteDefinition = surefireClassLoader.loadClass( TestRequest.class.getName() );
             testArtifactInfo = surefireClassLoader.loadClass( TestArtifactInfo.class.getName() );
             testArtifactInfoAware = surefireClassLoader.loadClass( TestArtifactInfoAware.class.getName() );
             directoryScannerParameters = surefireClassLoader.loadClass( DirectoryScannerParameters.class.getName() );
@@ -93,7 +90,6 @@ public class SurefireReflector
             testClassLoaderAware = surefireClassLoader.loadClass( TestClassLoaderAware.class.getName() );
             reporterConfigurationAware = surefireClassLoader.loadClass( ReporterConfigurationAware.class.getName() );
             providerPropertiesAware = surefireClassLoader.loadClass( ProviderPropertiesAware.class.getName() );
-            providerConfiguration = surefireClassLoader.loadClass( ProviderConfiguration.class.getName() );
         }
         catch ( ClassNotFoundException e )
         {
@@ -130,45 +126,33 @@ public class SurefireReflector
 
     public int runProvider( ReporterConfiguration reporterConfiguration, List reportDefinitions,
                             ClassLoader surefireClassLoader, ClassLoader testsClassLoader, Properties results,
-                            Boolean failIfNoTests, TestSuiteDefinition testSuiteDefinition,
-                            TestArtifactInfo testArtifactInfo, ProviderConfiguration providerConfiguration,
-                            DirectoryScannerParameters dirScannerParams )
+                            Boolean failIfNoTests, TestRequest testSuiteDefinition, TestArtifactInfo testArtifactInfo,
+                            String providerClassName, DirectoryScannerParameters dirScannerParams, Object forkTestSet )
     {
         Object surefire = instantiateProviderInvoker();
         Method run = getRunMethod(
             new Class[]{ this.reporterConfiguration, List.class, ClassLoader.class, ClassLoader.class, Properties.class,
-                Boolean.class, this.testSuiteDefinition, this.testArtifactInfo, this.providerConfiguration,
-                this.directoryScannerParameters } );
+                Boolean.class, this.testSuiteDefinition, this.testArtifactInfo, String.class,
+                this.directoryScannerParameters, Object.class } );
 
         Object[] args = { createReporterConfiguration( reporterConfiguration ), reportDefinitions, surefireClassLoader,
             testsClassLoader, results, failIfNoTests, createTestSuiteDefinition( testSuiteDefinition ),
-            createTestArtifactInfo( testArtifactInfo ), createProviderConfiguration( providerConfiguration ),
-            createDirectoryScannerParameters( dirScannerParams ) };
+            createTestArtifactInfo( testArtifactInfo ), providerClassName,
+            createDirectoryScannerParameters( dirScannerParams ), forkTestSet };
         return invokeRunMethod( surefire, run, args );
     }
 
-    private Object createProviderConfiguration( ProviderConfiguration providerConfiguration )
-    {
-        if ( providerConfiguration == null )
-        {
-            return null;
-        }
-        Class[] arguments = { String.class };
-        Constructor constructor = getConstructor( this.providerConfiguration, arguments );
-        return newInstance( constructor, new Object[]{ providerConfiguration.getClassName() } );
-    }
-
-    Object createTestSuiteDefinition( TestSuiteDefinition suiteDefinition )
+    Object createTestSuiteDefinition( TestRequest suiteDefinition )
     {
         if ( suiteDefinition == null )
         {
             return null;
         }
-        Class[] arguments = { File[].class, String.class, File.class, String.class };
+        Class[] arguments = { Object[].class, File.class, String.class };
         Constructor constructor = getConstructor( this.testSuiteDefinition, arguments );
         return newInstance( constructor,
-                            new Object[]{ suiteDefinition.getSuiteXmlFiles(), suiteDefinition.getTestForFork(),
-                                suiteDefinition.getTestSourceDirectory(), suiteDefinition.getRequestedTest() } );
+                            new Object[]{ suiteDefinition.getSuiteXmlFiles(), suiteDefinition.getTestSourceDirectory(),
+                                suiteDefinition.getRequestedTest() } );
     }
 
 
@@ -237,12 +221,12 @@ public class SurefireReflector
         }
     }
 
-    public Object newInstance( ProviderConfiguration providerConfiguration )
+    public Object newInstance( String providerClassName )
     {
         try
         {
 
-            Class clazz = classLoader.loadClass( providerConfiguration.getClassName() );
+            Class clazz = classLoader.loadClass( providerClassName );
             return clazz.newInstance();
         }
         catch ( InstantiationException e )
@@ -384,7 +368,7 @@ public class SurefireReflector
         invokeSetter( o, setter, param );
     }
 
-    public void setTestSuiteDefinitionAware( Object o, TestSuiteDefinition testSuiteDefinition2 )
+    public void setTestSuiteDefinitionAware( Object o, TestRequest testSuiteDefinition2 )
     {
         if ( isTestSuiteDefinitionAware( o ) )
         {
@@ -398,7 +382,7 @@ public class SurefireReflector
         return testSuiteDefinitionAware.isAssignableFrom( o.getClass() );
     }
 
-    void setTestSuiteDefinition( Object o, TestSuiteDefinition testSuiteDefinition1 )
+    void setTestSuiteDefinition( Object o, TestRequest testSuiteDefinition1 )
     {
         final Object param = createTestSuiteDefinition( testSuiteDefinition1 );
         final Method setter = getMethod( o, "setTestSuiteDefinition", new Class[]{ testSuiteDefinition } );

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/FileScanningProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/FileScanningProvider.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/FileScanningProvider.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/FileScanningProvider.java Tue Nov 30 19:08:41 2010
@@ -23,8 +23,8 @@ import org.apache.maven.surefire.report.
 import org.apache.maven.surefire.report.ReporterManagerFactory;
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
+import org.apache.maven.surefire.testset.TestRequest;
 import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
 import org.apache.maven.surefire.util.DefaultDirectoryScanner;
 import org.apache.maven.surefire.util.DirectoryScanner;
 
@@ -41,7 +41,7 @@ public class FileScanningProvider
 
     private ClassLoader testsClassLoader;
 
-    private TestSuiteDefinition testSuiteDefinition;
+    private TestRequest testSuiteDefinition;
 
 
 
@@ -89,12 +89,12 @@ public class FileScanningProvider
         return directoryScannerParameters.isFailIfNoTests();
     }
 
-    protected TestSuiteDefinition getTestSuiteDefinition()
+    protected TestRequest getTestSuiteDefinition()
     {
         return testSuiteDefinition;
     }
 
-    public void setTestSuiteDefinition( TestSuiteDefinition testSuiteDefinition )
+    public void setTestSuiteDefinition( TestRequest testSuiteDefinition )
     {
         this.testSuiteDefinition = testSuiteDefinition;
     }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java Tue Nov 30 19:08:41 2010
@@ -39,6 +39,12 @@ public interface SurefireProvider
      */
     public Iterator getSuites();
 
-    public RunResult invoke()
+    /**
+     * The test that will be invoked through a fork; used only for forkmode=pertest, when the classpath
+     * scanning happens on the plugin-side. When this is set, the forked process will run only that test
+     * and not scan the classpath
+     */
+
+    public RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException;
 }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/TestSuiteDefinitionAware.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/TestSuiteDefinitionAware.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/TestSuiteDefinitionAware.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/TestSuiteDefinitionAware.java Tue Nov 30 19:08:41 2010
@@ -19,12 +19,12 @@ package org.apache.maven.surefire.provid
  * under the License.
  */
 
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 /**
  * @author Kristian Rosenvold
  */
 public interface TestSuiteDefinitionAware
 {
-    void setTestSuiteDefinition( TestSuiteDefinition testSuiteDefinition );
+    void setTestSuiteDefinition( TestRequest testSuiteDefinition );
 }

Copied: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java (from r1040703, maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSuiteDefinition.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java?p2=maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java&p1=maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSuiteDefinition.java&r1=1040703&r2=1040704&rev=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestSuiteDefinition.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java Tue Nov 30 19:08:41 2010
@@ -22,41 +22,21 @@ package org.apache.maven.surefire.testse
 import java.io.File;
 
 /**
+ * Information about the requested test.
+ *
  * @author Kristian Rosenvold
  */
-public class TestSuiteDefinition
+public class TestRequest
 {
     private final File[] suiteXmlFiles;
 
-    /**
-     * The test that will be invoked through a fork; used only for forkmode=pertest, when the classpath
-     * scanning happens on the plugin-side. When this is set, the forked process will run only that test
-     * and not scan the classpath
-     */
-    private final String testForFork;
-
     private final File testSourceDirectory;
 
     private final String requestedTest;
 
-    public TestSuiteDefinition( Object[] suiteXmlFiles, String testForFork, File testSourceDirectory,
-                                String requestedTest )
-    {
-        this( createFiles( suiteXmlFiles ), testForFork, testSourceDirectory, requestedTest );
-    }
-
-
-    public TestSuiteDefinition( File[] suiteXmlFiles, File testSourceDirectory, String requestedTest )
-    {
-        this( suiteXmlFiles, null, testSourceDirectory, requestedTest );
-    }
-
-
-    public TestSuiteDefinition( File[] suiteXmlFiles, String testForFork, File testSourceDirectory,
-                                String requestedTest )
+    public TestRequest( Object[] suiteXmlFiles, File testSourceDirectory, String requestedTest )
     {
-        this.suiteXmlFiles = suiteXmlFiles;
-        this.testForFork = testForFork;
+        this.suiteXmlFiles = createFiles( suiteXmlFiles );
         this.testSourceDirectory = testSourceDirectory;
         this.requestedTest = requestedTest;
     }
@@ -71,11 +51,6 @@ public class TestSuiteDefinition
         return testSourceDirectory;
     }
 
-    public String getTestForFork()
-    {
-        return testForFork;
-    }
-
     public String getRequestedTest()
     {
         return requestedTest;
@@ -86,9 +61,11 @@ public class TestSuiteDefinition
         if ( suiteXmlFiles != null )
         {
             File[] files = new File[suiteXmlFiles.length];
+            Object element;
             for ( int i = 0; i < suiteXmlFiles.length; i++ )
             {
-                files[i] = (File) suiteXmlFiles[i];
+                element = suiteXmlFiles[i];
+                files[i] = element instanceof String ? new File( (String) element ) : (File) element;
             }
             return files;
         }

Propchange: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/surefire-booter/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/pom.xml?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/pom.xml (original)
+++ maven/surefire/trunk/surefire-booter/pom.xml Tue Nov 30 19:08:41 2010
@@ -19,22 +19,34 @@
   -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+  <modelVersion>4.0.0</modelVersion>
 
-    <parent>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>surefire</artifactId>
-        <version>2.7-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>surefire</artifactId>
+    <version>2.7-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
 
-    <artifactId>surefire-booter</artifactId>
-    <name>SureFire Booter</name>
+  <artifactId>surefire-booter</artifactId>
+  <name>SureFire Booter</name>
 
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.maven.surefire</groupId>
-            <artifactId>surefire-api</artifactId>
-        </dependency>
-    </dependencies>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-api</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.3</source>
+          <target>1.3</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConfiguration.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConfiguration.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConfiguration.java Tue Nov 30 19:08:41 2010
@@ -19,11 +19,10 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 import java.io.File;
 import java.util.List;
@@ -49,11 +48,7 @@ public class BooterConfiguration
 
     public static final int NO_TESTS_EXIT_CODE = 254;
 
-    private final ClassLoaderConfiguration classLoaderConfiguration;
-
-    private final ClasspathConfiguration classpathConfiguration;
-
-    private final ProviderConfiguration providerConfiguration;
+    private final ProviderConfiguration surefireStarterConfiguration;
 
     private final DirectoryScannerParameters dirScannerParams;
 
@@ -63,63 +58,29 @@ public class BooterConfiguration
 
     private final TestArtifactInfo testNg;
 
-    private final TestSuiteDefinition testSuiteDefinition;
+    private final TestRequest testSuiteDefinition;
 
     private Properties providerProperties;
 
-    private Properties properties; // todo: Zap out of here !
-
     private final boolean failIfNoTests;
 
-    private final boolean redirectTestOutputToFile;
-
-    private final boolean isForkRequested;
-
-    private final boolean isInForkedVm;
+    private final Object forkTestSet;
 
-    public BooterConfiguration( ClassLoaderConfiguration classLoaderConfiguration,
-                                ClasspathConfiguration classpathConfiguration, List reports,
-                                DirectoryScannerParameters directoryScannerParameterses, boolean failIfNoTests,
-                                Properties properties, ReporterConfiguration reporterConfiguration,
-                                TestArtifactInfo testArtifactInfo, TestSuiteDefinition testSuiteDefinition,
-                                ProviderConfiguration providerConfiguration )
-    {
-        this.classLoaderConfiguration = classLoaderConfiguration;
-        this.classpathConfiguration = classpathConfiguration;
-        this.reports = reports;
-        this.dirScannerParams = directoryScannerParameterses;
-        this.failIfNoTests = failIfNoTests;
-        this.redirectTestOutputToFile = false;
-        this.reporterConfiguration = reporterConfiguration;
-        this.properties = properties; // Todo: Hack hack. This must go
-        this.isForkRequested = false;
-        this.isInForkedVm = true;
-        this.testNg = testArtifactInfo;
-        this.testSuiteDefinition = testSuiteDefinition;
-        this.providerConfiguration = providerConfiguration;
-    }
-
-    public BooterConfiguration( Properties providerProperties, boolean isForkRequested,
-                                ClassLoaderConfiguration classLoaderConfiguration,
-                                ClasspathConfiguration classpathConfiguration, boolean redirectTestOutputToFile,
-                                ReporterConfiguration reporterConfiguration, TestArtifactInfo testNg,
-                                TestSuiteDefinition testSuiteDefinition,
+    public BooterConfiguration( ProviderConfiguration surefireStarterConfiguration, List reports,
                                 DirectoryScannerParameters directoryScannerParameters, boolean failIfNoTests,
-                                List reports, ProviderConfiguration providerConfiguration )
+                                ReporterConfiguration reporterConfiguration, TestArtifactInfo testNg,
+                                TestRequest testSuiteDefinition, Properties providerProperties,
+                                Object forkTestSet)
     {
+        this.surefireStarterConfiguration = surefireStarterConfiguration;
         this.providerProperties = providerProperties;
-        this.classLoaderConfiguration = classLoaderConfiguration;
-        this.classpathConfiguration = classpathConfiguration;
         this.reporterConfiguration = reporterConfiguration;
-        this.isInForkedVm = false;
-        this.isForkRequested = isForkRequested;
-        this.redirectTestOutputToFile = redirectTestOutputToFile;
         this.testNg = testNg;
         this.testSuiteDefinition = testSuiteDefinition;
         this.dirScannerParams = directoryScannerParameters;
         this.failIfNoTests = failIfNoTests;
         this.reports = reports;
-        this.providerConfiguration = providerConfiguration;
+        this.forkTestSet = forkTestSet;
     }
 
 
@@ -128,15 +89,9 @@ public class BooterConfiguration
         return reporterConfiguration;
     }
 
-    public ClasspathConfiguration getClasspathConfiguration()
-    {
-        return classpathConfiguration;
-    }
-
-    public boolean useSystemClassLoader()
+    public ProviderConfiguration getSurefireStarterConfiguration()
     {
-        // todo; I am not totally convinced this logic is as simple as it could be
-        return classLoaderConfiguration.isUseSystemClassLoader() && ( isInForkedVm || isForkRequested );
+        return surefireStarterConfiguration;
     }
 
 
@@ -145,16 +100,6 @@ public class BooterConfiguration
         return reports;
     }
 
-    public Properties getProperties()
-    {
-        return properties;
-    }
-
-    public boolean isRedirectTestOutputToFile()
-    {
-        return redirectTestOutputToFile;
-    }
-
     public Boolean isFailIfNoTests()
     {
         return ( failIfNoTests ) ? Boolean.TRUE : Boolean.FALSE;
@@ -191,35 +136,34 @@ public class BooterConfiguration
         return dirScannerParams.getExcludes();
     }
 
-    public boolean isManifestOnlyJarRequestedAndUsable()
-    {
-        return classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable();
-    }
-
     public TestArtifactInfo getTestNg()
     {
         return testNg;
     }
 
-    public TestSuiteDefinition getTestSuiteDefinition()
+    public TestRequest getTestSuiteDefinition()
     {
         return testSuiteDefinition;
     }
 
-    public TestSuiteDefinition getTestSuiteDefinition( String testName )
+    public Properties getProviderProperties()
     {
-        return new TestSuiteDefinition( testSuiteDefinition.getSuiteXmlFiles(), testName,
-                                        testSuiteDefinition.getTestSourceDirectory(),
-                                        testSuiteDefinition.getRequestedTest() );
+        return providerProperties;
     }
 
-    public ProviderConfiguration getProviderConfiguration()
+    public Object getTestForFork()
     {
-        return providerConfiguration;
+        return forkTestSet;
     }
 
-    public Properties getProviderProperties()
+    public String getTestForForkString()
     {
-        return providerProperties;
+        if ( forkTestSet instanceof File )
+        {
+            return forkTestSet.toString();
+        }
+        return (String) forkTestSet;
     }
+
+
 }

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterConstants.java Tue Nov 30 19:08:41 2010
@@ -24,10 +24,10 @@ public interface BooterConstants
     String REPORTSDIRECTORY = "reportsDirectory";
     String TESTNGVERSION = "testNgVersion";
     String TESTNG_CLASSIFIER = "testNgClassifier";
-    String TESTSUITEDEFINITIONTEST = "testSuiteDefinitionTest";
     String REQUESTEDTEST = "requestedTest";
     String SOURCE_DIRECTORY = "testSuiteDefinitionTestSourceDirectory";
     String TEST_CLASSES_DIRECTORY = "testClassesDirectory";
     String TEST_SUITE_XML_FILES = "testSuiteXmlFiles";
     String PROVIDER_CONFIGURATION = "providerConfiguration";
+    String FORKTESTSET = "forkTestSet";
 }

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/BooterDeserializer.java Tue Nov 30 19:08:41 2010
@@ -18,18 +18,16 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
@@ -77,7 +75,7 @@ public class BooterDeserializer
 
         String testNgVersion = null;
         String testNgClassifier = null;
-        String testForFork = null;
+        Object testForFork = null;
         String requestedTest = null;
         File sourceDirectory = null;
         Object[] testSuiteXmlFiles = null;
@@ -151,9 +149,9 @@ public class BooterDeserializer
             {
                 testNgClassifier = properties.getProperty( TESTNG_CLASSIFIER );
             }
-            else if ( TESTSUITEDEFINITIONTEST.equals( name ) )
+            else if ( FORKTESTSET.equals( name ) )
             {
-                testForFork = properties.getProperty( TESTSUITEDEFINITIONTEST );
+                testForFork = getTypeDecoded( properties.getProperty( FORKTESTSET ));
             }
             else if ( REQUESTEDTEST.equals( name ) )
             {
@@ -181,11 +179,11 @@ public class BooterDeserializer
 
         dirScannerParams = new DirectoryScannerParameters( testClassesDirectory, new ArrayList( includes.values() ),
                                                            new ArrayList( excludes.values() ),
-                                                           Boolean.valueOf( failIfNotests ) );
+                                                           valueOf( failIfNotests ) );
 
         TestArtifactInfo testNg = new TestArtifactInfo( testNgVersion, testNgClassifier );
-        TestSuiteDefinition testSuiteDefinition =
-            new TestSuiteDefinition( testSuiteXmlFiles, testForFork, sourceDirectory, requestedTest );
+        TestRequest testSuiteDefinition =
+            new TestRequest( testSuiteXmlFiles, sourceDirectory, requestedTest );
 
         ClassLoaderConfiguration classLoaderConfiguration =
             new ClassLoaderConfiguration( useSystemClassLoader, useManifestOnlyJar );
@@ -194,13 +192,18 @@ public class BooterDeserializer
             new ClasspathConfiguration( classPathUrls, surefireClassPathUrls, enableAssertions, childDelegation );
 
         ReporterConfiguration reporterConfiguration =
-            new ReporterConfiguration( reportsDirectory, Boolean.valueOf( isTrimStackTrace ) );
+            new ReporterConfiguration( reportsDirectory, valueOf( isTrimStackTrace ) );
 
-        ProviderConfiguration providerConfigurationObj = new ProviderConfiguration( providerConfiguration );
         List reports = new ArrayList( reportsMap.values() );
-        return new BooterConfiguration( classLoaderConfiguration, classpathConfiguration, reports, dirScannerParams,
-                                        failIfNotests, properties.getProperties(), reporterConfiguration, testNg,
-                                        testSuiteDefinition, providerConfigurationObj );
+        ProviderConfiguration surefireStarterConfiguration =
+            ProviderConfiguration.inForkedVm( providerConfiguration, classpathConfiguration, classLoaderConfiguration);
+        return new BooterConfiguration( surefireStarterConfiguration, reports, dirScannerParams, failIfNotests,
+                                        reporterConfiguration, testNg, testSuiteDefinition,
+                                        properties.getProperties(), testForFork );
+    }
+
+    private Boolean valueOf(boolean aBoolean){  // jdk1.3 compat
+        return aBoolean ? Boolean.TRUE : Boolean.FALSE;
     }
 
     private boolean isTypeHolderProperty( String name )
@@ -219,7 +222,7 @@ public class BooterDeserializer
         }
         finally
         {
-            close( out );
+            out.close();
         }
     }
 
@@ -263,27 +266,11 @@ public class BooterDeserializer
         return paramObjects;
     }
 
-    /**
-     * From IOUtils
-     * Closes the output stream. The output stream can be null and any IOException's will be swallowed.
-     *
-     * @param outputStream The stream to close.
-     */
-    public static void close( OutputStream outputStream )
-    {
-        if ( outputStream == null )
-        {
-            return;
-        }
-
-        try
-        {
-            outputStream.close();
-        }
-        catch ( IOException ex )
-        {
-            // ignore
-        }
+    private static Object getTypeDecoded(String typeEncoded){
+        int typeSep = typeEncoded.indexOf( "|" );
+        String type = typeEncoded.substring( 0, typeSep );
+        String value = typeEncoded.substring(  typeSep + 1);
+        return getParamValue(  value, type );
     }
 
     private static Object getParamValue( String param, String typeName )

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java Tue Nov 30 19:08:41 2010
@@ -60,15 +60,15 @@ public class ForkedBooter
             InputStream stream = surefirePropertiesFile.exists() ? new FileInputStream( surefirePropertiesFile ) : null;
             BooterDeserializer booterDeserializer = new BooterDeserializer();
             BooterConfiguration booterConfiguration = booterDeserializer.deserialize( stream );
-            Properties p = booterConfiguration.getProperties();
 
             SurefireStarter booter = new SurefireStarter( booterConfiguration );
 
-            String testSet = p.getProperty( "testSet" );
-            int result;
-            if ( testSet != null )
+            Object forkedTestSet = booterConfiguration.getTestForFork();
+            Properties p = booterConfiguration.getProviderProperties();
+            final int result;
+            if ( forkedTestSet != null )
             {
-                result = booter.runSuitesInProcess( testSet, p );
+                result = booter.runSuitesInProcess( forkedTestSet, p );
             }
             else
             {

Added: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java?rev=1040704&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java (added)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java Tue Nov 30 19:08:41 2010
@@ -0,0 +1,85 @@
+package org.apache.maven.surefire.booter;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Configuration that is used by the surefirestarter but does not make it into the provider itself.
+ *
+ * @author Kristian Rosenvold
+ */
+public class ProviderConfiguration
+{
+    private final String providerClassName;
+
+    private final ClasspathConfiguration classpathConfiguration;
+
+    private final ClassLoaderConfiguration classLoaderConfiguration;
+
+    private final boolean isForkRequested;
+
+    private final boolean isInForkedVm;
+
+    private final boolean redirectTestOutputToFile;
+
+
+    public ProviderConfiguration( String providerClassName, ClasspathConfiguration classpathConfiguration,
+                                  ClassLoaderConfiguration classLoaderConfiguration, boolean forkRequested,
+                                  boolean inForkedVm, boolean redirectTestOutputToFile )
+    {
+        this.providerClassName = providerClassName;
+        this.classpathConfiguration = classpathConfiguration;
+        this.classLoaderConfiguration = classLoaderConfiguration;
+        isForkRequested = forkRequested;
+        isInForkedVm = inForkedVm;
+        this.redirectTestOutputToFile = redirectTestOutputToFile;
+    }
+
+    public static ProviderConfiguration inForkedVm(String providerClassName, ClasspathConfiguration classpathConfiguration,
+                                  ClassLoaderConfiguration classLoaderConfiguration){
+        return new ProviderConfiguration( providerClassName, classpathConfiguration, classLoaderConfiguration, false, true, false );
+    }
+
+    public ClasspathConfiguration getClasspathConfiguration()
+    {
+        return classpathConfiguration;
+    }
+
+    public boolean useSystemClassLoader()
+    {
+        // todo; I am not totally convinced this logic is as simple as it could be
+        return classLoaderConfiguration.isUseSystemClassLoader() && ( isInForkedVm || isForkRequested );
+    }
+
+    public boolean isManifestOnlyJarRequestedAndUsable()
+    {
+        return classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable();
+    }
+
+    public boolean isRedirectTestOutputToFile()
+    {
+        return redirectTestOutputToFile;
+    }
+
+    public String getProviderClassName()
+    {
+        return providerClassName;
+    }
+
+}

Propchange: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java Tue Nov 30 19:08:41 2010
@@ -20,7 +20,6 @@ package org.apache.maven.surefire.booter
  */
 
 import org.apache.maven.surefire.providerapi.DirectoryScannerParametersAware;
-import org.apache.maven.surefire.providerapi.ProviderConfiguration;
 
 /**
  * @author Kristian Rosenvold
@@ -57,8 +56,8 @@ public class ProviderFactory
         ClassLoader context = java.lang.Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader( surefireClassLoader );
 
-        ProviderConfiguration providerConfiguration = booterConfiguration.getProviderConfiguration();
-        final Object o = surefireReflector.newInstance( providerConfiguration );
+        ProviderConfiguration starterConfiguration = booterConfiguration.getSurefireStarterConfiguration();
+        final Object o = surefireReflector.newInstance( starterConfiguration.getProviderClassName() );
         surefireReflector.setIfDirScannerAware( o, booterConfiguration.getDirScannerParams() );
         surefireReflector.setTestSuiteDefinitionAware( o, booterConfiguration.getTestSuiteDefinition() );
         surefireReflector.setProviderPropertiesAware( o, booterConfiguration.getProviderProperties() );
@@ -73,7 +72,8 @@ public class ProviderFactory
             ((ReportingAware) o).setReporterManagerFactory( reporterManagerFactory );
         }
 
-        Thread.currentThread().setContextClassLoader( context );*/
+*/
+        Thread.currentThread().setContextClassLoader( context );
 
         return o;
     }

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java Tue Nov 30 19:08:41 2010
@@ -29,6 +29,7 @@ import java.util.Properties;
  *
  * @author Jason van Zyl
  * @author Emmanuel Venisse
+ * @author Kristian Rosenvold
  * @version $Id$
  */
 public class SurefireStarter
@@ -41,7 +42,7 @@ public class SurefireStarter
         this.booterConfiguration = booterConfiguration;
     }
 
-    public int runSuitesInProcess( String testSet, Properties results )
+    public int runSuitesInProcess( Object testSet, Properties results )
         throws SurefireExecutionException
     {
         // TODO: replace with plexus
@@ -49,11 +50,14 @@ public class SurefireStarter
         ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
         try
         {
-            ClassLoader testsClassLoader = getClasspathConfiguration().createTestClassLoaderConditionallySystem(
-                booterConfiguration.useSystemClassLoader() );
+            final ProviderConfiguration starterConfiguration = booterConfiguration.getSurefireStarterConfiguration();
+            final ClasspathConfiguration classpathConfiguration = starterConfiguration.getClasspathConfiguration();
+
+            ClassLoader testsClassLoader = classpathConfiguration.createTestClassLoaderConditionallySystem(
+                starterConfiguration.useSystemClassLoader() );
 
             // TODO: assertions = true shouldn't be required for this CL if we had proper separation (see TestNG)
-            ClassLoader surefireClassLoader = getClasspathConfiguration().createSurefireClassLoader( testsClassLoader );
+            ClassLoader surefireClassLoader = classpathConfiguration.createSurefireClassLoader( testsClassLoader );
 
             SurefireReflector reflector = new SurefireReflector( surefireClassLoader );
 
@@ -61,10 +65,9 @@ public class SurefireStarter
             return reflector.runProvider( booterConfiguration.getReporterConfiguration(),
                                           booterConfiguration.getReports(), surefireClassLoader, testsClassLoader,
                                           results, booterConfiguration.isFailIfNoTests(),
-                                          booterConfiguration.getTestSuiteDefinition( testSet ),
-                                          booterConfiguration.getTestNg(),
-                                          booterConfiguration.getProviderConfiguration(),
-                                          booterConfiguration.getDirScannerParams() );
+                                          booterConfiguration.getTestSuiteDefinition(),
+                                          booterConfiguration.getTestNg(), starterConfiguration.getProviderClassName(),
+                                          booterConfiguration.getDirScannerParams(), testSet );
         }
         finally
         {
@@ -84,9 +87,11 @@ public class SurefireStarter
             // The test classloader must be constructed first to avoid issues with commons-logging until we properly
             // separate the TestNG classloader
             ClassLoader testsClassLoader;
-            String testClassPath = getClasspathConfiguration().getTestClasspath().getClassPathAsString();
+            final ProviderConfiguration starterConfiguration = booterConfiguration.getSurefireStarterConfiguration();
+            final ClasspathConfiguration classpathConfiguration = starterConfiguration.getClasspathConfiguration();
+            String testClassPath = classpathConfiguration.getTestClasspath().getClassPathAsString();
             System.setProperty( "surefire.test.class.path", testClassPath );
-            if ( booterConfiguration.isManifestOnlyJarRequestedAndUsable() )
+            if ( starterConfiguration.isManifestOnlyJarRequestedAndUsable() )
             {
                 testsClassLoader = getClass().getClassLoader(); // ClassLoader.getSystemClassLoader()
                 // SUREFIRE-459, trick the app under test into thinking its classpath was conventional
@@ -96,10 +101,10 @@ public class SurefireStarter
             }
             else
             {
-                testsClassLoader = getClasspathConfiguration().createTestClassLoader();
+                testsClassLoader = classpathConfiguration.createTestClassLoader();
             }
 
-            ClassLoader surefireClassLoader = getClasspathConfiguration().createSurefireClassLoader( testsClassLoader );
+            ClassLoader surefireClassLoader = classpathConfiguration.createSurefireClassLoader( testsClassLoader );
 
             SurefireReflector reflector = new SurefireReflector( surefireClassLoader );
 
@@ -109,8 +114,8 @@ public class SurefireStarter
                                           booterConfiguration.getReports(), surefireClassLoader, testsClassLoader, p,
                                           booterConfiguration.isFailIfNoTests(),
                                           booterConfiguration.getTestSuiteDefinition(), booterConfiguration.getTestNg(),
-                                          booterConfiguration.getProviderConfiguration(),
-                                          booterConfiguration.getDirScannerParams() );
+                                          starterConfiguration.getProviderClassName(),
+                                          booterConfiguration.getDirScannerParams(), null );
 
         }
         finally
@@ -119,9 +124,4 @@ public class SurefireStarter
         }
     }
 
-    private ClasspathConfiguration getClasspathConfiguration()
-    {
-        return booterConfiguration.getClasspathConfiguration();
-    }
-
 }

Modified: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java (original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java Tue Nov 30 19:08:41 2010
@@ -29,7 +29,7 @@ import org.apache.maven.surefire.provide
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
 import org.apache.maven.surefire.testset.TestArtifactInfo;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
+import org.apache.maven.surefire.testset.TestRequest;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -60,9 +60,8 @@ public class SurefireReflectorTest
         SurefireReflector surefireReflector = getReflector();
         Foo foo = new Foo();
 
-        TestSuiteDefinition testSuiteDefinition =
-            new TestSuiteDefinition( new File[]{ new File( "file1" ), new File( "file2" ) }, "aForkTest",
-                                     new File( "TestSOurce" ), "aUserRequestedTest" );
+        TestRequest testSuiteDefinition =
+            new TestRequest( new Object[]{  new File("file1"),new File("file2") }, new File( "TestSOurce" ), "aUserRequestedTest" );
         assertTrue( surefireReflector.isTestSuiteDefinitionAware( foo ) );
         surefireReflector.setTestSuiteDefinition( foo, testSuiteDefinition );
     }
@@ -122,7 +121,7 @@ public class SurefireReflectorTest
     {
         DirectoryScannerParameters directoryScannerParameters;
 
-        TestSuiteDefinition testSuiteDefinition;
+        TestRequest testSuiteDefinition;
 
         Properties providerProperties;
 
@@ -134,7 +133,7 @@ public class SurefireReflectorTest
         }
 
 
-        public void setTestSuiteDefinition( TestSuiteDefinition testSuiteDefinition )
+        public void setTestSuiteDefinition( TestRequest testSuiteDefinition )
         {
             this.testSuiteDefinition = testSuiteDefinition;
         }

Modified: maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java Tue Nov 30 19:08:41 2010
@@ -35,14 +35,14 @@ public class JUnit3Provider
     implements SurefireProvider
 {
 
-    public RunResult invoke()
+    public RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException
     {
         JUnitDirectoryTestSuite suite = getSuite();
         suite.locateTestSets( getTestsClassLoader() );
-        if ( getTestSuiteDefinition().getTestForFork() != null )
+        if ( forkTestSet != null )
         {
-            suite.execute( getTestSuiteDefinition().getTestForFork(), getReporterManagerFactory(),
+            suite.execute( (String) forkTestSet, getReporterManagerFactory(),
                            getTestsClassLoader() );
         }
         else

Modified: maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java Tue Nov 30 19:08:41 2010
@@ -24,8 +24,8 @@ import org.apache.maven.surefire.provide
 import org.apache.maven.surefire.providerapi.TestSuiteDefinitionAware;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.suite.RunResult;
+import org.apache.maven.surefire.testset.TestRequest;
 import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.apache.maven.surefire.testset.TestSuiteDefinition;
 
 import java.util.Iterator;
 import java.util.Properties;
@@ -41,18 +41,18 @@ public class JUnit4Provider
 
     private Properties providerProperties;
 
-    private TestSuiteDefinition testSuiteDefinition;
+    private TestRequest testSuiteDefinition;
 
 
     @SuppressWarnings( { "UnnecessaryUnboxing" } )
-    public RunResult invoke()
+    public RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException
     {
         JUnit4DirectoryTestSuite suite = getSuite();
         suite.locateTestSets( getTestsClassLoader() );
-        if ( testSuiteDefinition.getTestForFork() != null )
+        if ( forkTestSet != null )
         {
-            suite.execute( testSuiteDefinition.getTestForFork(), getReporterManagerFactory(), getTestsClassLoader() );
+            suite.execute( (String) forkTestSet, getReporterManagerFactory(), getTestsClassLoader() );
         }
         else
         {
@@ -85,7 +85,7 @@ public class JUnit4Provider
         this.providerProperties = providerProperties;
     }
 
-    public void setTestSuiteDefinition( TestSuiteDefinition testSuiteDefinition )
+    public void setTestSuiteDefinition( TestRequest testSuiteDefinition )
     {
         this.testSuiteDefinition = testSuiteDefinition;
     }

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java?rev=1040704&r1=1040703&r2=1040704&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java Tue Nov 30 19:08:41 2010
@@ -41,7 +41,7 @@ public class JUnitCoreProvider
 
 
     @SuppressWarnings( { "UnnecessaryUnboxing" } )
-    public RunResult invoke()
+    public RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException
     {
         // Todo; Not there quite yet
@@ -66,9 +66,9 @@ public class JUnitCoreProvider
 
         // getLog().info( "Concurrency config is " + getProperties().toString() );
 
-        if ( getTestSuiteDefinition().getTestForFork() != null )
+        if ( forkTestSet != null )
         {
-            jUnitCoreDirectoryTestSuite.execute( getTestSuiteDefinition().getTestForFork(), getReporterManagerFactory(),
+            jUnitCoreDirectoryTestSuite.execute( (String) forkTestSet, getReporterManagerFactory(),
                                                  getTestsClassLoader() );
         }
         else



Mime
View raw message