use of org.apache.geode.test.junit.ConditionalIgnore in project geode by apache.
the class ConditionalIgnoreRule method throwOnIgnoreTest.
protected Statement throwOnIgnoreTest(Statement statement, Description description) {
if (isTest(description)) {
boolean ignoreTest = false;
String message = "";
ConditionalIgnore testCaseAnnotation = description.getAnnotation(ConditionalIgnore.class);
if (testCaseAnnotation != null) {
ignoreTest = evaluate(testCaseAnnotation, description);
message = testCaseAnnotation.value();
} else if (description.getTestClass().isAnnotationPresent(ConditionalIgnore.class)) {
ConditionalIgnore testClassAnnotation = description.getTestClass().getAnnotation(ConditionalIgnore.class);
ignoreTest = evaluate(testClassAnnotation, description);
message = testClassAnnotation.value();
}
if (ignoreTest) {
throw new AssumptionViolatedException(format(message, description));
}
}
return statement;
}
Aggregations