You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/02/02 20:58:45 UTC

svn commit: r374481 - /maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java

Author: carlos
Date: Thu Feb  2 11:58:43 2006
New Revision: 374481

URL: http://svn.apache.org/viewcvs?rev=374481&view=rev
Log:
Validate forkMode
PR: MSUREFIRE-55

Modified:
    maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java

Modified: maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java?rev=374481&r1=374480&r2=374481&view=diff
==============================================================================
--- maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java (original)
+++ maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java Thu Feb  2 11:58:43 2006
@@ -16,12 +16,6 @@
  * limitations under the License.
  */
 
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.surefire.SurefireBooter;
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -33,6 +27,12 @@
 import java.util.Properties;
 import java.util.StringTokenizer;
 
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.surefire.SurefireBooter;
+
 /**
  * @author Jason van Zyl
  * @version $Id$
@@ -175,7 +175,7 @@
     private boolean useFile;
 
     /**
-     * Option to specify the forking mode.
+     * Option to specify the forking mode. Can be "none", "once" or "pertest"
      *
      * @parameter expression="${forkMode}"
      * default-value="none"
@@ -338,34 +338,33 @@
         // Forking
         // ----------------------------------------------------------------------
 
-        surefireBooter.setForkMode( forkMode );
-
-        if ( !forkMode.equals( "none" ) )
+        boolean success;
+        try
         {
-            surefireBooter.setSystemProperties( System.getProperties() );
+            surefireBooter.setForkMode( forkMode );
 
-            surefireBooter.setJvm( jvm );
+            if ( !forkMode.equals( "none" ) )
+            {
+                surefireBooter.setSystemProperties( System.getProperties() );
 
-            surefireBooter.setBasedir( basedir.getAbsolutePath() );
+                surefireBooter.setJvm( jvm );
 
-            surefireBooter.setArgLine( argLine );
+                surefireBooter.setBasedir( basedir.getAbsolutePath() );
 
-            surefireBooter.setEnvironmentVariables( environmentVariables );
+                surefireBooter.setArgLine( argLine );
 
-            surefireBooter.setWorkingDirectory( workingDirectory );
+                surefireBooter.setEnvironmentVariables( environmentVariables );
 
-            surefireBooter.setChildDelegation( childDelegation );
+                surefireBooter.setWorkingDirectory( workingDirectory );
 
-            if ( getLog().isDebugEnabled() )
-            {
-                surefireBooter.setDebug( true );
-            }
-        }
+                surefireBooter.setChildDelegation( childDelegation );
 
-        boolean success;
+                if ( getLog().isDebugEnabled() )
+                {
+                    surefireBooter.setDebug( true );
+                }
+            }
 
-        try
-        {
             success = surefireBooter.run();
         }
         catch ( Exception e )