Search in sources :

Example 1 with Issues

use of com.avaloq.tools.ddk.test.core.Issues in project dsl-devkit by dsldevkit.

the class FixedIssueFilter method shouldRun.

/**
 * {@inheritDoc}
 */
@Override
public boolean shouldRun(final Description description) {
    if (FilterRegistry.isSuite(description)) {
        return true;
    }
    // else: test class or test method
    final Issues issuesAnnotation = description.getAnnotation(Issues.class);
    if (issuesAnnotation != null) {
        for (final Issue issueAnnotation : issuesAnnotation.value()) {
            if (issueAnnotation != null && !issueAnnotation.fixed()) {
                return false;
            }
        }
    }
    final Issue issueAnnotation = description.getAnnotation(Issue.class);
    if (issueAnnotation != null && !issueAnnotation.fixed()) {
        return false;
    }
    final BugTest bugTestAnnotation = description.getAnnotation(BugTest.class);
    if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
        return false;
    }
    // if it is a test class we still want to check (and maybe run) its children
    return FilterRegistry.isTestMethod(description);
}
Also used : Issue(com.avaloq.tools.ddk.test.core.Issue) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Issues(com.avaloq.tools.ddk.test.core.Issues)

Example 2 with Issues

use of com.avaloq.tools.ddk.test.core.Issues in project dsl-devkit by dsldevkit.

the class UnresolvedIssueFilter method shouldRun.

/**
 * {@inheritDoc}
 */
@Override
public boolean shouldRun(final Description description) {
    if (FilterRegistry.isSuite(description)) {
        return true;
    }
    // else: test class or test method
    final Issues issuesAnnotation = description.getAnnotation(Issues.class);
    if (issuesAnnotation != null) {
        for (final Issue issueAnnotation : issuesAnnotation.value()) {
            if (issueAnnotation != null && !issueAnnotation.fixed()) {
                return true;
            }
        }
    }
    final Issue issueAnnotation = description.getAnnotation(Issue.class);
    if (issueAnnotation != null && !issueAnnotation.fixed()) {
        return true;
    }
    final BugTest bugTestAnnotation = description.getAnnotation(BugTest.class);
    if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
        return true;
    }
    // if it is a test class we still want to check (and maybe run) its children
    return FilterRegistry.isTestClass(description);
}
Also used : Issue(com.avaloq.tools.ddk.test.core.Issue) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Issues(com.avaloq.tools.ddk.test.core.Issues)

Aggregations

BugTest (com.avaloq.tools.ddk.test.core.BugTest)2 Issue (com.avaloq.tools.ddk.test.core.Issue)2 Issues (com.avaloq.tools.ddk.test.core.Issues)2