use of org.junit.runners.model.FrameworkMethod in project tomee by apache.
the class MetaRunner method collectInitializationErrors.
/**
* Flags an error if you have annotated a test with both @Test and @Keys. Any method annotated with @Test will be ignored anyways.
*/
@Override
protected void collectInitializationErrors(final List<Throwable> errors) {
super.collectInitializationErrors(errors);
final List<FrameworkMethod> methodsAnnotatedWithKeys = getTestClass().getAnnotatedMethods(MetaTest.class);
for (final FrameworkMethod frameworkMethod : methodsAnnotatedWithKeys) {
if (frameworkMethod.getAnnotation(Test.class) != null) {
final String gripe = "The method " + frameworkMethod.getName() + "() can only be annotated with @MetaTest";
errors.add(new Exception(gripe));
}
}
}
use of org.junit.runners.model.FrameworkMethod in project tomee by apache.
the class ValidationRunner method collectInitializationErrors.
/**
* Flags an error if you have annotated a test with both @Test and @Keys. Any method annotated with @Test will be ignored anyways.
*/
@Override
protected void collectInitializationErrors(final List<Throwable> errors) {
super.collectInitializationErrors(errors);
final List<FrameworkMethod> methodsAnnotatedWithKeys = getTestClass().getAnnotatedMethods(Keys.class);
for (final FrameworkMethod frameworkMethod : methodsAnnotatedWithKeys) {
if (frameworkMethod.getAnnotation(Test.class) != null) {
final String gripe = "The method " + frameworkMethod.getName() + "() can only be annotated with @Keys";
errors.add(new Exception(gripe));
}
}
}
use of org.junit.runners.model.FrameworkMethod in project pravega by pravega.
the class SingleJUnitTestRunner method runMethod.
public void runMethod() {
Method m = null;
try {
m = this.testClass.getDeclaredMethod(this.methodName);
Statement statement = methodBlock(new FrameworkMethod(m));
statement.evaluate();
} catch (Throwable ex) {
throw new TestFrameworkException(TestFrameworkException.Type.InternalError, "Exception while running test" + " method: " + this.methodName, ex);
}
}
use of org.junit.runners.model.FrameworkMethod in project gwt-test-utils by gwt-test-utils.
the class GwtSpringJUnitParamsClassRunner method getDescription.
@Override
public Description getDescription() {
if (description == null) {
description = Description.createSuiteDescription(getName(), getTestClass().getAnnotations());
List<FrameworkMethod> resultMethods = parameterisedRunner.returnListOfMethods();
for (FrameworkMethod method : resultMethods) description.addChild(describeMethod(method));
}
return description;
}
use of org.junit.runners.model.FrameworkMethod 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