maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agud...@apache.org
Subject [01/11] git commit: SUREFIRE [1048] Surefire does not use the total amount of threads specified by threadCount
Date Sun, 09 Mar 2014 19:42:05 GMT
Repository: maven-surefire
Updated Branches:
  refs/heads/master 55b8d9117 -> 569724167


SUREFIRE [1048] Surefire does not use the total amount of threads specified by threadCount


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/eaeaa28d
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/eaeaa28d
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/eaeaa28d

Branch: refs/heads/master
Commit: eaeaa28dc22ec8098c05fe3eb895e325d12a2676
Parents: 55b8d91
Author: Tibor Digana <tibor17@lycos.com>
Authored: Sun Feb 23 16:18:05 2014 +0100
Committer: Andreas Gudian <agudian@apache.org>
Committed: Sun Mar 9 19:46:39 2014 +0100

----------------------------------------------------------------------
 .../plugin/surefire/AbstractSurefireMojo.java   |  30 ++-
 .../surefire/booter/ProviderParameterNames.java |   2 +
 .../surefire/junitcore/JUnitCoreParameters.java |  23 +-
 .../surefire/junitcore/JUnitCoreProvider.java   |   2 +-
 .../surefire/junitcore/JUnitCoreWrapper.java    |   6 +-
 .../junitcore/ParallelComputerFactory.java      | 126 ++++++-----
 .../junitcore/pc/ParallelComputerBuilder.java   |  75 +++++--
 .../surefire/junitcore/pc/RunnerCounter.java    |  43 ++++
 .../surefire/junitcore/pc/WrappedRunners.java   |  46 ++++
 .../junitcore/JUnitCoreParametersTest.java      |   8 +-
 .../junitcore/ParallelComputerFactoryTest.java  | 208 +++++++++----------
 .../surefire/junitcore/Surefire746Test.java     |   2 +-
 12 files changed, 381 insertions(+), 190 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 3a12f1c..f4da5a3 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -495,6 +495,17 @@ public abstract class AbstractSurefireMojo
     protected String parallel;
 
     /**
+     * (JUnit 4.7 / provider only) The thread counts do not exceed the number of parallel suite, class runners and
+     * average number of methods per class if set to <strong>true</strong>.
+     * <p/>
+     * True by default.
+     *
+     * @since 2.17
+     */
+    @Parameter( property = "parallelOptimized", defaultValue = "true" )
+    protected boolean parallelOptimized;
+
+    /**
      * (JUnit 4.7 provider) The attribute thread-count-suites allows you to specify the concurrency in test suites, i.e.:
      * <ul>
      *  <li>number of threads executing JUnit test suites if <code>threadCount</code> is 0 or unspecified</li>
@@ -1147,12 +1158,14 @@ public abstract class AbstractSurefireMojo
                 Double.toString( getParallelTestsTimeoutInSeconds() ) );
         getProperties().setProperty( ProviderParameterNames.PARALLEL_TIMEOUTFORCED_PROP,
                 Double.toString( getParallelTestsTimeoutForcedInSeconds() ) );
+        getProperties().setProperty( ProviderParameterNames.PARALLEL_OPTIMIZE_PROP,
+                                     Boolean.toString( isParallelOptimized() ) );
 
         String message =
             "parallel='" + usedParallel + '\'' + ", perCoreThreadCount=" + getPerCoreThreadCount() + ", threadCount="
                 + usedThreadCount + ", useUnlimitedThreads=" + getUseUnlimitedThreads() +
                     ", threadCountSuites=" + getThreadCountSuites() + ", threadCountClasses=" + getThreadCountClasses() +
-                    ", threadCountMethods=" + getThreadCountMethods();
+                    ", threadCountMethods=" + getThreadCountMethods() + ", parallelOptimized=" + isParallelOptimized();
 
         getLog().info( message );
     }
@@ -1926,6 +1939,7 @@ public abstract class AbstractSurefireMojo
         checksum.add( getPerCoreThreadCount() );
         checksum.add( getUseUnlimitedThreads() );
         checksum.add( getParallel() );
+        checksum.add( isParallelOptimized() );
         checksum.add( isTrimStackTrace() );
         checksum.add( getRemoteRepositories() );
         checksum.add( isDisableXmlReport() );
@@ -2740,12 +2754,22 @@ public abstract class AbstractSurefireMojo
         this.parallel = parallel;
     }
 
+    public boolean isParallelOptimized()
+    {
+        return parallelOptimized;
+    }
+
+    @SuppressWarnings( "UnusedDeclaration" )
+    public void setParallelOptimized( boolean parallelOptimized )
+    {
+        this.parallelOptimized = parallelOptimized;
+    }
+
     public int getThreadCountSuites()
     {
         return threadCountSuites;
     }
 
-    @SuppressWarnings( "UnusedDeclaration" )
     public void setThreadCountSuites( int threadCountSuites )
     {
         this.threadCountSuites = threadCountSuites;
@@ -2756,7 +2780,6 @@ public abstract class AbstractSurefireMojo
         return threadCountClasses;
     }
 
-    @SuppressWarnings( "UnusedDeclaration" )
     public void setThreadCountClasses( int threadCountClasses )
     {
         this.threadCountClasses = threadCountClasses;
@@ -2767,7 +2790,6 @@ public abstract class AbstractSurefireMojo
         return threadCountMethods;
     }
 
-    @SuppressWarnings( "UnusedDeclaration" )
     public void setThreadCountMethods( int threadCountMethods )
     {
         this.threadCountMethods = threadCountMethods;

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-api/src/main/java/org/apache/maven/surefire/booter/ProviderParameterNames.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ProviderParameterNames.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ProviderParameterNames.java
index 72c16ac..d9e1377 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ProviderParameterNames.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ProviderParameterNames.java
@@ -41,4 +41,6 @@ public class ProviderParameterNames
 
     public static final String PARALLEL_TIMEOUTFORCED_PROP = "paralleltimeoutforced";
 
+    public static final String PARALLEL_OPTIMIZE_PROP = "paralleloptimization";
+
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
index 8421751..4c042a0 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
@@ -28,7 +28,7 @@ import org.apache.maven.surefire.booter.ProviderParameterNames;
 /**
  * @author Kristian Rosenvold
  */
