Author: brett
Date: Mon Jul 31 01:32:11 2006
New Revision: 427044

URL: http://svn.apache.org/viewvc?rev=427044&view=rev
Log:
[MSUREFIRE-128] add a property to skip test execution (but not compilation)
Submitted by: Olivier Lamy

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

Modified: 
maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=427044&r1=427043&r2=427044&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
 (original)
+++ 
maven/plugins/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
 Mon Jul 31 01:32:11 2006
@@ -66,7 +66,7 @@
 public class SurefirePlugin
     extends AbstractMojo
 {
-       /**
+    /**
      * Set this to 'true' to bypass unit tests entirely. Its use is NOT 
RECOMMENDED, but quite convenient on occasion.
      *
      * @parameter expression="${maven.test.skip}"
@@ -74,6 +74,13 @@
     private boolean skip;
 
     /**
+     * Set this to 'true' to bypass unit tests execution, but still compile 
them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
+     *
+     * @parameter expression="${maven.test.skip.exec}"
+     */
+    private boolean skipExec;
+
+    /**
      * Set this to true to ignore a failure during testing. Its use is NOT 
RECOMMENDED, but quite convenient on occasion.
      *
      * @parameter expression="${maven.test.failure.ignore}"
@@ -214,9 +221,9 @@
     private boolean useFile;
 
     /**
-     * When forking, set this to true to redirect the unit test standard 
output to a file 
+     * When forking, set this to true to redirect the unit test standard 
output to a file
      * (found in reportsDirectory/testName-output.txt).
-     * 
+     *
      * @parameter expression="${maven.test.redirectTestOutputToFile}"
      * @default-value="false"
      */
@@ -232,8 +239,8 @@
 
     /**
      * Option to specify the jvm (or path to the java executable) to use with
-     * the forking options. For the default, the jvm will be the same as the 
one 
-     * used to run Maven. 
+     * the forking options. For the default, the jvm will be the same as the 
one
+     * used to run Maven.
      *
      * @parameter expression="${jvm}"
      */
@@ -335,6 +342,7 @@
 
     /**
      * The plugin remote repositories declared in the pom.
+     *
      * @parameter expression="${project.pluginArtifactRepositories}"
      */
     private List remoteRepositories;
@@ -352,6 +360,7 @@
 
     /**
      * Flag to disable the generation of report files in xml format.
+     *
      * @parameter expression="${disableXmlReport}" default-value="false"
      */
     private boolean disableXmlReport;
@@ -359,7 +368,7 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        if ( skip )
+        if ( skip || skipExec )
         {
             getLog().info( "Tests are skipped." );
         }
@@ -601,7 +610,7 @@
                 jvm = System.getProperty( "java.home" ) + File.separator + 
"bin" + File.separator + "java";
                 getLog().debug( "Using JVM: " + jvm );
             }
-            
+
             fork.setJvmExecutable( jvm );
 
             if ( workingDirectory != null )
@@ -779,5 +788,21 @@
         {
             surefireBooter.addReport( XMLReporter.class.getName(), new 
Object[]{reportsDirectory, trimStackTrace} );
         }
+    }
+
+    /**
+     * @return SurefirePlugin Returns the skipExec.
+     */
+    public boolean isSkipExec()
+    {
+        return this.skipExec;
+    }
+
+    /**
+     * @param skipExec the skipExec to set
+     */
+    public void setSkipExec( boolean skipExec )
+    {
+        this.skipExec = skipExec;
     }
 }


Reply via email to