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