org.apache.maven.surefire.junitcore.pc
Class SchedulingStrategies

java.lang.Object
  extended by org.apache.maven.surefire.junitcore.pc.SchedulingStrategies

public class SchedulingStrategies
extends Object

The factory of SchedulingStrategy.

Since:
2.16
Author:
Tibor Digana (tibor17)

Constructor Summary
SchedulingStrategies()
           
 
Method Summary
static SchedulingStrategy createInvokerStrategy(ConsoleLogger logger)
           
static SchedulingStrategy createParallelSharedStrategy(ConsoleLogger logger, ExecutorService threadPool)
          The threadPool passed to this strategy can be shared in other strategies.
static SchedulingStrategy createParallelStrategy(ConsoleLogger logger, int nThreads)
           
static SchedulingStrategy createParallelStrategyUnbounded(ConsoleLogger logger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulingStrategies

public SchedulingStrategies()
Method Detail

createInvokerStrategy

public static SchedulingStrategy createInvokerStrategy(ConsoleLogger logger)
Parameters:
logger - current error logger
Returns:
sequentially executing strategy

createParallelStrategy

public static SchedulingStrategy createParallelStrategy(ConsoleLogger logger,
                                                        int nThreads)
Parameters:
logger - current error logger
nThreads - fixed pool capacity
Returns:
parallel scheduling strategy

createParallelStrategyUnbounded

public static SchedulingStrategy createParallelStrategyUnbounded(ConsoleLogger logger)
Parameters:
logger - current error logger
Returns:
parallel scheduling strategy with unbounded capacity

createParallelSharedStrategy

public static SchedulingStrategy createParallelSharedStrategy(ConsoleLogger logger,
                                                              ExecutorService threadPool)
The threadPool passed to this strategy can be shared in other strategies.

The call SchedulingStrategy.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. The RunnerScheduler.finished() may freely use SchedulingStrategy.finished().

Parameters:
logger - current error logger
threadPool - thread pool possibly shared with other strategies
Returns:
parallel strategy with shared thread pool
Throws:
NullPointerException - if threadPool is null


Copyright © 2004–2014 The Apache Software Foundation. All rights reserved.