Search in sources :

Example 1 with RobolectricTestRunner

use of org.robolectric.RobolectricTestRunner in project robolectric by robolectric.

the class FailureListener method runTests.

@Nonnull
public static List<Failure> runTests(Class<?> testClass) throws InitializationError {
    RunNotifier notifier = new RunNotifier();
    FailureListener failureListener = new FailureListener();
    notifier.addListener(failureListener);
    new RobolectricTestRunner(testClass).run(notifier);
    return failureListener.failures;
}
Also used : RunNotifier(org.junit.runner.notification.RunNotifier) RobolectricTestRunner(org.robolectric.RobolectricTestRunner) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 RunNotifier (org.junit.runner.notification.RunNotifier)1 RobolectricTestRunner (org.robolectric.RobolectricTestRunner)1