Search in sources :

Example 1 with SuiteMethodBuilder

use of org.junit.internal.builders.SuiteMethodBuilder in project intellij-community by JetBrains.

the class JUnit46ClassesRequestBuilder method collectWrappedRunners.

private static List collectWrappedRunners(Class[] classes) throws InitializationError {
    final List runners = new ArrayList();
    final List nonSuiteClasses = new ArrayList();
    final SuiteMethodBuilder suiteMethodBuilder = new SuiteMethodBuilder();
    for (int i = 0, length = classes.length; i < length; i++) {
        Class aClass = classes[i];
        if (suiteMethodBuilder.hasSuiteMethod(aClass)) {
            try {
                runners.add(new ClassAwareSuiteMethod(aClass));
            } catch (Throwable throwable) {
                runners.add(new ErrorReportingRunner(aClass, throwable));
            }
        } else {
            nonSuiteClasses.add(aClass);
        }
    }
    runners.addAll(new AllDefaultPossibilitiesBuilder(false).runners(null, (Class[]) nonSuiteClasses.toArray(new Class[nonSuiteClasses.size()])));
    return runners;
}
Also used : SuiteMethodBuilder(org.junit.internal.builders.SuiteMethodBuilder) AllDefaultPossibilitiesBuilder(org.junit.internal.builders.AllDefaultPossibilitiesBuilder) ErrorReportingRunner(org.junit.internal.runners.ErrorReportingRunner)

Aggregations

AllDefaultPossibilitiesBuilder (org.junit.internal.builders.AllDefaultPossibilitiesBuilder)1 SuiteMethodBuilder (org.junit.internal.builders.SuiteMethodBuilder)1 ErrorReportingRunner (org.junit.internal.runners.ErrorReportingRunner)1