maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1037309 - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/maven/plugin/sur...
Date Sat, 20 Nov 2010 19:36:15 GMT
Author: krosenvold
Date: Sat Nov 20 19:36:14 2010
New Revision: 1037309

URL: http://svn.apache.org/viewvc?rev=1037309&view=rev
Log:
o Renamed classes to better reflect real function

Also subtle simplification of where the forkMode flag is sent

Added:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java
  (contents, props changed)
      - copied, changed from r1036757, maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfiguration.java
    maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java
  (contents, props changed)
      - copied, changed from r1036757, maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfigurationTest.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java
  (contents, props changed)
      - copied, changed from r1036757, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
Removed:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfiguration.java
    maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfigurationTest.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    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/booter/BooterSerializer.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkStarter.java
    maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/BooterDeserializerTest.java
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
    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/BooterDeserializer.java

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=1037309&r1=1037308&r2=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
(original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
Sat Nov 20 19:36:14 2010
@@ -38,9 +38,9 @@ import org.apache.maven.execution.MavenS
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
+import org.apache.maven.plugin.surefire.booter.ForkConfiguration;
 import org.apache.maven.plugin.surefire.booter.ForkStarter;
 import org.apache.maven.plugin.surefire.SurefireExecutionParameters;
-import org.apache.maven.plugin.surefire.booter.PluginsideForkConfiguration;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.SurefireBooterForkException;
@@ -602,7 +602,7 @@ public class IntegrationTestMojo
     {
         if ( verifyParameters() )
         {
-            PluginsideForkConfiguration forkConfiguration = getForkConfiguration();
+            ForkConfiguration forkConfiguration = getForkConfiguration();
             BooterConfiguration booterConfiguration = createBooterConfiguration( forkConfiguration
);
             ForkStarter booter = new ForkStarter( booterConfiguration, reportsDirectory,
forkConfiguration );
 

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=1037309&r1=1037308&r2=1037309&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
Sat Nov 20 19:36:14 2010
@@ -34,7 +34,7 @@ import org.apache.maven.artifact.version
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.surefire.booter.PluginsideForkConfiguration;
+import org.apache.maven.plugin.surefire.booter.ForkConfiguration;
 import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
@@ -213,17 +213,17 @@ public abstract class AbstractSurefireMo
 
     protected boolean isForkModeNever()
     {
-        return PluginsideForkConfiguration.FORK_NEVER.equals( getForkMode() );
+        return ForkConfiguration.FORK_NEVER.equals( getForkMode() );
     }
 
-    protected BooterConfiguration createBooterConfiguration( PluginsideForkConfiguration
forkConfiguration )
+    protected BooterConfiguration createBooterConfiguration( ForkConfiguration forkConfiguration
)
         throws MojoExecutionException, MojoFailureException
     {
         final ClasspathConfiguration classpathConfiguration =
             new ClasspathConfiguration( isEnableAssertions(), isChildDelegation() );
 
         BooterConfiguration booterConfiguration =
-            new BooterConfiguration( forkConfiguration.getBooterForkConfiguration(), classpathConfiguration,
+            new BooterConfiguration( forkConfiguration.isForking(), forkConfiguration.getClassLoaderConfiguration(),
classpathConfiguration,
                                      isRedirectTestOutputToFile() );
 
         Artifact surefireArtifact =
@@ -358,7 +358,7 @@ public abstract class AbstractSurefireMo
             getLog().info( "Toolchain in " + getPluginName() + "-plugin: " + tc );
             if ( isForkModeNever() )
             {
-                setForkMode( PluginsideForkConfiguration.FORK_ONCE );
+                setForkMode( ForkConfiguration.FORK_ONCE );
             }
             if ( getJvm() != null )
             {
@@ -521,9 +521,9 @@ public abstract class AbstractSurefireMo
         return junitArtifact;
     }
 
-    protected PluginsideForkConfiguration getForkConfiguration()
+    protected ForkConfiguration getForkConfiguration()
     {
-        PluginsideForkConfiguration fork = new PluginsideForkConfiguration();
+        ForkConfiguration fork = new ForkConfiguration();
 
         fork.setForkMode( getForkMode() );
 

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/BooterSerializer.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/BooterSerializer.java?rev=1037309&r1=1037308&r2=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/BooterSerializer.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/BooterSerializer.java
Sat Nov 20 19:36:14 2010
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire
  */
 
 import org.apache.maven.surefire.booter.BooterConfiguration;
-import org.apache.maven.surefire.booter.ForkConfiguration;
+import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -59,7 +59,7 @@ public class BooterSerializer
 
 
     public void setForkProperties( Properties properties, List testSuites, BooterConfiguration
booterConfiguration,
-                                   ForkConfiguration forkConfiguration )
+                                   ClassLoaderConfiguration forkConfiguration )
     {
         addPropertiesForTypeHolder( booterConfiguration.getReports(), properties, REPORT_PROPERTY_PREFIX
);
         addPropertiesForTypeHolder( testSuites, properties, TEST_SUITE_PROPERTY_PREFIX );

Copied: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java
(from r1036757, maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfiguration.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java?p2=maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java&p1=maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfiguration.java&r1=1036757&r2=1037309&rev=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfiguration.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java
Sat Nov 20 19:36:14 2010
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire
  * under the License.
  */
 
-import org.apache.maven.surefire.booter.ForkConfiguration;
+import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.ForkedBooter;
 import org.apache.maven.surefire.booter.SurefireBooterForkException;
 import org.apache.maven.surefire.util.UrlUtils;
@@ -45,13 +45,13 @@ import java.util.jar.Manifest;
  * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
  * @author <a href="mailto:krosenvold@apache.org">Kristian Rosenvold</a>
  */
-public class PluginsideForkConfiguration
+public class ForkConfiguration
 {
     public static final String FORK_ONCE = "once";
 
     public static final String FORK_ALWAYS = "always";
 
-    public static final String FORK_NEVER = ForkConfiguration.FORK_NEVER;
+    public static final String FORK_NEVER = "never";
 
     private String forkMode;
 
@@ -75,9 +75,9 @@ public class PluginsideForkConfiguration
 
     private String debugLine;
 
-    public ForkConfiguration getBooterForkConfiguration()
+    public ClassLoaderConfiguration getClassLoaderConfiguration()
     {
-        return new ForkConfiguration(isUseSystemClassLoader() , isUseManifestOnlyJar(), forkMode);
+        return new ClassLoaderConfiguration(isUseSystemClassLoader() , isUseManifestOnlyJar()
);
     }
 
     public void setForkMode( String forkMode )

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

Propchange: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkStarter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkStarter.java?rev=1037309&r1=1037308&r2=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkStarter.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booter/ForkStarter.java
Sat Nov 20 19:36:14 2010
@@ -69,13 +69,13 @@ public class ForkStarter
 
     private final BooterConfiguration booterConfiguration;
 
-    private final PluginsideForkConfiguration forkConfiguration;
+    private final ForkConfiguration forkConfiguration;
 
     private File reportsDirectory;
 
 
     public ForkStarter( BooterConfiguration booterConfiguration, File reportsDirectory,
-                             PluginsideForkConfiguration forkConfiguration )
+                             ForkConfiguration forkConfiguration )
     {
         this.forkConfiguration = forkConfiguration;
         this.booterConfiguration = booterConfiguration;
@@ -88,16 +88,16 @@ public class ForkStarter
         int result;
 
         final String requestedForkMode = forkConfiguration.getForkMode();
-        if ( PluginsideForkConfiguration.FORK_NEVER.equals( requestedForkMode ) )
+        if ( ForkConfiguration.FORK_NEVER.equals( requestedForkMode ) )
         {
             SurefireStarter testVmBooter = new SurefireStarter( booterConfiguration );
             result = testVmBooter.runSuitesInProcess();
         }
-        else if ( PluginsideForkConfiguration.FORK_ONCE.equals( requestedForkMode ) )
+        else if ( ForkConfiguration.FORK_ONCE.equals( requestedForkMode ) )
         {
             result = runSuitesForkOnce();
         }
-        else if ( PluginsideForkConfiguration.FORK_ALWAYS.equals( requestedForkMode ) )
+        else if ( ForkConfiguration.FORK_ALWAYS.equals( requestedForkMode ) )
         {
             result = runSuitesForkPerTestSet();
         }
@@ -217,7 +217,7 @@ public class ForkStarter
 
         BooterSerializer booterSerializer = new BooterSerializer();
         booterSerializer.setForkProperties( properties, testSuites, booterConfiguration,
-                                            forkConfiguration.getBooterForkConfiguration()
);
+                                            forkConfiguration.getClassLoaderConfiguration()
);
 
         return fork( properties, showHeading, showFooter );
     }
@@ -228,7 +228,7 @@ public class ForkStarter
     {
         BooterSerializer booterSerializer = new BooterSerializer();
         booterSerializer.setForkProperties( properties, Collections.singletonList( testSuite
), booterConfiguration,
-                                            forkConfiguration.getBooterForkConfiguration()
);
+                                            forkConfiguration.getClassLoaderConfiguration()
);
 
         if ( testSet instanceof String )
         {

Modified: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/BooterDeserializerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/BooterDeserializerTest.java?rev=1037309&r1=1037308&r2=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/BooterDeserializerTest.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/BooterDeserializerTest.java
Sat Nov 20 19:36:14 2010
@@ -22,8 +22,8 @@ import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.apache.maven.surefire.booter.BooterConfiguration;
 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.booter.ForkConfiguration;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -40,16 +40,16 @@ public class BooterDeserializerTest
     extends TestCase
 {
 
-    public static ForkConfiguration getForkConfiguration()
+    public static ClassLoaderConfiguration getForkConfiguration()
         throws IOException
     {
-        return new ForkConfiguration( true, false, ForkConfiguration.FORK_NEVER );
+        return new ClassLoaderConfiguration( true, false );
     }
 
     public void testDirectoryScannerParams()
         throws IOException
     {
-        ForkConfiguration forkConfiguration = getForkConfiguration();
+        ClassLoaderConfiguration forkConfiguration = getForkConfiguration();
         BooterConfiguration booterConfiguration = getTestBooterConfiguration( forkConfiguration
);
 
         File aDir = new File( "." );
@@ -77,11 +77,11 @@ public class BooterDeserializerTest
 
     }
 
-    private BooterConfiguration getTestBooterConfiguration( ForkConfiguration forkConfiguration
)
+    private BooterConfiguration getTestBooterConfiguration( ClassLoaderConfiguration forkConfiguration
)
         throws IOException
     {
         ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( true,
true );
 
-        return new BooterConfiguration( forkConfiguration, classpathConfiguration, false
);
+        return new BooterConfiguration( false, forkConfiguration, classpathConfiguration,
false );
     }
 }

Copied: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java
(from r1036757, maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfigurationTest.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java?p2=maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java&p1=maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfigurationTest.java&r1=1036757&r2=1037309&rev=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/PluginsideForkConfigurationTest.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java
Sat Nov 20 19:36:14 2010
@@ -28,16 +28,16 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 
-public class PluginsideForkConfigurationTest
+public class ForkConfigurationTest
     extends TestCase
 {
 
     public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructManifestOnlyJar()
         throws IOException, SurefireBooterForkException
     {
-        PluginsideForkConfiguration config = getForkConfiguration();
+        ForkConfiguration config = getForkConfiguration();
         File cpElement = getTempClasspathFile();
-        config.setForkMode( PluginsideForkConfiguration.FORK_ONCE );
+        config.setForkMode( ForkConfiguration.FORK_ONCE );
         config.setUseSystemClassLoader( true );
         config.setUseSystemClassLoader( true );
         config.setJvmExecutable( "java" );
@@ -54,7 +54,7 @@ public class PluginsideForkConfiguration
     {
         // SUREFIRE-657
         File cpElement = getTempClasspathFile();
-        PluginsideForkConfiguration forkConfiguration = getForkConfiguration();
+        ForkConfiguration forkConfiguration = getForkConfiguration();
 
         forkConfiguration.setArgLine( "abc\ndef" );
 
@@ -71,10 +71,10 @@ public class PluginsideForkConfiguration
         return cpElement;
     }
 
-    public static PluginsideForkConfiguration getForkConfiguration()
+    public static ForkConfiguration getForkConfiguration()
         throws IOException
     {
-        PluginsideForkConfiguration forkConfiguration = new PluginsideForkConfiguration();
+        ForkConfiguration forkConfiguration = new ForkConfiguration();
         forkConfiguration.setWorkingDirectory( new File( "." ).getCanonicalFile() );
         return forkConfiguration;
     }

Propchange: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booter/ForkConfigurationTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=1037309&r1=1037308&r2=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Sat Nov 20 19:36:14 2010
@@ -27,7 +27,7 @@ import org.apache.maven.execution.MavenS
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.surefire.booter.ForkStarter;
-import org.apache.maven.plugin.surefire.booter.PluginsideForkConfiguration;
+import org.apache.maven.plugin.surefire.booter.ForkConfiguration;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.surefire.booter.BooterConfiguration;
 import org.apache.maven.surefire.booter.SurefireBooterForkException;
@@ -569,7 +569,7 @@ public class SurefirePlugin
     {
         if ( verifyParameters() )
         {
-            PluginsideForkConfiguration forkConfiguration = getForkConfiguration();
+            ForkConfiguration forkConfiguration = getForkConfiguration();
             BooterConfiguration booterConfiguration = createBooterConfiguration( forkConfiguration
);
 
             getLog().info(

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=1037309&r1=1037308&r2=1037309&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
Sat Nov 20 19:36:14 2010
@@ -46,7 +46,7 @@ public class BooterConfiguration
 
     public static final int NO_TESTS_EXIT_CODE = 254;
 
-    private final ForkConfiguration forkConfiguration;
+    private final ClassLoaderConfiguration classLoaderConfiguration;
 
     private final ClasspathConfiguration classpathConfiguration;
 
@@ -60,32 +60,36 @@ public class BooterConfiguration
 
     private Properties properties; // todo: Zap out of here !
 
+    private final boolean isForkRequested;
+
     Object[] dirScannerParams;
 
     private final boolean isInForkedVm;
 
-    public BooterConfiguration( ForkConfiguration forkConfiguration, ClasspathConfiguration
classpathConfiguration,
+    public BooterConfiguration( boolean isForkRequested, ClassLoaderConfiguration classLoaderConfiguration,
+                                ClasspathConfiguration classpathConfiguration,
                                 boolean redirectTestOutputToFile)
     {
-        this.forkConfiguration = forkConfiguration;
+        this.classLoaderConfiguration = classLoaderConfiguration;
         this.classpathConfiguration = classpathConfiguration;
         this.isInForkedVm = false;
+        this.isForkRequested = isForkRequested;
         this.redirectTestOutputToFile = redirectTestOutputToFile;
     }
 
-    public BooterConfiguration( ForkConfiguration forkConfiguration, ClasspathConfiguration
classpathConfiguration,
-                                SuiteDefinition suiteDefinition, List reports, boolean forked,
-                                Object[] dirScannerParams, boolean failIfNoTests, Properties
properties )
+    public BooterConfiguration( ClassLoaderConfiguration classLoaderConfiguration, ClasspathConfiguration
classpathConfiguration,
+                                SuiteDefinition suiteDefinition, List reports, Object[] dirScannerParams,
boolean failIfNoTests, Properties properties )
     {
-        this.forkConfiguration = forkConfiguration;
+        this.classLoaderConfiguration = classLoaderConfiguration;
         this.classpathConfiguration = classpathConfiguration;
         this.suiteDefinition = suiteDefinition;
         this.reports.addAll( reports );
-        this.isInForkedVm = forked;
         this.dirScannerParams = dirScannerParams;
         this.failIfNoTests = failIfNoTests;
         this.redirectTestOutputToFile = false;
         this.properties = properties; // Todo: Hack hack. This must go
+        this.isForkRequested = false;
+        this.isInForkedVm = true;
     }
 
 
@@ -97,7 +101,8 @@ public class BooterConfiguration
 
     public boolean useSystemClassLoader()
     {
-        return forkConfiguration.isUseSystemClassLoader() && ( isInForkedVm || forkConfiguration.isForking()
);
+        // todo; I am not totally convinced this logic is as simple as it could be
+        return classLoaderConfiguration.isUseSystemClassLoader() && ( isInForkedVm
|| isForkRequested );
     }
 
 
@@ -184,6 +189,6 @@ public class BooterConfiguration
 
     public boolean isManifestOnlyJarRequestedAndUsable()
     {
-        return forkConfiguration.isManifestOnlyJarRequestedAndUsable();
+        return classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable();
     }
 }

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=1037309&r1=1037308&r2=1037309&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
Sat Nov 20 19:36:14 2010
@@ -148,15 +148,14 @@ public class BooterDeserializer
         }
 
         // todo check out this "never" value
-        ForkConfiguration forkConfiguration =
-            new ForkConfiguration( useSystemClassLoader, useManifestOnlyJar, "never" );
+        ClassLoaderConfiguration forkConfiguration =
+            new ClassLoaderConfiguration( useSystemClassLoader, useManifestOnlyJar );
 
         ClasspathConfiguration classpathConfiguration =
             new ClasspathConfiguration( classPathUrls, surefireClassPathUrls, booterClassPathUrl,
enableAssertions,
                                         childDelegation );
 
-        boolean forked = true;
-        return new BooterConfiguration( forkConfiguration, classpathConfiguration, suiteDefinition,
reports, forked,
+        return new BooterConfiguration( forkConfiguration, classpathConfiguration, suiteDefinition,
reports,
                                         dirScannerParams, failIfNotests, properties );
     }
 

Copied: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java
(from r1036757, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java?p2=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java&r1=1036757&r2=1037309&rev=1037309&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java
Sat Nov 20 19:36:14 2010
@@ -25,26 +25,17 @@ package org.apache.maven.surefire.booter
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
  */
-public class ForkConfiguration
+public class ClassLoaderConfiguration
 {
-    public static final String FORK_NEVER = "never";
-
-    private final String forkMode;
 
     private final boolean useSystemClassLoader;
 
     private final boolean useManifestOnlyJar;
 
-    public ForkConfiguration( boolean useSystemClassLoader, boolean useManifestOnlyJar, String
forkMode )
+    public ClassLoaderConfiguration( boolean useSystemClassLoader, boolean useManifestOnlyJar
)
     {
         this.useSystemClassLoader = useSystemClassLoader;
         this.useManifestOnlyJar = useManifestOnlyJar;
-        this.forkMode = forkMode;
-    }
-
-    public boolean isForking()
-    {
-        return !FORK_NEVER.equals( forkMode );
     }
 
     public boolean isUseSystemClassLoader()
@@ -56,5 +47,4 @@ public class ForkConfiguration
     {
         return isUseSystemClassLoader() && useManifestOnlyJar;
     }
-
 }

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

Propchange: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClassLoaderConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message