Package org.junit.runner

Examples of org.junit.runner.RunnerSpy


import org.junit.runner.RunnerSpy;

public class RunnerBuilderStub extends RunnerBuilder {
    @Override
    public Runner runnerForClass(Class<?> testClass) throws Throwable {
        return new RunnerSpy(testClass, this);
    }
View Full Code Here


    @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

    @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

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

        RunnerSpy runnerSpy = (RunnerSpy) runner;
        assertThat(runnerSpy.getInvokedTestClass(), is(equalTo((Class) OuterClass.InnerClassWithoutOwnRunWith.MostInnerClass.class)));
    }
View Full Code Here

    @Test
    public void annotatedMemberClassInsideAnnotatedTopLevelClass_isRunWithOwnRunner() throws Exception {
        Runner runner = builder.runnerForClass(OuterClass.InnerClassWithOwnRunWith.class);
        assertThat(runner, is(instanceOf(InnerRunner.class)));

        RunnerSpy runnerSpy = (RunnerSpy) runner;
        assertThat(runnerSpy.getInvokedTestClass(), is(equalTo((Class) OuterClass.InnerClassWithOwnRunWith.class)));
    }
View Full Code Here

    @Test
    public void memberClassDeepInsideAnnotatedMemberClass_isRunWithParentMemberClassRunner() throws Exception {
        Runner runner = builder.runnerForClass(OuterClass.InnerClassWithOwnRunWith.MostInnerClass.class);
        assertThat(runner, is(instanceOf(InnerRunner.class)));

        RunnerSpy runnerSpy = (RunnerSpy) runner;
        assertThat(runnerSpy.getInvokedTestClass(), is(equalTo((Class) OuterClass.InnerClassWithOwnRunWith.MostInnerClass.class)));
    }
View Full Code Here

TOP

Related Classes of org.junit.runner.RunnerSpy

Copyright © 2018 www.massapicom. 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.