use of com.hazelcast.test.annotation.ConfigureParallelRunnerWith in project hazelcast by hazelcast.
the class HazelcastParallelClassRunner method getMaxThreads.
private int getMaxThreads(Class<?> clazz) throws InitializationError {
if (!SPAWN_MULTIPLE_THREADS) {
return 1;
}
ConfigureParallelRunnerWith annotation = clazz.getAnnotation(ConfigureParallelRunnerWith.class);
if (annotation != null) {
try {
Class<? extends ParallelRunnerOptions> optionsClass = annotation.value();
Constructor constructor = optionsClass.getConstructor();
ParallelRunnerOptions parallelRunnerOptions = (ParallelRunnerOptions) constructor.newInstance();
return parallelRunnerOptions.maxParallelTests();
} catch (Exception e) {
throw new InitializationError(e);
}
} else {
return DEFAULT_MAX_THREADS;
}
}
Aggregations