use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class RuleMemberValidatorTest method rejectMethodStaticMethodRule.
@Test
public void rejectMethodStaticMethodRule() {
TestClass target = new TestClass(TestMethodWithStaticMethodRule.class);
RULE_METHOD_VALIDATOR.validate(target, errors);
assertOneErrorWithMessage("The @Rule 'getSomeMethodRule' must not be static.");
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class RuleMemberValidatorTest method acceptMethodRule.
@Test
public void acceptMethodRule() throws Exception {
TestClass target = new TestClass(TestWithMethodRule.class);
RULE_VALIDATOR.validate(target, errors);
assertNumberOfErrors(0);
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class RuleMemberValidatorTest method acceptStaticTestRuleThatIsAlsoClassRule.
@Test
public void acceptStaticTestRuleThatIsAlsoClassRule() {
TestClass target = new TestClass(TestWithStaticClassAndTestRule.class);
CLASS_RULE_VALIDATOR.validate(target, errors);
assertNumberOfErrors(0);
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class RuleMemberValidatorTest method acceptNonStaticTestRule.
@Test
public void acceptNonStaticTestRule() {
TestClass target = new TestClass(TestWithNonStaticTestRule.class);
RULE_VALIDATOR.validate(target, errors);
assertNumberOfErrors(0);
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class CategoryValidatorTest method errorIsAddedWhenCategoryIsUsedWithBeforeClass.
@Test
public void errorIsAddedWhenCategoryIsUsedWithBeforeClass() {
FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(BeforeClass.class).get(0);
testAndAssertErrorMessage(method, "@BeforeClass can not be combined with @Category");
}
Aggregations