-class JUnitCoreParameters
+public final class JUnitCoreParameters
 {
     public static final String PARALLEL_KEY = ProviderParameterNames.PARALLEL_PROP;
 
@@ -48,6 +48,8 @@ class JUnitCoreParameters
 
     public static final String PARALLEL_TIMEOUTFORCED_KEY = ProviderParameterNames.PARALLEL_TIMEOUTFORCED_PROP;
 
+    public static final String PARALLEL_OPTIMIZE = ProviderParameterNames.PARALLEL_OPTIMIZE_PROP;
+
     private final String parallel;
 
     private final Boolean perCoreThreadCount;
@@ -66,6 +68,8 @@ class JUnitCoreParameters
 
     private final Boolean useUnlimitedThreads;
 
+    private final boolean parallelOptimization;
+
     public JUnitCoreParameters( Properties properties )
     {
         parallel = properties.getProperty( PARALLEL_KEY, "none" ).toLowerCase();
@@ -79,6 +83,7 @@ class JUnitCoreParameters
             Math.max( Double.valueOf( properties.getProperty( PARALLEL_TIMEOUT_KEY, "0" ) ), 0 );
         parallelTestsTimeoutForcedInSeconds =
             Math.max( Double.valueOf( properties.getProperty( PARALLEL_TIMEOUTFORCED_KEY, "0" ) ), 0 );
+        parallelOptimization = Boolean.valueOf( properties.getProperty( PARALLEL_OPTIMIZE, "true" ) );
     }
 
     private static Collection<String> lowerCase( String... elements )
@@ -96,7 +101,7 @@ class JUnitCoreParameters
         return "all".equals( parallel );
     }
 
-    public boolean isParallelMethod()
+    public boolean isParallelMethods()
     {
         return isAllParallel() || lowerCase( "both", "methods", "suitesAndMethods", "classesAndMethods" ).contains(
             parallel );
@@ -114,12 +119,12 @@ class JUnitCoreParameters
     }
 
     /**
-     * @deprecated Instead use the expression ( {@link #isParallelMethod()} && {@link #isParallelClasses()} ).
+     * @deprecated Instead use the expression ( {@link #isParallelMethods()} && {@link #isParallelClasses()} ).
      */
     @Deprecated
     public boolean isParallelBoth()
     {
-        return isParallelMethod() && isParallelClasses();
+        return isParallelMethods() && isParallelClasses();
     }
 
     public Boolean isPerCoreThreadCount()
@@ -169,7 +174,12 @@ class JUnitCoreParameters
 
     public boolean isAnyParallelitySelected()
     {
-        return isParallelSuites() || isParallelClasses() || isParallelMethod();
+        return isParallelSuites() || isParallelClasses() || isParallelMethods();
+    }
+
+    public boolean isParallelOptimization()
+    {
+        return parallelOptimization;
     }
 
     @Override
@@ -177,6 +187,7 @@ class JUnitCoreParameters
     {
         return "parallel='" + parallel + '\'' + ", perCoreThreadCount=" + perCoreThreadCount + ", threadCount="
             + threadCount + ", useUnlimitedThreads=" + useUnlimitedThreads + ", threadCountSuites=" + threadCountSuites
-            + ", threadCountClasses=" + threadCountClasses + ", threadCountMethods=" + threadCountMethods;
+            + ", threadCountClasses=" + threadCountClasses + ", threadCountMethods=" + threadCountMethods
+            + ", parallelOptimization=" + parallelOptimization;
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
index de0673c..04f1673 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
@@ -163,7 +163,7 @@ public class JUnitCoreProvider
 
     private boolean isParallelMethodsAndTypes()
     {
-        return jUnitCoreParameters.isParallelMethod() && isParallelTypes();
+        return jUnitCoreParameters.isParallelMethods() && isParallelTypes();
     }
 
     private boolean isParallelTypes()

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreWrapper.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreWrapper.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreWrapper.java
index e124f6e..7bf7a89 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreWrapper.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreWrapper.java
@@ -55,7 +55,7 @@ class JUnitCoreWrapper
         }
         else
         {
-            exeuteLazy( testsToRun, filter, computer, junitCore );
+            executeLazy( testsToRun, filter, computer, junitCore );
         }
 
         if ( computer instanceof ParallelComputer )
