Properties properties = new Properties();
properties.setProperty( PARALLEL_KEY, "all" );
properties.setProperty( THREADCOUNT_KEY, "14" );
properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
properties.setProperty( THREADCOUNTCLASSES_KEY, "4" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 3, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
assertTrue( params.isParallelSuites() );
assertTrue( params.isParallelClasses() );
assertTrue( params.isParallelMethods() );
assertThat( concurrency.capacity, is( 14 * cpu ) );
assertThat( concurrency.suites, is( Math.min( 2 * cpu, 3 ) ) );
assertThat( concurrency.classes, is( Math.min( 4 * cpu, 5 ) ) );
assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
}