Class ParallelComputerBuilder.PC
- java.lang.Object
-
- org.junit.runner.Computer
-
- org.apache.maven.surefire.junitcore.pc.ParallelComputer
-
- org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder.PC
-
- Enclosing class:
- ParallelComputerBuilder
final class ParallelComputerBuilder.PC extends ParallelComputer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ParallelComputerBuilder.PC.SuiteFilter
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Type,java.lang.Integer>
allGroups
private java.util.Collection<org.junit.runners.ParentRunner>
classes
private Scheduler
master
private java.util.Collection<org.junit.runners.ParentRunner>
nestedClasses
private long
nestedClassesChildren
private java.util.Collection<org.junit.runners.ParentRunner>
nestedSuites
private java.util.Collection<org.junit.runner.Runner>
notParallelRunners
private SingleThreadScheduler
notThreadSafeTests
private int
poolCapacity
private boolean
splitPool
private java.util.Collection<org.junit.runners.ParentRunner>
suites
-
Constructor Summary
Constructors Modifier Constructor Description private
PC()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
canSchedule(org.junit.runner.Runner runner)
private int
countChildren(org.junit.runner.Runner runner)
private int
countFinalRunners()
private org.junit.runners.ParentRunner
createFinalRunner(java.util.List<org.junit.runner.Runner> runners)
private Scheduler
createMaster(java.util.concurrent.ExecutorService pool, int poolSize)
private java.util.concurrent.ExecutorService
createPool(int poolSize)
private Scheduler
createScheduler(int poolSize)
private Scheduler
createScheduler(org.junit.runner.Description desc, java.util.concurrent.ExecutorService pool, boolean doParallel, Balancer concurrency)
protected ShutdownResult
describeStopped(boolean shutdownNow)
private void
determineThreadCounts(long suites, long classes, long methods)
(package private) java.util.Collection<org.junit.runners.ParentRunner>
getClasses()
(package private) java.util.Collection<org.junit.runners.ParentRunner>
getNestedClasses()
(package private) java.util.Collection<org.junit.runners.ParentRunner>
getNestedSuites()
(package private) java.util.Collection<org.junit.runner.Runner>
getNotParallelRunners()
(package private) int
getPoolCapacity()
protected org.junit.runner.Runner
getRunner(org.junit.runners.model.RunnerBuilder builder, java.lang.Class<?> testClass)
org.junit.runner.Runner
getSuite(org.junit.runners.model.RunnerBuilder builder, java.lang.Class<?>[] cls)
(package private) java.util.Collection<org.junit.runners.ParentRunner>
getSuites()
(package private) boolean
isSplitPool()
private boolean
isThreadSafe(org.junit.runner.Runner runner)
private void
populateChildrenFromSuites()
private void
setSchedulers(java.lang.Iterable<? extends org.junit.runners.ParentRunner> runners, int poolSize, java.util.concurrent.ExecutorService commonPool)
private org.junit.runner.Runner
setSchedulers(org.junit.runners.ParentRunner suiteSuites, org.junit.runners.ParentRunner suiteClasses)
protected boolean
shutdownThreadPoolsAwaitingKilled()
private int
totalPoolSize()
private <T extends org.junit.runner.Runner>
WrappedRunnerswrapRunners(java.util.Collection<T> runners)
-
Methods inherited from class org.apache.maven.surefire.junitcore.pc.ParallelComputer
afterRunQuietly, beforeRunQuietly, describeElapsedTimeout
-
-
-
-
Field Detail
-
notThreadSafeTests
private final SingleThreadScheduler notThreadSafeTests
-
suites
private final java.util.Collection<org.junit.runners.ParentRunner> suites
-
nestedSuites
private final java.util.Collection<org.junit.runners.ParentRunner> nestedSuites
-
classes
private final java.util.Collection<org.junit.runners.ParentRunner> classes
-
nestedClasses
private final java.util.Collection<org.junit.runners.ParentRunner> nestedClasses
-
notParallelRunners
private final java.util.Collection<org.junit.runner.Runner> notParallelRunners
-
poolCapacity
private int poolCapacity
-
splitPool
private boolean splitPool
-
allGroups
private final java.util.Map<Type,java.lang.Integer> allGroups
-
nestedClassesChildren
private long nestedClassesChildren
-
master
private volatile Scheduler master
-
-
Method Detail
-
getSuites
java.util.Collection<org.junit.runners.ParentRunner> getSuites()
-
getNestedSuites
java.util.Collection<org.junit.runners.ParentRunner> getNestedSuites()
-
getClasses
java.util.Collection<org.junit.runners.ParentRunner> getClasses()
-
getNestedClasses
java.util.Collection<org.junit.runners.ParentRunner> getNestedClasses()
-
getNotParallelRunners
java.util.Collection<org.junit.runner.Runner> getNotParallelRunners()
-
getPoolCapacity
int getPoolCapacity()
-
isSplitPool
boolean isSplitPool()
-
describeStopped
protected ShutdownResult describeStopped(boolean shutdownNow)
- Specified by:
describeStopped
in classParallelComputer
-
shutdownThreadPoolsAwaitingKilled
protected boolean shutdownThreadPoolsAwaitingKilled()
- Specified by:
shutdownThreadPoolsAwaitingKilled
in classParallelComputer
-
getSuite
public org.junit.runner.Runner getSuite(org.junit.runners.model.RunnerBuilder builder, java.lang.Class<?>[] cls) throws org.junit.runners.model.InitializationError
- Overrides:
getSuite
in classorg.junit.runner.Computer
- Throws:
org.junit.runners.model.InitializationError
-
getRunner
protected org.junit.runner.Runner getRunner(org.junit.runners.model.RunnerBuilder builder, java.lang.Class<?> testClass) throws java.lang.Throwable
- Overrides:
getRunner
in classorg.junit.runner.Computer
- Throws:
java.lang.Throwable
-
determineThreadCounts
private void determineThreadCounts(long suites, long classes, long methods) throws TestSetFailedException
- Throws:
TestSetFailedException
-
wrapRunners
private <T extends org.junit.runner.Runner> WrappedRunners wrapRunners(java.util.Collection<T> runners) throws org.junit.runners.model.InitializationError
- Throws:
org.junit.runners.model.InitializationError
-
countChildren
private int countChildren(org.junit.runner.Runner runner)
-
createPool
private java.util.concurrent.ExecutorService createPool(int poolSize)
-
createMaster
private Scheduler createMaster(java.util.concurrent.ExecutorService pool, int poolSize)
-
countFinalRunners
private int countFinalRunners()
-
populateChildrenFromSuites
private void populateChildrenFromSuites()
-
totalPoolSize
private int totalPoolSize()
-
setSchedulers
private org.junit.runner.Runner setSchedulers(org.junit.runners.ParentRunner suiteSuites, org.junit.runners.ParentRunner suiteClasses) throws org.junit.runners.model.InitializationError
- Throws:
org.junit.runners.model.InitializationError
-
createFinalRunner
private org.junit.runners.ParentRunner createFinalRunner(java.util.List<org.junit.runner.Runner> runners) throws org.junit.runners.model.InitializationError
- Throws:
org.junit.runners.model.InitializationError
-
setSchedulers
private void setSchedulers(java.lang.Iterable<? extends org.junit.runners.ParentRunner> runners, int poolSize, java.util.concurrent.ExecutorService commonPool)
-
createScheduler
private Scheduler createScheduler(org.junit.runner.Description desc, java.util.concurrent.ExecutorService pool, boolean doParallel, Balancer concurrency)
-
createScheduler
private Scheduler createScheduler(int poolSize)
-
canSchedule
private boolean canSchedule(org.junit.runner.Runner runner)
-
isThreadSafe
private boolean isThreadSafe(org.junit.runner.Runner runner)
-
-