Examples of CategoryValidator


Examples of org.junit.experimental.categories.CategoryValidator

        FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(After.class).get(0);
        testAndAssertErrorMessage(method, "@After can not be combined with @Category");
    }

    private void testAndAssertErrorMessage(FrameworkMethod method, String expectedErrorMessage) {
        List<Exception> errors = new CategoryValidator().validateAnnotatedMethod(method);

        assertThat(errors.size(), is(1));
        Exception exception = errors.get(0);
        assertThat(exception.getMessage(), is(expectedErrorMessage));
    }
View Full Code Here

Examples of org.junit.experimental.categories.CategoryValidator

    }

    @Test
    public void errorIsNotAddedWhenCategoryIsNotCombinedWithIllegalCombination() throws NoSuchMethodException {
        FrameworkMethod method = new FrameworkMethod(CategoryTest.class.getMethod("methodWithCategory"));
        List<Exception> errors = new CategoryValidator().validateAnnotatedMethod(method);

        assertThat(errors.size(), is(0));
    }
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.