@@ -85,7 +85,7 @@ class JUnitCoreWrapper
         createRequestAndRun( filter, computer, junitCore, tests );
     }
 
-    private static void exeuteLazy( TestsToRun testsToRun, Filter filter, Computer computer, JUnitCore junitCore )
+    private static void executeLazy( TestsToRun testsToRun, Filter filter, Computer computer, JUnitCore junitCore )
         throws TestSetFailedException
     {
         // in order to support LazyTestsToRun, the iterator must be used
@@ -119,7 +119,7 @@ class JUnitCoreWrapper
     {
         return parameters.isNoThreading()
             ? Computer.serial()
-            : ParallelComputerFactory.createParallelComputer( parameters );
+            : ParallelComputerFactory.createParallelComputer( parameters, parameters.isParallelOptimization() ? null : null );//todo resolve
     }
 
     private static class FilteringRequest

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ParallelComputerFactory.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ParallelComputerFactory.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ParallelComputerFactory.java
index d7fe2d1..91ef5bc 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ParallelComputerFactory.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ParallelComputerFactory.java
@@ -21,6 +21,7 @@ package org.apache.maven.surefire.junitcore;
 
 import org.apache.maven.surefire.junitcore.pc.ParallelComputer;
 import org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder;
+import org.apache.maven.surefire.junitcore.pc.RunnerCounter;
 import org.apache.maven.surefire.testset.TestSetFailedException;
 
 import java.util.concurrent.TimeUnit;
@@ -59,10 +60,10 @@ final class ParallelComputerFactory
         ParallelComputerFactory.availableProcessors = Runtime.getRuntime().availableProcessors();
     }
 
-    static ParallelComputer createParallelComputer( JUnitCoreParameters params )
+    static ParallelComputer createParallelComputer( JUnitCoreParameters params, RunnerCounter counts )
         throws TestSetFailedException
     {
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, counts );
         ParallelComputerBuilder builder = new ParallelComputerBuilder();
 
         if ( params.isParallelSuites() )
@@ -75,7 +76,7 @@ final class ParallelComputerFactory
             resolveClassesConcurrency( builder, concurrency.classes );
         }
 
-        if ( params.isParallelMethod() )
+        if ( params.isParallelMethods() )
         {
             resolveMethodsConcurrency( builder, concurrency.methods );
         }
@@ -86,7 +87,7 @@ final class ParallelComputerFactory
         return builder.buildComputer( timeout, timeoutForced, TimeUnit.NANOSECONDS );
     }
 
-    static Concurrency resolveConcurrency( JUnitCoreParameters params )
+    static Concurrency resolveConcurrency( JUnitCoreParameters params, RunnerCounter counts )
         throws TestSetFailedException
     {
         if ( !params.isAnyParallelitySelected() )
@@ -108,26 +109,23 @@ final class ParallelComputerFactory
         {
             return concurrencyForUnlimitedThreads( params );
         }
-        else
+        else if ( hasThreadCount( params ) )
         {
-            if ( hasThreadCount( params ) )
+            if ( hasThreadCounts( params ) )
             {
-                if ( hasThreadCounts( params ) )
-                {
-                    return isLeafUnspecified( params )
-                        ? concurrencyFromAllThreadCountsButUnspecifiedLeafCount( params )
-                        : concurrencyFromAllThreadCounts( params );
-                }
-                else
-                {
-                    return estimateConcurrency( params );
-                }
+                return isLeafUnspecified( params )
+                    ? concurrencyFromAllThreadCountsButUnspecifiedLeafCount( params, counts )
+                    : concurrencyFromAllThreadCounts( params );
             }
             else
             {
-                return concurrencyFromThreadCounts( params );
+                return estimateConcurrency( params, counts );
             }
         }
+        else
+        {
+            return concurrencyFromThreadCounts( params );
+        }
     }
 
     private static long secondsToNanos( double seconds )
@@ -194,50 +192,74 @@ final class ParallelComputerFactory
         Concurrency concurrency = new Concurrency();
         concurrency.suites = params.isParallelSuites() ? threadCountSuites( params ) : 0;
         concurrency.classes = params.isParallelClasses() ? threadCountClasses( params ) : 0;
-        concurrency.methods = params.isParallelMethod() ? threadCountMethods( params ) : 0;
+        concurrency.methods = params.isParallelMethods() ? threadCountMethods( params ) : 0;
         concurrency.capacity = Integer.MAX_VALUE;
         return concurrency;
     }
 
