maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1053566 - 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-plugin/src/main/java/org/apache/maven/plugin/sur...
Date Wed, 29 Dec 2010 07:59:23 GMT
Author: krosenvold
Date: Wed Dec 29 07:59:22 2010
New Revision: 1053566

URL: http://svn.apache.org/viewvc?rev=1053566&view=rev
Log:
[SUREFIRE-675] Parameters should be boolean

Patch by Anders Hammar, accepted without modifications

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/SurefireExecutionParameters.java
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
    maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.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=1053566&r1=1053565&r2=1053566&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
Wed Dec 29 07:59:22 2010
@@ -464,21 +464,21 @@ public class IntegrationTestMojo
     private int threadCount;
 
     /**
-     * (JUnit 4.7 provider) Indicates that threadCount is per cpu core. Defaults to "true".
+     * (JUnit 4.7 provider) Indicates that threadCount is per cpu core.
      *
-     * @parameter expression="${perCoreThreadCount}"
+     * @parameter expression="${perCoreThreadCount}" default-value="true"
      * @since 2.5
      */
-    private String perCoreThreadCount;
+    private boolean perCoreThreadCount;
 
     /**
      * (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The <code>parallel</code>
parameter and the actual number of classes/methods
      * will decide. Setting this to "true" effectively disables <code>perCoreThreadCount</code>
and <code>threadCount</code>. Defaults to "false".
      *
-     * @parameter expression="${useUnlimitedThreads}"
+     * @parameter expression="${useUnlimitedThreads}" default-value="false"
      * @since 2.5
      */
-    private String useUnlimitedThreads;
+    private boolean useUnlimitedThreads;
 
     /**
      * (TestNG only) When you use the <code>parallel</code> attribute, TestNG
will try to run all your test methods in separate threads, except for
@@ -1175,22 +1175,22 @@ public class IntegrationTestMojo
         this.threadCount = threadCount;
     }
 
-    public String getPerCoreThreadCount()
+    public boolean getPerCoreThreadCount()
     {
         return perCoreThreadCount;
     }
 
-    public void setPerCoreThreadCount( String perCoreThreadCount )
+    public void setPerCoreThreadCount( boolean perCoreThreadCount )
     {
         this.perCoreThreadCount = perCoreThreadCount;
     }
 
-    public String getUseUnlimitedThreads()
+    public boolean getUseUnlimitedThreads()
     {
         return useUnlimitedThreads;
     }
 
-    public void setUseUnlimitedThreads( String useUnlimitedThreads )
+    public void setUseUnlimitedThreads( boolean useUnlimitedThreads )
     {
         this.useUnlimitedThreads = useUnlimitedThreads;
     }

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=1053566&r1=1053565&r2=1053566&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
Wed Dec 29 07:59:22 2010
@@ -184,7 +184,7 @@ public abstract class AbstractSurefireMo
     }
 
     /**
-     * Converts old TestNG configuration parameters over to new properties based configuration
+     * Converts old JUnit configuration parameters over to new properties based configuration
      * method. (if any are defined the old way)
      */
     private void convertJunitCoreParameters()
@@ -202,14 +202,8 @@ public abstract class AbstractSurefireMo
         {
             getProperties().setProperty( "threadCount", Integer.toString( this.getThreadCount()
) );
         }
-        if ( this.getPerCoreThreadCount() != null )
-        {
-            getProperties().setProperty( "perCoreThreadCount", getPerCoreThreadCount() );
-        }
-        if ( this.getUseUnlimitedThreads() != null )
-        {
-            getProperties().setProperty( "useUnlimitedThreads", getUseUnlimitedThreads()
);
-        }
+        getProperties().setProperty( "perCoreThreadCount", Boolean.toString( getPerCoreThreadCount()
) );
+        getProperties().setProperty( "useUnlimitedThreads", Boolean.toString( getUseUnlimitedThreads()
) );
     }
 
     private boolean isJunit47Compatible( Artifact artifact )

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireExecutionParameters.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireExecutionParameters.java?rev=1053566&r1=1053565&r2=1053566&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireExecutionParameters.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireExecutionParameters.java
Wed Dec 29 07:59:22 2010
@@ -196,13 +196,13 @@ public interface SurefireExecutionParame
 
     void setThreadCount( int threadCount );
 
