Examples of TestClass


Examples of org.junit.runners.model.TestClass

        public TestRule temporaryFolder = new TemporaryFolder();
    }

    @Test
    public void acceptStaticTestRuleThatIsAlsoClassRule() {
        TestClass target = new TestClass(TestWithStaticClassAndTestRule.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertNumberOfErrors(0);
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        public static TestRule temporaryFolder = new TemporaryFolder();
    }

    @Test
    public void rejectClassRuleInNonPublicClass() {
        TestClass target = new TestClass(NonPublicTestWithClassRule.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'temporaryFolder' must be declared in a public class.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

     * <p>This case has been added with
     * <a href="https://github.com/junit-team/junit/issues/1019">Issue #1019</a>
     */
    @Test
    public void rejectClassRuleThatIsImplemetationOfMethodRule() {
        TestClass target = new TestClass(TestWithClassRuleIsImplementationOfMethodRule.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'classRule' must implement TestRule.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

     * <p>This case has been added with
     * <a href="https://github.com/junit-team/junit/issues/1019">Issue #1019</a>
     */
    @Test
    public void rejectClassRuleThatReturnsImplementationOfMethodRule() {
        TestClass target = new TestClass(TestWithClassRuleMethodThatReturnsMethodRule.class);
        CLASS_RULE_METHOD_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'methodRule' must return an implementation of TestRule.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

     * <p>This case has been added with
     * <a href="https://github.com/junit-team/junit/issues/1019">Issue #1019</a>
     */
    @Test
    public void rejectClassRuleIsAnArbitraryObject() throws Exception {
        TestClass target = new TestClass(TestWithClassRuleIsAnArbitraryObject.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'arbitraryObject' must implement TestRule.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

     * <p>This case has been added with
     * <a href="https://github.com/junit-team/junit/issues/1019">Issue #1019</a>
     */
    @Test
    public void rejectClassRuleMethodReturnsAnArbitraryObject() throws Exception {
        TestClass target = new TestClass(TestWithClassRuleMethodReturnsAnArbitraryObject.class);
        CLASS_RULE_METHOD_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'arbitraryObject' must return an implementation of TestRule.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        }
    }
   
    @Test
    public void acceptNonStaticTestRule() {
        TestClass target = new TestClass(TestWithNonStaticTestRule.class);
        RULE_VALIDATOR.validate(target, errors);
        assertNumberOfErrors(0);
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        public TestRule temporaryFolder = new TemporaryFolder();
    }

    @Test
    public void rejectStaticTestRule() {
        TestClass target = new TestClass(TestWithStaticTestRule.class);
        RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @Rule 'temporaryFolder' must not be static or it must be annotated with @ClassRule.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        public static TestRule temporaryFolder = new TemporaryFolder();
    }

    @Test
    public void rejectStaticMethodRule() {
        TestClass target = new TestClass(TestWithStaticMethodRule.class);
        RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @Rule 'testWatchman' must not be static.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        public static MethodRule testWatchman = new TestWatchman();
    }
   
    @Test
    public void acceptMethodRule() throws Exception {
        TestClass target = new TestClass(TestWithMethodRule.class);
        RULE_VALIDATOR.validate(target, errors);
        assertNumberOfErrors(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.