Search in sources :

Example 71 with Runner

use of org.junit.runner.Runner in project junit4 by junit-team.

the class AnnotatedBuilderTest method topLevelTestClassWithAnnotation_isRunWithAnnotatedRunner.

@Test
public void topLevelTestClassWithAnnotation_isRunWithAnnotatedRunner() throws Exception {
    Runner runner = builder.runnerForClass(OuterClass.class);
    assertThat(runner, is(instanceOf(RunnerSpy.class)));
    RunnerSpy runnerSpy = (RunnerSpy) runner;
    assertThat(runnerSpy.getInvokedTestClass(), is((Object) OuterClass.class));
}
Also used : Runner(org.junit.runner.Runner) RunnerSpy(org.junit.runner.RunnerSpy) Test(org.junit.Test)

Example 72 with Runner

use of org.junit.runner.Runner in project junit4 by junit-team.

the class SortingRequest method getRunner.

@Override
public Runner getRunner() {
    Runner runner = request.getRunner();
    new Sorter(comparator).apply(runner);
    return runner;
}
Also used : Runner(org.junit.runner.Runner) Sorter(org.junit.runner.manipulation.Sorter)

Example 73 with Runner

use of org.junit.runner.Runner in project junit4 by junit-team.

the class EnclosedTest method enclosedRunnerPlansConcreteEnclosedClasses.

@Test
public void enclosedRunnerPlansConcreteEnclosedClasses() throws Exception {
    Runner runner = Request.aClass(Enclosing.class).getRunner();
    assertEquals(5, runner.testCount());
}
Also used : Runner(org.junit.runner.Runner) Test(org.junit.Test)

Example 74 with Runner

use of org.junit.runner.Runner in project junit4 by junit-team.

the class ParameterizedTestTest method countBeforeRun.

@Test
public void countBeforeRun() throws Exception {
    Runner runner = Request.aClass(AdditionTest.class).getRunner();
    assertEquals(4, runner.testCount());
}
Also used : Runner(org.junit.runner.Runner) Test(org.junit.Test)

Example 75 with Runner

use of org.junit.runner.Runner in project junit4 by junit-team.

the class ParameterizedTestTest method usesIndexAsTestName.

@Test
public void usesIndexAsTestName() {
    Runner runner = Request.aClass(ParameterizedWithoutSpecialTestname.class).getRunner();
    Description description = runner.getDescription();
    assertEquals("[1]", description.getChildren().get(1).getDisplayName());
}
Also used : Runner(org.junit.runner.Runner) Description(org.junit.runner.Description) Test(org.junit.Test)

Aggregations

Runner (org.junit.runner.Runner)106 Test (org.junit.Test)39 RunNotifier (org.junit.runner.notification.RunNotifier)22 ArrayList (java.util.ArrayList)18 Description (org.junit.runner.Description)18 JUnitCore (org.junit.runner.JUnitCore)18 ParentRunner (org.junit.runners.ParentRunner)16 Request (org.junit.runner.Request)15 Result (org.junit.runner.Result)13 Filter (org.junit.runner.manipulation.Filter)12 NoTestsRemainException (org.junit.runner.manipulation.NoTestsRemainException)12 InitializationError (org.junit.runners.model.InitializationError)10 Method (java.lang.reflect.Method)9 JUnit4ParameterizedTest (androidx.test.testing.fixtures.JUnit4ParameterizedTest)7 SuiteConfiguration (org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration)7 Failure (org.junit.runner.notification.Failure)7 ErrorReportingRunner (org.junit.internal.runners.ErrorReportingRunner)6 Filterable (org.junit.runner.manipulation.Filterable)6 BlockJUnit4ClassRunner (org.junit.runners.BlockJUnit4ClassRunner)6 Field (java.lang.reflect.Field)5