-    private static Concurrency estimateConcurrency( JUnitCoreParameters params )
+    private static Concurrency estimateConcurrency( JUnitCoreParameters params, RunnerCounter counts )
     {
-        Concurrency concurrency = new Concurrency();
-        concurrency.suites = params.isParallelSuites() ? params.getThreadCountSuites() : 0;
-        concurrency.classes = params.isParallelClasses() ? params.getThreadCountClasses() : 0;
-        concurrency.methods = params.isParallelMethod() ? params.getThreadCountMethods() : 0;
-        concurrency.capacity = params.getThreadCount();
-
-        // estimate parallel thread counts
-        double ratio = 1d / countParallelEntities( params );
-        int threads = multiplyByCoreCount( params, ratio * concurrency.capacity );
-        concurrency.suites = params.isParallelSuites() ? threads : 0;
-        concurrency.classes = params.isParallelClasses() ? threads : 0;
-        concurrency.methods = params.isParallelMethod() ? threads : 0;
-        if ( countParallelEntities( params ) == 1 )
+        final Concurrency concurrency = new Concurrency();
+        final int parallelEntities = countParallelEntities( params );
+        concurrency.capacity = multiplyByCoreCount( params, params.getThreadCount() );
+        if ( parallelEntities == 1 || counts == null || counts.classes == 0 )
         {
-            concurrency.capacity = 0;
+            // Estimate parallel thread counts.
+            double ratio = 1d / parallelEntities;
+            int threads = multiplyByCoreCount( params, ratio * params.getThreadCount() );
+            concurrency.suites = params.isParallelSuites() ? threads : 0;
+            concurrency.classes = params.isParallelClasses() ? threads : 0;
+            concurrency.methods = params.isParallelMethods() ? threads : 0;
+            if ( parallelEntities == 1 )
+            {
+                concurrency.capacity = 0;
+            }
+            else
+            {
+                adjustLeaf( params, concurrency );
+            }
         }
         else
         {
-            concurrency.capacity = multiplyByCoreCount( params, concurrency.capacity );
+            // Try to allocate suites+classes+methods within threadCount,
+            concurrency.suites = params.isParallelSuites() ? multiplyByCoreCount( params, counts.suites ) : 0;
+            concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, counts.classes ) : 0;
+            concurrency.methods =
+                params.isParallelMethods() ? multiplyByCoreCount( params, counts.methods / counts.classes ) : 0;
+            double sum = (double) concurrency.suites + concurrency.classes + concurrency.methods;
+            if ( concurrency.capacity < sum && sum != 0 )
+            {
+                // otherwise allocate them using the weighting factor < 1.
+                double weight = concurrency.capacity / sum;
+                concurrency.suites *= weight;
+                concurrency.classes *= weight;
+                concurrency.methods *= weight;
+                adjustPrecisionInLeaf( params, concurrency );
+            }
             adjustLeaf( params, concurrency );
         }
         return concurrency;
     }
 
-    private static Concurrency concurrencyFromAllThreadCountsButUnspecifiedLeafCount( JUnitCoreParameters params )
+    private static Concurrency concurrencyFromAllThreadCountsButUnspecifiedLeafCount( JUnitCoreParameters params,
+                                                                                      RunnerCounter counts )
     {
         Concurrency concurrency = new Concurrency();
         concurrency.suites = params.isParallelSuites() ? params.getThreadCountSuites() : 0;
+        concurrency.suites = params.isParallelSuites() ? multiplyByCoreCount( params, concurrency.suites ) : 0;
         concurrency.classes = params.isParallelClasses() ? params.getThreadCountClasses() : 0;
-        concurrency.methods = params.isParallelMethod() ? params.getThreadCountMethods() : 0;
-        concurrency.capacity = params.getThreadCount();
+        concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, concurrency.classes ) : 0;
+        concurrency.methods = params.isParallelMethods() ? params.getThreadCountMethods() : 0;
+        concurrency.methods = params.isParallelMethods() ? multiplyByCoreCount( params, concurrency.methods ) : 0;
+        concurrency.capacity = multiplyByCoreCount( params, params.getThreadCount() );
+
+        if ( counts != null )
+        {
+            concurrency.suites = (int) Math.min( Math.min( concurrency.suites, counts.suites ), Integer.MAX_VALUE );
+            concurrency.classes = (int) Math.min( Math.min( concurrency.classes, counts.classes ), Integer.MAX_VALUE );
+        }
 
         setLeafInfinite( params, concurrency );
-        concurrency.suites = params.isParallelSuites() ? multiplyByCoreCount( params, concurrency.suites ) : 0;
-        concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, concurrency.classes ) : 0;
-        concurrency.methods = params.isParallelMethod() ? multiplyByCoreCount( params, concurrency.methods ) : 0;
-        concurrency.capacity = multiplyByCoreCount( params, concurrency.capacity );
 
         return concurrency;
     }
@@ -247,7 +269,7 @@ final class ParallelComputerFactory
         Concurrency concurrency = new Concurrency();
         concurrency.suites = params.isParallelSuites() ? params.getThreadCountSuites() : 0;
         concurrency.classes = params.isParallelClasses() ? params.getThreadCountClasses() : 0;
-        concurrency.methods = params.isParallelMethod() ? params.getThreadCountMethods() : 0;
+        concurrency.methods = params.isParallelMethods() ? params.getThreadCountMethods() : 0;
         concurrency.capacity = params.getThreadCount();
         double all = sumThreadCounts( concurrency );
 
@@ -257,7 +279,7 @@ final class ParallelComputerFactory
         concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, concurrency.capacity * (
             concurrency.classes / all ) ) : 0;
 
