Search in sources :

Example 1 with IgnoreUntil

use of org.apache.geode.test.junit.IgnoreUntil in project geode by apache.

the class IgnoreUntilRule method throwOnIgnoreTest.

protected Statement throwOnIgnoreTest(Statement statement, Description description) {
    if (isTest(description)) {
        boolean ignoreTest = false;
        String message = "";
        IgnoreUntil testCaseAnnotation = description.getAnnotation(IgnoreUntil.class);
        if (testCaseAnnotation != null) {
            ignoreTest = evaluate(testCaseAnnotation, description);
            message = testCaseAnnotation.value();
        } else if (description.getTestClass().isAnnotationPresent(IgnoreUntil.class)) {
            IgnoreUntil testClassAnnotation = description.getTestClass().getAnnotation(IgnoreUntil.class);
            ignoreTest = evaluate(testClassAnnotation, description);
            message = testClassAnnotation.value();
        }
        if (ignoreTest) {
            throw new AssumptionViolatedException(format(message, description));
        }
    }
    return statement;
}
Also used : IgnoreUntil(org.apache.geode.test.junit.IgnoreUntil) AssumptionViolatedException(org.junit.AssumptionViolatedException)

Aggregations

IgnoreUntil (org.apache.geode.test.junit.IgnoreUntil)1 AssumptionViolatedException (org.junit.AssumptionViolatedException)1