Class SchedulingStrategies
- java.lang.Object
-
- org.apache.maven.surefire.junitcore.pc.SchedulingStrategies
-
public class SchedulingStrategies extends java.lang.ObjectThe factory ofSchedulingStrategy.- Since:
- 2.16
- Author:
- Tibor Digana (tibor17)
-
-
Constructor Summary
Constructors Constructor Description SchedulingStrategies()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SchedulingStrategycreateInvokerStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger)static SchedulingStrategycreateParallelSharedStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger, java.util.concurrent.ExecutorService threadPool)ThethreadPoolpassed to this strategy can be shared in other strategies.static SchedulingStrategycreateParallelStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger, int nThreads)static SchedulingStrategycreateParallelStrategyUnbounded(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger)
-
-
-
Method Detail
-
createInvokerStrategy
public static SchedulingStrategy createInvokerStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger)
- Parameters:
logger- current error logger- Returns:
- sequentially executing strategy
-
createParallelStrategy
public static SchedulingStrategy createParallelStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger, int nThreads)
- Parameters:
logger- current error loggernThreads- fixed pool capacity- Returns:
- parallel scheduling strategy
-
createParallelStrategyUnbounded
public static SchedulingStrategy createParallelStrategyUnbounded(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger)
- Parameters:
logger- current error logger- Returns:
- parallel scheduling strategy with unbounded capacity
-
createParallelSharedStrategy
public static SchedulingStrategy createParallelSharedStrategy(org.apache.maven.plugin.surefire.log.api.ConsoleLogger logger, java.util.concurrent.ExecutorService threadPool)
ThethreadPoolpassed to this strategy can be shared in other strategies.
The callSchedulingStrategy.finished()is waiting until own tasks have finished. New tasks will not be scheduled by this call in this strategy. This strategy is not waiting for other strategies to finish. TheRunnerScheduler.finished()may freely useSchedulingStrategy.finished().- Parameters:
logger- current error loggerthreadPool- thread pool possibly shared with other strategies- Returns:
- parallel strategy with shared thread pool
- Throws:
java.lang.NullPointerException- ifthreadPoolis null
-
-