properties.setProperty( PARALLEL_KEY, "all" );
properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
properties.setProperty( THREADCOUNTMETHODS_KEY, "30" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
Concurrency concurrency = resolveConcurrency( params );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertTrue( params.isParallelMethod() );
assertThat( concurrency.capacity, is( 50 * cpu ) );
assertThat( concurrency.suites, is( 5 * cpu ) );
assertThat( concurrency.classes, is( 15 * cpu ) );
assertThat( concurrency.methods, is( 30 * cpu ) );
// Warning: these cases work but they are not enabled in AbstractSurefireMojo
// Instead use the 'useUnlimitedThreads' parameter.
properties = new Properties();
properties.setProperty( PARALLEL_KEY, "all" );
properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
params = new JUnitCoreParameters( properties );
concurrency = resolveConcurrency( params );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertTrue( params.isParallelMethod() );
assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
assertThat( concurrency.suites, is( 5 * cpu ) );
assertThat( concurrency.classes, is( 15 * cpu ) );
assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
properties = new Properties();
properties.setProperty( PARALLEL_KEY, "all" );
properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
params = new JUnitCoreParameters( properties );
concurrency = resolveConcurrency( params );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertTrue( params.isParallelMethod() );
assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
assertThat( concurrency.suites, is( Integer.MAX_VALUE ) );
assertThat( concurrency.classes, is( 15 * cpu ) );
assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
}