Examples of Runner


Examples of org.junit.runner.Runner

                fRunners.add(runner);
        }
       
        public void filter(Filter filter) throws NoTestsRemainException {
                for (Iterator<Runner> iter= fRunners.iterator(); iter.hasNext();) {
                        Runner runner= iter.next();
                        if (filter.shouldRun(runner.getDescription()))
                                filter.apply(runner);
                        else
                                iter.remove();
                }
        }
View Full Code Here

Examples of org.junit.runner.Runner

    @Test
    public void correctErrorFromMalformedTest() {
        Request request = Request.aClass(MalformedJUnit38TestMethod.class);
        JUnitCore core = new JUnitCore();
        Request sorted = fMax.sortRequest(request);
        Runner runner = sorted.getRunner();
        Result result = core.run(runner);
        Failure failure = result.getFailures().get(0);
        assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
        assertThat(failure.toString(), containsString("testNothing"));
        assertThat(failure.toString(), containsString("isn't public"));
View Full Code Here

Examples of org.junit.runner.Runner

    @Test
    public void correctErrorFromHalfMalformedTest() {
        Request request = Request.aClass(HalfMalformedJUnit38TestMethod.class);
        JUnitCore core = new JUnitCore();
        Request sorted = fMax.sortRequest(request);
        Runner runner = sorted.getRunner();
        Result result = core.run(runner);
        Failure failure = result.getFailures().get(0);
        assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
        assertThat(failure.toString(), containsString("testNothing"));
        assertThat(failure.toString(), containsString("isn't public"));
View Full Code Here

Examples of org.junit.runner.Runner

        assertEquals(1, result.getFailureCount());
    }

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

Examples of org.junit.runner.Runner

        }
    }

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

Examples of org.junit.runner.Runner

    public static class ExampleSuite {
    }

    @Test
    public void testSuiteFiltering() throws Exception {
        Runner runner = Request.aClass(ExampleSuite.class).getRunner();
        Filter filter = notThisMethodName("test1");
        try {
            filter.apply(runner);
        } catch (NoTestsRemainException e) {
            return;
View Full Code Here

Examples of org.junit.runner.Runner

    public static class ExampleSuiteWithUnmodifyableChildList {
    }

    @Test
    public void testSuiteFilteringWithUnmodifyableChildList() throws Exception {
        Runner runner = Request.aClass(ExampleSuiteWithUnmodifyableChildList.class)
                .getRunner();
        Filter filter = notThisMethodName("test1");
        try {
            filter.apply(runner);
        } catch (NoTestsRemainException e) {
View Full Code Here

Examples of org.junit.runner.Runner

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

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

Examples of org.junit.runner.Runner

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

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

Examples of org.junit.runner.Runner

        }
    }

    @Test
    public void usesIndexAsTestName() {
        Runner runner = Request
                .aClass(ParameterizedWithoutSpecialTestname.class).getRunner();
        Description description = runner.getDescription();
        assertEquals("[1]", description.getChildren().get(1).getDisplayName());
    }
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.