new ArrayBlockingQueue<Runnable>( forkCount ) );
try
{
// Ask to the executorService to run all tasks
RunResult globalResult = new RunResult( 0, 0, 0, 0 );
List<Class<?>> suites = new ArrayList<Class<?>>();
Iterator<Class<?>> suitesIterator = getSuitesIterator();
while ( suitesIterator.hasNext() )
{
suites.add( suitesIterator.next() );
}
final Queue<String> messageQueue = new ConcurrentLinkedQueue<String>();
for ( Class<?> clazz : suites )
{
messageQueue.add( clazz.getName() );
}
for ( int forkNum = 0; forkNum < forkCount && forkNum < suites.size(); forkNum++ )
{
Callable<RunResult> pf = new Callable<RunResult>()
{
public RunResult call()
throws Exception
{
TestProvidingInputStream testProvidingInputStream =
new TestProvidingInputStream( messageQueue );
DefaultReporterFactory forkedReporterFactory =
new DefaultReporterFactory( startupReportConfiguration );
defaultReporterFactoryList.add( forkedReporterFactory );
ForkClient forkClient = new ForkClient( forkedReporterFactory,
startupReportConfiguration.getTestVmSystemProperties(),
testProvidingInputStream );
return fork( null, new PropertiesWrapper( providerConfiguration.getProviderProperties() ),
forkClient, effectiveSystemProperties, testProvidingInputStream );
}
};
results.add( executorService.submit( pf ) );
}
for ( Future<RunResult> result : results )
{
try
{
RunResult cur = result.get();
if ( cur != null )
{
globalResult = globalResult.aggregate( cur );
}
else