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

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

public final class ParallelComputerBuilder
extends Object

Executing suites, classes and methods with defined concurrency. In this example the threads which completed the suites and classes can be reused in parallel methods.

 JUnitCoreParameters parameters = ...;
 ParallelComputerBuilder builder = new ParallelComputerBuilder(parameters);
 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 stopped in a separate thread. Pending tests will be interrupted if the argument is true.

 computer.describeStopped(true);
 

Since:
2.16
Author:
Tibor Digana (tibor17)

Constructor Summary
ParallelComputerBuilder(ConsoleLogger logger, JUnitCoreParameters parameters)
           
 
Method Summary
 ParallelComputer buildComputer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelComputerBuilder

public ParallelComputerBuilder(ConsoleLogger logger,
                               JUnitCoreParameters parameters)
Method Detail

buildComputer

public ParallelComputer buildComputer()


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