-        concurrency.methods = params.isParallelMethod() ? multiplyByCoreCount( params, concurrency.capacity * (
+        concurrency.methods = params.isParallelMethods() ? multiplyByCoreCount( params, concurrency.capacity * (
             concurrency.methods / all ) ) : 0;
 
         concurrency.capacity = multiplyByCoreCount( params, concurrency.capacity );
@@ -270,7 +292,7 @@ final class ParallelComputerFactory
         Concurrency concurrency = new Concurrency();
         concurrency.suites = params.isParallelSuites() ? threadCountSuites( params ) : 0;
         concurrency.classes = params.isParallelClasses() ? threadCountClasses( params ) : 0;
-        concurrency.methods = params.isParallelMethod() ? threadCountMethods( params ) : 0;
+        concurrency.methods = params.isParallelMethods() ? threadCountMethods( params ) : 0;
         concurrency.capacity = (int) Math.min( sumThreadCounts( concurrency ), Integer.MAX_VALUE );
         return concurrency;
     }
@@ -288,7 +310,7 @@ final class ParallelComputerFactory
             count++;
         }
 
-        if ( params.isParallelMethod() )
+        if ( params.isParallelMethods() )
         {
             count++;
         }
@@ -297,7 +319,7 @@ final class ParallelComputerFactory
 
     private static void adjustPrecisionInLeaf( JUnitCoreParameters params, Concurrency concurrency )
     {
-        if ( params.isParallelMethod() )
+        if ( params.isParallelMethods() )
         {
             concurrency.methods = concurrency.capacity - concurrency.suites - concurrency.classes;
         }
@@ -309,7 +331,7 @@ final class ParallelComputerFactory
 
     private static void adjustLeaf( JUnitCoreParameters params, Concurrency concurrency )
     {
-        if ( params.isParallelMethod() )
+        if ( params.isParallelMethods() )
         {
             concurrency.methods = Integer.MAX_VALUE;
         }
@@ -321,7 +343,7 @@ final class ParallelComputerFactory
 
     private static void setLeafInfinite( JUnitCoreParameters params, Concurrency concurrency )
     {
-        if ( params.isParallelMethod() )
+        if ( params.isParallelMethods() )
         {
             concurrency.methods = Integer.MAX_VALUE;
         }
@@ -339,7 +361,7 @@ final class ParallelComputerFactory
     {
         int maskOfParallel = params.isParallelSuites() ? 4 : 0;
         maskOfParallel |= params.isParallelClasses() ? 2 : 0;
-        maskOfParallel |= params.isParallelMethod() ? 1 : 0;
+        maskOfParallel |= params.isParallelMethods() ? 1 : 0;
 
         int maskOfConcurrency = params.getThreadCountSuites() > 0 ? 4 : 0;
         maskOfConcurrency |= params.getThreadCountClasses() > 0 ? 2 : 0;
@@ -361,9 +383,9 @@ final class ParallelComputerFactory
 
     private static boolean hasThreadCounts( JUnitCoreParameters jUnitCoreParameters )
     {
-        return jUnitCoreParameters.getThreadCountSuites() > 0 ||
-            jUnitCoreParameters.getThreadCountClasses() > 0 ||
-            jUnitCoreParameters.getThreadCountMethods() > 0;
+        return jUnitCoreParameters.isParallelSuites() && jUnitCoreParameters.getThreadCountSuites() > 0 ||
+            jUnitCoreParameters.isParallelClasses() && jUnitCoreParameters.getThreadCountClasses() > 0 ||
+            jUnitCoreParameters.isParallelMethods() && jUnitCoreParameters.getThreadCountMethods() > 0;
     }
 
     private static boolean hasThreadCount( JUnitCoreParameters jUnitCoreParameters )

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilder.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilder.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilder.java
index 8e7f5b0..ca49561 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilder.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilder.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.junitcore.pc;
  * under the License.
  */
 
+import org.apache.maven.surefire.junitcore.JUnitCoreParameters;
 import org.junit.internal.runners.ErrorReportingRunner;
 import org.junit.runner.Description;
 import org.junit.runner.Runner;
@@ -33,7 +34,7 @@ import org.junit.runners.model.RunnerBuilder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
+import java.util.EnumMap;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -64,16 +65,20 @@ import java.util.concurrent.TimeUnit;
  * @author Tibor Digana (tibor17)
  * @since 2.16
  */
-public class ParallelComputerBuilder
+public final class ParallelComputerBuilder
 {
     static final int TOTAL_POOL_SIZE_UNDEFINED = 0;
 
-    private final Map<Type, Integer> parallelGroups = new HashMap<Type, Integer>( 3 );
+    private final Map<Type, Integer> parallelGroups = new EnumMap<Type, Integer>( Type.class );
 
     private boolean useSeparatePools;
 
     private int totalPoolSize;
 
+    private JUnitCoreParameters parameters;
+
+    private boolean optimize;
+
     /**
      * Calling {@link #useSeparatePools()}.
      */
@@ -85,6 +90,12 @@ public class ParallelComputerBuilder
         parallelGroups.put( Type.METHODS, 0 );
     }
 
+    public ParallelComputerBuilder( JUnitCoreParameters parameters )
+    {
+        this();
+        this.parameters = parameters;
+    }
+
     public ParallelComputerBuilder useSeparatePools()
     {
         totalPoolSize = TOTAL_POOL_SIZE_UNDEFINED;
@@ -116,6 +127,12 @@ public class ParallelComputerBuilder
         return this;
     }
 
+    public ParallelComputerBuilder optimize( boolean optimize )
+    {
+        this.optimize = optimize;
+        return this;
+    }
+
     public ParallelComputerBuilder parallelSuites()
     {
         return parallel( Type.SUITES );
@@ -203,12 +220,14 @@ public class ParallelComputerBuilder
 
         private final Map<Type, Integer> allGroups;
 
+        private long nestedClassesChildren;
+
         private volatile Scheduler master;
 
         private PC( long timeout, long timeoutForced, TimeUnit timeoutUnit )
         {
             super( timeout, timeoutForced, timeoutUnit );
-            allGroups = new HashMap<Type, Integer>( ParallelComputerBuilder.this.parallelGroups );
+            allGroups = new EnumMap<Type, Integer>( ParallelComputerBuilder.this.parallelGroups );
             poolCapacity = ParallelComputerBuilder.this.totalPoolSize;
             splitPool = ParallelComputerBuilder.this.useSeparatePools;
         }
@@ -226,7 +245,16 @@ public class ParallelComputerBuilder
         {
             super.getSuite( builder, cls );
             populateChildrenFromSuites();
-            return setSchedulers();
+
+            WrappedRunners suiteSuites = wrapRunners( suites );
+            WrappedRunners suiteClasses = wrapRunners( classes );
+
+            long suitesCount = suites.size();
+            long classesCount = classes.size() + nestedClasses.size();
+            long methodsCount = suiteClasses.embeddedChildrenCount + nestedClassesChildren;
+            tryOptimize( suitesCount, classesCount, methodsCount );
+
+            return setSchedulers( suiteSuites.wrappingSuite, suiteClasses.wrappingSuite );
         }
 
         @Override
@@ -252,28 +280,45 @@ public class ParallelComputerBuilder
             return runner;
         }
 
-        private <T extends Runner> ParentRunner wrapRunners( Collection<T> runners )
+        private void tryOptimize( long suites, long classes, long methods )
+        {
+            //todo remove statement, we will rely on single non-default constructor. Final class.
+            final JUnitCoreParameters parameters = ParallelComputerBuilder.this.parameters;
+            if ( ParallelComputerBuilder.this.optimize && parameters != null )
+            {
+                ;//todo
+            }
+        }
+
+        private <T extends Runner> WrappedRunners wrapRunners( Collection<T> runners )
             throws InitializationError
         {
+            long childrenCounter = 0;
             ArrayList<Runner> runs = new ArrayList<Runner>();
             for ( T runner : runners )
             {
-                if ( runner != null && hasChildren( runner ) )
+                if ( runner != null )
                 {
-                    runs.add( runner );
+                    int children = countChildren( runner );
+                    childrenCounter += children;
+                    if ( children != 0 )
+                    {
+                        runs.add( runner );
+                    }
                 }
             }
 
-            return runs.isEmpty() ? null : new Suite( null, runs )
+            Suite wrapper = runs.isEmpty() ? null : new Suite( null, runs )
             {
             };
+            return new WrappedRunners( wrapper, childrenCounter );
         }
 
-        private boolean hasChildren( Runner runner )
+        private int countChildren( Runner runner )
         {
             Description description = runner.getDescription();
             Collection children = description == null ? null : description.getChildren();
-            return children != null && !children.isEmpty();
+            return children == null ? 0 : children.size();
         }
 
         private ExecutorService createPool( int poolSize )
@@ -344,7 +389,7 @@ public class ParallelComputerBuilder
             }
         }
 
-        private Runner setSchedulers()
+        private Runner setSchedulers( ParentRunner suiteSuites, ParentRunner suiteClasses )
             throws InitializationError
         {
             int parallelSuites = allGroups.get( Type.SUITES );
@@ -354,7 +399,6 @@ public class ParallelComputerBuilder
             ExecutorService commonPool = splitPool || poolSize == 0 ? null : createPool( poolSize );
             master = createMaster( commonPool, poolSize );
 
-            ParentRunner suiteSuites = wrapRunners( suites );
             if ( suiteSuites != null )
             {
                 // a scheduler for parallel suites
@@ -370,7 +414,6 @@ public class ParallelComputerBuilder
             }
 
             // schedulers for parallel classes
-            ParentRunner suiteClasses = wrapRunners( classes );
             ArrayList<ParentRunner> allSuites = new ArrayList<ParentRunner>( suites );
             allSuites.addAll( nestedSuites );
             if ( suiteClasses != null )
@@ -507,7 +550,9 @@ public class ParallelComputerBuilder
                 }
                 else if ( child instanceof ParentRunner )
                 {
-                    nestedClasses.add( (ParentRunner) child );
+                    ParentRunner parentRunner = (ParentRunner) child;
+                    nestedClasses.add( parentRunner );
+                    nestedClassesChildren += parentRunner.getDescription().getChildren().size();
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/RunnerCounter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/RunnerCounter.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/RunnerCounter.java
new file mode 100644
index 0000000..48ef73a
--- /dev/null
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/RunnerCounter.java
@@ -0,0 +1,43 @@
+package org.apache.maven.surefire.junitcore.pc;
+
+/*
+ * 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.
+ */
+
+/**
+ * Counts number of JUnit suites, classes and methods.
+ *
+ * @author tibor17 (Tibor Digana)
+ * @see ParallelComputerBuilder
+ * @since 2.17
+ */
+final public class RunnerCounter//todo needs refactoring, remove public
+{
+    public final long suites;
+
+    public final long classes;
+
+    public final long methods;
+
+    RunnerCounter( long suites, long classes, long methods )
+    {
+        this.suites = suites;
+        this.classes = classes;
+        this.methods = methods;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/WrappedRunners.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/WrappedRunners.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/WrappedRunners.java
new file mode 100644
index 0000000..4550b5e
--- /dev/null
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/WrappedRunners.java
@@ -0,0 +1,46 @@
+package org.apache.maven.surefire.junitcore.pc;
+
+/*
+ * 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.
+ */
+
+import org.junit.runners.ParentRunner;
+
+/**
+ * We need to wrap runners in a suite and count children of these runners.
+ * <p/>
+ * Old JUnit versions do not cache children after the first call of
+ * {@link org.junit.runners.ParentRunner#getChildren()}.
+ * Due to performance reasons, the children have to be observed just once.
+ *
+ * @author tibor17 (Tibor Digana)
+ * @see ParallelComputerBuilder
+ * @since 2.17
+ */
+final class WrappedRunners
+{
+    final ParentRunner wrappingSuite;
+
+    final long embeddedChildrenCount;
+
+    WrappedRunners( ParentRunner wrappingSuite, long embeddedChildrenCount )
+    {
+        this.wrappingSuite = wrappingSuite;
+        this.embeddedChildrenCount = embeddedChildrenCount;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
index e100357..c73fa01 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
@@ -32,9 +32,9 @@ public class JUnitCoreParametersTest
     public void testIsParallelMethod()
         throws Exception
     {
-        assertFalse( getTestSetClasses().isParallelMethod() );
-        assertTrue( getTestSetMethods().isParallelMethod() );
-        assertTrue( getTestSetBoth().isParallelMethod() );
+        assertFalse( getTestSetClasses().isParallelMethods() );
+        assertTrue( getTestSetMethods().isParallelMethods() );
+        assertTrue( getTestSetBoth().isParallelMethods() );
     }
 
     public void testIsParallelClasses()
@@ -148,6 +148,6 @@ public class JUnitCoreParametersTest
 
     private boolean isParallelMethodsAndClasses( JUnitCoreParameters jUnitCoreParameters )
     {
-        return jUnitCoreParameters.isParallelMethod() && jUnitCoreParameters.isParallelClasses();
+        return jUnitCoreParameters.isParallelMethods() && jUnitCoreParameters.isParallelClasses();
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ParallelComputerFactoryTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ParallelComputerFactoryTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ParallelComputerFactoryTest.java
index c3682ae..6803265 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ParallelComputerFactoryTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ParallelComputerFactoryTest.java
@@ -89,7 +89,7 @@ public final class ParallelComputerFactoryTest
     {
         Properties properties = new Properties();
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( new JUnitCoreParameters( properties ) );
+        resolveConcurrency( new JUnitCoreParameters( properties ), null );
     }
 
     @Test
@@ -99,9 +99,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suites" ) );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -111,9 +111,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "classes" ) );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -123,9 +123,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "methods" ) );
         assertFalse( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -135,9 +135,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "both" ) );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -147,9 +147,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "all" ) );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -159,9 +159,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suitesAndClasses" ) );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -171,9 +171,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suitesAndMethods" ) );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Test
@@ -183,9 +183,9 @@ public final class ParallelComputerFactoryTest
         JUnitCoreParameters params = new JUnitCoreParameters( parallel( "classesAndMethods" ) );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         exception.expect( TestSetFailedException.class );
-        resolveConcurrency( params );
+        resolveConcurrency( params, null );
     }
 
     @Theory
@@ -197,10 +197,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suites" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -208,10 +208,10 @@ public final class ParallelComputerFactoryTest
 
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -227,10 +227,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classes" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -238,10 +238,10 @@ public final class ParallelComputerFactoryTest
 
         properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 5 * cpu ) );
