Properties properties = new Properties();
properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
Concurrency concurrency = resolveConcurrency( params, null );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertFalse( params.isParallelMethods() );
assertThat( concurrency.capacity, is( 20 * cpu ) );
assertThat( concurrency.suites, is( 5 * cpu ) );
assertThat( concurrency.classes, is( 15 * cpu ) );
assertThat( concurrency.methods, is( 0 ) );
// Warning: this case works but is not enabled in AbstractSurefireMojo
// Instead use the 'useUnlimitedThreads' parameter.
properties = new Properties();
properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
params = new JUnitCoreParameters( properties );
concurrency = resolveConcurrency( params, null );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertFalse( params.isParallelMethods() );
assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
assertThat( concurrency.suites, is( 5 * cpu ) );
assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
assertThat( concurrency.methods, is( 0 ) );
}