* @param testClass the Class under test
* @param policyApplied Identifies whether a test Policy identified by {@link TestPolicy} annotation has been applied or not
* @return an implementation of {@link RunnerScheduler}
*/
public static RunnerScheduler getScheduler(Class<?> testClass , Boolean policyApplied) {
Parallel parallelAnnotation = testClass.getAnnotation(Parallel.class);
String parallelThreadsStr = System.getProperty(SystemProperties.PARALLEL_THREAD_COUNT.getValue());
Integer parallelThreads = null;
if (parallelThreadsStr != null) {
parallelThreads = Integer.valueOf(parallelThreadsStr);
}
if (parallelThreads != null) {
if (parallelThreads <= 0) {
return new ParallelScheduler();
} else {
return new ParallelScheduler(parallelThreads);
}
} else {
if (parallelAnnotation != null) {
if (parallelAnnotation.threads() <= 0) {
return new ParallelScheduler();
} else {
return new ParallelScheduler(parallelAnnotation.threads());
}
}
}
if(policyApplied) {