new ThreadPoolExecutor( forkCount, forkCount, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>() );
try
{
// Ask to the executorService to run all tasks
RunResult globalResult = new RunResult( 0, 0, 0, 0 );
final Iterator<Class<?>> suites = getSuitesIterator();
while ( suites.hasNext() )
{
final Object testSet = suites.next();
Callable<RunResult> pf = new Callable<RunResult>()
{
public RunResult call()
throws Exception
{
int thisThreadsThreadNumber = threadNumber.get();
if ( thisThreadsThreadNumber > forkCount )
{
// this would be a bug in the ThreadPoolExecutor
throw new IllegalStateException(
"More threads than " + forkCount + " have been created by the ThreadPoolExecutor." );
}
ForkClient forkClient = new ForkClient( defaultReporterFactory,
startupReportConfiguration.getTestVmSystemProperties() );
return fork( testSet, new PropertiesWrapper( providerConfiguration.getProviderProperties() ),
forkClient, effectiveSystemProperties, thisThreadsThreadNumber, null );
}
};
results.add( executorService.submit( pf ) );
}
for ( Future<RunResult> result : results )
{
try
{
RunResult cur = result.get();
if ( cur != null )
{
globalResult = globalResult.aggregate( cur );
}
else