Examples of Runner


Examples of org.junit.runner.Runner

                .getFailures().get(0).getTestHeader());
    }

    @Test
    public void countBeforeRunWithParameterizedField() throws Exception {
        Runner runner = Request.aClass(FibonacciWithParameterizedFieldTest.class).getRunner();
        assertEquals(7, runner.testCount());
    }
View Full Code Here

Examples of org.junit.runner.Runner

        assertEquals(7, runner.testCount());
    }

    @Test
    public void plansNamedCorrectlyWithParameterizedField() throws Exception {
        Runner runner = Request.aClass(FibonacciWithParameterizedFieldTest.class).getRunner();
        Description description = runner.getDescription();
        assertEquals("[0]", description.getChildren().get(0).getDisplayName());
    }
View Full Code Here

Examples of org.junit.runner.Runner

                new TestClass(method.getDeclaringClass()))
                .potentialsForNextUnassigned();
    }
   
    public static Result runTheoryClass(Class<?> testClass) throws InitializationError {
        Runner theoryRunner = new Theories(testClass);
        Request request = Request.runner(theoryRunner);
        return new JUnitCore().run(request);
    }
View Full Code Here

Examples of org.junit.runner.Runner

    }

    @Test
    public void oneTimeSetup() throws Exception {
        count = 0;
        Runner runner = Request.method(OneTimeSetup.class, "one").getRunner();
        Result result = new JUnitCore().run(runner);

        assertEquals(1, count);
        assertEquals(1, result.getRunCount());
    }
View Full Code Here

Examples of org.junit.runner.Runner

    }

    @Test
    public void parameterizedFilterToSingleMethod() throws Exception {
        count = 0;
        Runner runner = Request.method(ParameterizedOneTimeSetup.class,
                "one[0]").getRunner();
        Result result = new JUnitCore().run(runner);

        assertEquals(1, result.getRunCount());
    }
View Full Code Here

Examples of org.junit.runner.Runner

        assertEquals(1, count);
    }

    @Test
    public void filteringAffectsPlan() throws Exception {
        Runner runner = Request.method(OneTimeSetup.class, "one").getRunner();
        assertEquals(1, runner.testCount());
    }
View Full Code Here

Examples of org.junit.runner.Runner

    public static class OneTwoSuite {
    }

    @Test
    public void eliminateUnnecessaryTreeBranches() throws Exception {
        Runner runner = Request.aClass(OneTwoSuite.class).filterWith(
                Description.createTestDescription(TestOne.class, "a"))
                .getRunner();
        Description description = runner.getDescription();
        assertEquals(1, description.getChildren().size());
    }
View Full Code Here

Examples of org.junit.runner.Runner

public class AnnotatedBuilderTest {
    private AnnotatedBuilder builder = new AnnotatedBuilder(new RunnerBuilderStub());

    @Test
    public void topLevelTestClassWithoutAnnotation_isRunWithDefaultRunner() throws Exception {
        Runner runner = builder.runnerForClass(Object.class);
        assertThat(runner, is(nullValue()));
    }
View Full Code Here

Examples of org.junit.runner.Runner

        assertThat(runner, is(nullValue()));
    }

    @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(equalTo((Class) OuterClass.class)));
    }
View Full Code Here

Examples of org.junit.runner.Runner

        assertThat(runnerSpy.getInvokedTestClass(), is(equalTo((Class) OuterClass.class)));
    }

    @Test
    public void memberClassInsideAnnotatedTopLevelClass_isRunWithTopLevelRunner() throws Exception {
        Runner runner = builder.runnerForClass(OuterClass.InnerClassWithoutOwnRunWith.class);
        assertThat(runner, is(instanceOf(RunnerSpy.class)));

        RunnerSpy runnerSpy = (RunnerSpy) runner;
        assertThat(runnerSpy.getInvokedTestClass(), is(equalTo((Class) OuterClass.InnerClassWithoutOwnRunWith.class)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.