-    String getPerCoreThreadCount();
+    boolean getPerCoreThreadCount();
 
-    void setPerCoreThreadCount( String perCoreThreadCount );
+    void setPerCoreThreadCount( boolean perCoreThreadCount );
 
-    String getUseUnlimitedThreads();
+    boolean getUseUnlimitedThreads();
 
-    void setUseUnlimitedThreads( String useUnlimitedThreads );
+    void setUseUnlimitedThreads( boolean useUnlimitedThreads );
 
     String getParallel();
 

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=1053566&r1=1053565&r2=1053566&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
Wed Dec 29 07:59:22 2010
@@ -102,8 +102,7 @@ public class SurefirePlugin
 
     /**
      * The directory containing generated test classes of the project being tested.
-     * This will be included at the beginning of the test classpath.
-     *
+     * This will be included at the beginning of the test classpath.                    
                                                                                         
             *
      * @parameter default-value="${project.build.testOutputDirectory}"
      */
     private File testClassesDirectory;
@@ -436,21 +435,21 @@ public class SurefirePlugin
     private int threadCount;
 
     /**
-     * (JUnit 4.7 provider) Indicates that threadCount is per cpu core. Defaults to "true".
+     * (JUnit 4.7 provider) Indicates that threadCount is per cpu core.
      *
-     * @parameter expression="${perCoreThreadCount}"
+     * @parameter expression="${perCoreThreadCount}" default-value="true"
      * @since 2.5
      */
-    private String perCoreThreadCount;
+    private boolean perCoreThreadCount;
 
     /**
      * (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The <code>parallel</code>
parameter and the actual number of classes/methods
      * will decide. Setting this to "true" effectively disables <code>perCoreThreadCount</code>
and <code>threadCount</code>. Defaults to "false".
      *
-     * @parameter expression="${useUnlimitedThreads}"
+     * @parameter expression="${useUnlimitedThreads}" default-value="false"
      * @since 2.5
      */
-    private String useUnlimitedThreads;
+    private boolean useUnlimitedThreads;
 
     /**
      * (TestNG only) When you use the <code>parallel</code> attribute, TestNG
will try to run all your test methods in separate threads, except for
@@ -1093,22 +1092,22 @@ public class SurefirePlugin
         this.threadCount = threadCount;
     }
 
-    public String getPerCoreThreadCount()
+    public boolean getPerCoreThreadCount()
     {
         return perCoreThreadCount;
     }
 
-    public void setPerCoreThreadCount( String perCoreThreadCount )
+    public void setPerCoreThreadCount( boolean perCoreThreadCount )
     {
         this.perCoreThreadCount = perCoreThreadCount;
     }
 
-    public String getUseUnlimitedThreads()
+    public boolean getUseUnlimitedThreads()
     {
         return useUnlimitedThreads;
     }
 
-    public void setUseUnlimitedThreads( String useUnlimitedThreads )
+    public void setUseUnlimitedThreads( boolean useUnlimitedThreads )
     {
         this.useUnlimitedThreads = useUnlimitedThreads;
     }

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java?rev=1053566&r1=1053565&r2=1053566&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
Wed Dec 29 07:59:22 2010
@@ -49,7 +49,7 @@ class JUnitCoreParameters
         this.perCoreThreadCount = Boolean.valueOf( properties.getProperty( PERCORETHREADCOUNT_KEY,
"true" ) );
         this.threadCount = Integer.valueOf( properties.getProperty( THREADCOUNT_KEY, "2"
) );
         this.useUnlimitedThreads =
-            Boolean.valueOf( properties.getProperty( USEUNLIMITEDTHREADS_KEY, "false" ).toLowerCase()
);
+            Boolean.valueOf( properties.getProperty( USEUNLIMITEDTHREADS_KEY, "false" ) );
     }
 
     public boolean isParallelMethod()



Mime
View raw message