@@ -257,10 +257,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "methods" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -268,10 +268,10 @@ public final class ParallelComputerFactoryTest
 
         properties.setProperty( THREADCOUNTMETHODS_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -287,10 +287,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -299,10 +299,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -318,10 +318,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndMethods" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -330,10 +330,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "15" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -349,10 +349,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classesAndMethods" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -361,10 +361,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "15" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 5 * cpu ) );
@@ -380,10 +380,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "all" );
         properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -393,10 +393,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "30" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -412,10 +412,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suites" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 0 ) );
         assertThat( concurrency.suites, is( 3 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -431,10 +431,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classes" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 0 ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 3 * cpu ) );
@@ -450,10 +450,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "methods" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 0 ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -469,10 +469,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "both" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( (int) ( ( 3d / 2 ) * cpu ) ) );
@@ -488,10 +488,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classesAndMethods" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( (int) ( ( 3d / 2 ) * cpu ) ) );
@@ -507,10 +507,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndMethods" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( (int) ( ( 3d / 2 ) * cpu ) ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -526,10 +526,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( (int) ( ( 3d / 2 ) * cpu ) ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -545,10 +545,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "all" );
         properties.setProperty( THREADCOUNT_KEY, "3" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( cpu ) );
         assertThat( concurrency.classes, is( cpu ) );
@@ -567,10 +567,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "34" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "66" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         int concurrentSuites = (int) ( 0.34d * concurrency.capacity );
         assertThat( concurrency.suites, is( concurrentSuites ) );
@@ -590,10 +590,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "34" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "66" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         int concurrentSuites = (int) ( 0.34d * concurrency.capacity );
         assertThat( concurrency.suites, is( concurrentSuites ) );
@@ -613,10 +613,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "34" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "66" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         int concurrentClasses = (int) ( 0.34d * concurrency.capacity );
@@ -637,10 +637,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "34" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "49" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 3 * cpu ) );
         int concurrentSuites = (int) ( 0.17d * concurrency.capacity );
         int concurrentClasses = (int) ( 0.34d * concurrency.capacity );
