Search in sources :

Example 1 with TestSuiteExecutionException

use of org.gradle.api.internal.tasks.testing.TestSuiteExecutionException in project gradle by gradle.

the class IgnoredTestDescriptorProvider method getAllDescriptions.

List<Description> getAllDescriptions(Description description, String className) {
    final AllExceptIgnoredTestRunnerBuilder allExceptIgnoredTestRunnerBuilder = new AllExceptIgnoredTestRunnerBuilder();
    try {
        final Class<?> testClass = description.getClass().getClassLoader().loadClass(className);
        Runner runner = allExceptIgnoredTestRunnerBuilder.runnerForClass(testClass);
        if (runner == null) {
            //fall back to default runner
            runner = Request.aClass(testClass).getRunner();
        }
        final Description runnerDescription = runner.getDescription();
        return runnerDescription.getChildren();
    } catch (Throwable throwable) {
        throw new TestSuiteExecutionException(String.format("Unable to process Ignored class %s.", className), throwable);
    }
}
Also used : Runner(org.junit.runner.Runner) Description(org.junit.runner.Description) TestSuiteExecutionException(org.gradle.api.internal.tasks.testing.TestSuiteExecutionException)

Aggregations

TestSuiteExecutionException (org.gradle.api.internal.tasks.testing.TestSuiteExecutionException)1 Description (org.junit.runner.Description)1 Runner (org.junit.runner.Runner)1