Examples of wasSuccessful()


Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void methodCustomRuleIsAppliedOnce() {
        MethodExampleTestWithCustomClassRule.counter.count = 0;
        Result result = JUnitCore.runClasses(MethodExampleTestWithCustomClassRule.class);
        assertTrue(result.wasSuccessful());
        assertEquals(1, MethodExampleTestWithCustomClassRule.counter.count);
    }

    public static class CallMethodOnlyOnceRule {
        static int countOfMethodCalls = 0;
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void testCountOnAWithoutSlowTests() {
        Result result = JUnitCore.runClasses(SomeAreSlowSuite.class);
        assertThat(testResult(SomeAreSlowSuite.class), isSuccessful());
        assertEquals(2, result.getRunCount());
        assertTrue(result.wasSuccessful());
    }

    @RunWith(Categories.class)
    @ExcludeCategory(Category1.class)
    @IncludeCategory(Category2.class)
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void testsThatAreBothIncludedAndExcludedAreExcluded() {
        Result result = JUnitCore.runClasses(IncludeAndExcludeSuite.class);
        assertEquals(1, result.getRunCount());
        assertTrue(result.wasSuccessful());
    }

    @RunWith(Suite.class)
    @SuiteClasses({A.class, B.class, C.class})
    public static class TestSuiteWithNoCategories {
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void testCountWithExplicitFilter() throws Throwable {
        CategoryFilter include = CategoryFilter.include(SlowTests.class);
        Request baseRequest = Request.aClass(TestSuiteWithNoCategories.class);
        Result result = new JUnitCore().run(baseRequest.filterWith(include));
        assertTrue(result.wasSuccessful());
        assertEquals(2, result.getRunCount());
    }

    @Test
    public void categoryFilterLeavesOnlyMatchingMethods()
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void ifNoTestsToRunUseErrorRunner() {
        Result result = JUnitCore.runClasses(OneFastSuite.class);
        assertEquals(1, result.getRunCount());
        assertEquals(1, result.getFailureCount());
        assertFalse(result.wasSuccessful());
    }

    @Test
    public void describeACategoryFilter() {
        CategoryFilter filter = CategoryFilter.include(SlowTests.class);
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void testInheritance() {
        Result result = JUnitCore.runClasses(InheritanceSuite.class);
        assertEquals(1, result.getRunCount());
        assertTrue(result.wasSuccessful());
    }

    @RunWith(Categories.class)
    @IncludeCategory(Runnable.class)
    @ExcludeCategory(Runnable.class)
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    }

    @Test
    public void ignoredTest() {// behaves same as Suite
        Result result= JUnitCore.runClasses(IgnoredTestCategoriesSuite.class);
        assertFalse(result.wasSuccessful());
        assertThat(result.getRunCount(), is(1));
        assertThat(result.getFailureCount(), is(1));
        assertThat(result.getIgnoreCount(), is(1));
    }
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void oneRunnableOthersAvoided() {
        Result result= JUnitCore.runClasses(IncludedExcludedSameSuite.class);
        assertEquals(1, result.getRunCount());
        assertTrue(result.wasSuccessful());
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testCountWithMultipleExcludeFilter() throws Throwable {
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

        Set<Class<?>> exclusions= new HashSet<Class<?>>(2);
        Collections.addAll(exclusions, SlowTests.class, FastTests.class);
        CategoryFilter exclude = CategoryFilter.categoryFilter(true, null, true, exclusions);
        Request baseRequest= Request.aClass(OneOfEach.class);
        Result result= new JUnitCore().run(baseRequest.filterWith(exclude));
        assertTrue(result.wasSuccessful());
        assertEquals(1, result.getRunCount());
    }

    @Test
    public void testCountWithMultipleIncludeFilter() throws Throwable {
View Full Code Here

Examples of org.junit.runner.Result.wasSuccessful()

    @Test
    public void testCountWithMultipleIncludeFilter() throws Throwable {
        CategoryFilter exclude = CategoryFilter.include(true, SlowTests.class, FastTests.class);
        Request baseRequest= Request.aClass(OneOfEach.class);
        Result result= new JUnitCore().run(baseRequest.filterWith(exclude));
        assertTrue(result.wasSuccessful());
        assertEquals(2, result.getRunCount());
    }

    @RunWith(Categories.class)
    @Categories.ExcludeCategory(String.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.