@@ -660,10 +660,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNT_KEY, "6" );
         properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 6 * cpu ) );
         assertThat( concurrency.suites, is( 2 * cpu ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -681,10 +681,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNT_KEY, "6" );
         properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 6 * cpu ) );
         assertThat( concurrency.suites, is( 2 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -702,10 +702,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNT_KEY, "6" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "2" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 6 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 2 * cpu ) );
@@ -724,10 +724,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "4" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 14 * cpu ) );
         assertThat( concurrency.suites, is( 2 * cpu ) );
         assertThat( concurrency.classes, is( 4 * cpu ) );
@@ -743,10 +743,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suites" );
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 5 * cpu ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -762,10 +762,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classes" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 5 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 5 * cpu ) );
@@ -781,10 +781,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "methods" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "5" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 5 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -802,10 +802,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 20 * cpu ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -817,10 +817,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertFalse( params.isParallelMethod() );
+        assertFalse( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
@@ -838,10 +838,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "15" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 20 * cpu ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -853,10 +853,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "suitesAndMethods" );
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertFalse( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 0 ) );
@@ -874,10 +874,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "15" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 20 * cpu ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 5 * cpu ) );
@@ -889,10 +889,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "classesAndMethods" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertFalse( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 0 ) );
         assertThat( concurrency.classes, is( 5 * cpu ) );
