|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.surefire.junitcore.pc.Scheduler
public class Scheduler
Schedules tests, controls thread resources, awaiting tests and other schedulers finished, and a master scheduler can shutdown slaves.
The scheduler objects should be first created (and wired) and set in runnersParentRunner.setScheduler(org.junit.runners.model.RunnerScheduler).
A new instance of scheduling strategy should be passed to the constructor of this scheduler.
| Nested Class Summary | |
|---|---|
class |
Scheduler.ShutdownHandler
There is a way to shutdown the hierarchy of schedulers. |
| Constructor Summary | |
|---|---|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy)
Should be used with individual pools on suites, classes and methods, see ParallelComputerBuilder.useSeparatePools(). |
|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy,
Balancer balancer)
Can be used by e.g. |
|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy,
int concurrency)
|
|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy)
Use e.g. |
|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy,
Balancer balancer)
New instances should be used by schedulers with limited concurrency by balancer against other groups of schedulers. |
|
Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy,
int concurrency)
Should be used if schedulers in parallel children and parent use one instance of bounded thread pool. |
|
| Method Summary | |
|---|---|
protected void |
afterExecute()
|
protected void |
beforeExecute()
|
protected ShutdownResult |
describeStopped(boolean stopNow)
Attempts to stop all actively executing tasks and immediately returns a collection of descriptions of those tasks which have started prior to this call. |
void |
finished()
|
protected void |
logQuietly(String msg)
|
protected void |
logQuietly(Throwable t)
|
protected Scheduler.ShutdownHandler |
newShutdownHandler()
|
void |
schedule(Runnable childStatement)
|
protected boolean |
shutdownThreadPoolsAwaitingKilled()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy)
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy,
int concurrency)
Scheduler(ConsoleLogger, org.junit.runner.Description, Scheduler, SchedulingStrategy)
or Scheduler(ConsoleLogger, org.junit.runner.Description, Scheduler, SchedulingStrategy, int).
logger - current logger implementationdescription - description of current runnerstrategy - scheduling strategy with a shared thread poolconcurrency - determines maximum concurrent children scheduled a time via schedule(Runnable)
NullPointerException - if null strategy
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
SchedulingStrategy strategy,
Balancer balancer)
Scheduler(ConsoleLogger, org.junit.runner.Description, SchedulingStrategy, int) which was
limiting the concurrency of children of a runner where this scheduler was set, this
balancer is limiting the concurrency of all children in runners having schedulers created by this
constructor.
logger - current logger implementationdescription - description of current runnerstrategy - scheduling strategy which may share threads with other strategybalancer - determines maximum concurrent children scheduled a time via schedule(Runnable)
NullPointerException - if null strategy or balancer
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy,
Balancer balancer)
logger - current logger implementationdescription - description of current runnermasterScheduler - scheduler sharing own threads with this slavestrategy - scheduling strategy for this schedulerbalancer - determines maximum concurrent children scheduled a time via schedule(Runnable)
NullPointerException - if null masterScheduler, strategy or balancer
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy,
int concurrency)
masterScheduler - a reference to
Scheduler(ConsoleLogger, org.junit.runner.Description, SchedulingStrategy, int)
or Scheduler(ConsoleLogger, org.junit.runner.Description, SchedulingStrategy)Scheduler(ConsoleLogger, org.junit.runner.Description, SchedulingStrategy),
Scheduler(ConsoleLogger, org.junit.runner.Description, SchedulingStrategy, int)
public Scheduler(ConsoleLogger logger,
org.junit.runner.Description description,
Scheduler masterScheduler,
SchedulingStrategy strategy)
ParallelComputerBuilder.useSeparatePools().
Cached thread pool is infinite and can be always shared.
| Method Detail |
|---|
protected void logQuietly(Throwable t)
protected void logQuietly(String msg)
protected ShutdownResult describeStopped(boolean stopNow)
register(Scheduler).
If shutdownNow is set, waiting methods will be interrupted via Thread.interrupt().
stopNow - if true interrupts waiting test methods
protected boolean shutdownThreadPoolsAwaitingKilled()
protected void beforeExecute()
protected void afterExecute()
public void schedule(Runnable childStatement)
schedule in interface org.junit.runners.model.RunnerSchedulerpublic void finished()
finished in interface org.junit.runners.model.RunnerSchedulerprotected Scheduler.ShutdownHandler newShutdownHandler()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||