{
ParallelComputerFactory.overrideAvailableProcessors( cpu );
Properties properties = new Properties();
properties.setProperty( PARALLEL_KEY, "suites" );
properties.setProperty( USEUNLIMITEDTHREADS_KEY, "true" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
Concurrency concurrency = resolveConcurrency( params );
assertTrue( params.isParallelSuites() );
assertFalse( params.isParallelClasses() );
assertFalse( params.isParallelMethod() );
assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
assertThat( concurrency.classes, is( 0 ) );
assertThat( concurrency.methods, is( 0 ) );
properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
params = new JUnitCoreParameters( properties );
concurrency = resolveConcurrency( params );
assertTrue( params.isParallelSuites() );
assertFalse( params.isParallelClasses() );
assertFalse( params.isParallelMethod() );
assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
assertThat( concurrency.suites, is( 5 * cpu ) );
assertThat( concurrency.classes, is( 0 ) );
assertThat( concurrency.methods, is( 0 ) );
}