@@ -911,10 +911,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "30" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        Concurrency concurrency = resolveConcurrency( params );
+        Concurrency concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( 50 * cpu ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -927,10 +927,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( 5 * cpu ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -940,10 +940,10 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "all" );
         properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
         params = new JUnitCoreParameters( properties );
-        concurrency = resolveConcurrency( params );
+        concurrency = resolveConcurrency( params, null );
         assertTrue( params.isParallelSuites() );
         assertTrue( params.isParallelClasses() );
-        assertTrue( params.isParallelMethod() );
+        assertTrue( params.isParallelMethods() );
         assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
         assertThat( concurrency.classes, is( 15 * cpu ) );
@@ -958,7 +958,7 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( PARALLEL_KEY, "methods" );
         properties.setProperty( THREADCOUNTMETHODS_KEY, "2" );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        ParallelComputer pc = createParallelComputer( params );
+        ParallelComputer pc = createParallelComputer( params, null );
 
         Result result = new JUnitCore().run( pc, TestClass.class );
         long timeSpent = runtime.stop();
@@ -982,7 +982,7 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTMETHODS_KEY, "2" );
         properties.setProperty( PARALLEL_TIMEOUT_KEY, Double.toString( 2.5d ) );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        ParallelComputer pc = createParallelComputer( params );
+        ParallelComputer pc = createParallelComputer( params, null );
 
         new JUnitCore().run( pc, TestClass.class );
         long timeSpent = runtime.stop();
@@ -1004,7 +1004,7 @@ public final class ParallelComputerFactoryTest
         properties.setProperty( THREADCOUNTMETHODS_KEY, "2" );
         properties.setProperty( PARALLEL_TIMEOUTFORCED_KEY, Double.toString( 2.5d ) );
         JUnitCoreParameters params = new JUnitCoreParameters( properties );
-        ParallelComputer pc = createParallelComputer( params );
+        ParallelComputer pc = createParallelComputer( params, null );
 
         new JUnitCore().run( pc, TestClass.class );
         long timeSpent = runtime.stop();

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/eaeaa28d/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
index ab312af..3fee3df 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
@@ -162,7 +162,7 @@ public class Surefire746Test
             throws Exception
         {
             throw new RuntimeException(
-                "This Exception will cause Surefire to receive a internal JUnit Description and fail" );
+                "This Exception will cause Surefire to receive an internal JUnit Description and fail." );
         }
     }
 }
\ No newline at end of file


Mime
View raw message