public class ParallelComputerBuilder extends Object
ParallelComputerBuilder builder = new ParallelComputerBuilder(); builder.useOnePool(8).parallelSuites(2).parallelClasses(4).parallelMethods(); ParallelComputerBuilder.ParallelComputer computer = builder.buildComputer(); Class>[] tests = {...}; new JUnitCore().run(computer, tests);Note that the type has always at least one thread even if unspecified. The capacity in
useOnePool(int)
must be greater than the number of concurrent suites and classes altogether.
The Computer can be shutdown in a separate thread. Pending tests will be interrupted if the argument is true.
computer.shutdown(true);
Constructor and Description |
---|
ParallelComputerBuilder()
Calling
useSeparatePools() . |
Modifier and Type | Method and Description |
---|---|
ParallelComputer |
buildComputer() |
ParallelComputerBuilder |
parallelClasses() |
ParallelComputerBuilder |
parallelClasses(int nThreads) |
ParallelComputerBuilder |
parallelMethods() |
ParallelComputerBuilder |
parallelMethods(int nThreads) |
ParallelComputerBuilder |
parallelSuites() |
ParallelComputerBuilder |
parallelSuites(int nThreads) |
ParallelComputerBuilder |
useOnePool() |
ParallelComputerBuilder |
useOnePool(int totalPoolSize) |
ParallelComputerBuilder |
useSeparatePools() |
public ParallelComputerBuilder()
useSeparatePools()
.public ParallelComputerBuilder useSeparatePools()
public ParallelComputerBuilder useOnePool()
public ParallelComputerBuilder useOnePool(int totalPoolSize)
totalPoolSize
- Pool size where suites, classes and methods are executed in parallel.
If the totalPoolSize is Integer.MAX_VALUE
, the pool capacity is not limited.IllegalArgumentException
- If totalPoolSize is < 1.public ParallelComputerBuilder parallelSuites()
public ParallelComputerBuilder parallelSuites(int nThreads)
public ParallelComputerBuilder parallelClasses()
public ParallelComputerBuilder parallelClasses(int nThreads)
public ParallelComputerBuilder parallelMethods()
public ParallelComputerBuilder parallelMethods(int nThreads)
public ParallelComputer buildComputer()
Copyright © 2004–2013 The Apache Software Foundation. All rights reserved.