Package org.junit.runners

Examples of org.junit.runners.BlockJUnit4ClassRunner


        assertTrue(problems.isEmpty());
    }

    private List<Throwable> validateAllMethods(Class<?> clazz) {
        try {
            new BlockJUnit4ClassRunner(clazz);
        } catch (InitializationError e) {
            return e.getCauses();
        }
        return Collections.emptyList();
    }
View Full Code Here


        }
    }

    @Test(expected = InitializationError.class)
    public void overloaded() throws InitializationError {
        new BlockJUnit4ClassRunner(Confused.class);
    }
View Full Code Here

        }
    }

    @Test(expected = InitializationError.class)
    public void constructorParameter() throws InitializationError {
        new BlockJUnit4ClassRunner(ConstructorParameter.class);
    }
View Full Code Here

    @Test
    public void categoryFilterLeavesOnlyMatchingMethods()
            throws InitializationError, NoTestsRemainException {
        CategoryFilter filter = CategoryFilter.include(SlowTests.class);
        BlockJUnit4ClassRunner runner = new BlockJUnit4ClassRunner(A.class);
        filter.apply(runner);
        assertEquals(1, runner.testCount());
    }
View Full Code Here

    @Test
    public void categoryFilterRejectsIncompatibleCategory()
            throws InitializationError, NoTestsRemainException {
        CategoryFilter filter = CategoryFilter.include(SlowTests.class);
        BlockJUnit4ClassRunner runner = new BlockJUnit4ClassRunner(
                OneFastOneSlow.class);
        filter.apply(runner);
        assertEquals(1, runner.testCount());
    }
View Full Code Here

    }

    @Test
    public void detectNonStaticEnclosedClass() throws Exception {
        try {
            new BlockJUnit4ClassRunner(OuterClass.Enclosed.class);
        } catch (InitializationError e) {
            List<Throwable> causes = e.getCauses();
            assertEquals("Wrong number of causes.", 1, causes.size());
            assertEquals(
                    "Wrong exception.",
View Full Code Here

                {SubShadows.class, 0}});
    }

    private List<Throwable> validateAllMethods(Class<?> clazz) {
        try {
            new BlockJUnit4ClassRunner(clazz);
        } catch (InitializationError e) {
            return e.getCauses();
        }
        return Collections.emptyList();
    }
View Full Code Here

    }

    @Test
    public void useChildHarvester() throws InitializationError {
        log = "";
        ParentRunner<?> runner = new BlockJUnit4ClassRunner(FruitTest.class);
        runner.setScheduler(new RunnerScheduler() {
            public void schedule(Runnable childStatement) {
                log += "before ";
                childStatement.run();
                log += "after ";
            }

            public void finished() {
                log += "afterAll ";
            }
        });

        runner.run(new RunNotifier());
        assertEquals("before apple after before banana after afterAll ", log);
    }
View Full Code Here

    private CountingRunListener runTestWithParentRunner(Class<?> testClass) throws InitializationError {
        CountingRunListener listener = new CountingRunListener();
        RunNotifier runNotifier = new RunNotifier();
        runNotifier.addListener(listener);
        ParentRunner runner = new BlockJUnit4ClassRunner(testClass);
        runner.run(runNotifier);
        return listener;
    }
View Full Code Here

            }
        }

        protected void runWithCompleteAssignment(final Assignments complete)
                throws Throwable {
            new BlockJUnit4ClassRunner(getTestClass().getJavaClass()) {
                @Override
                protected void collectInitializationErrors(
                        List<Throwable> errors) {
                    // do nothing
                }
View Full Code Here

TOP

Related Classes of org.junit.runners.BlockJUnit4ClassRunner

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.