Search in sources :

Example 1 with Filter

use of com.intellij.execution.testframework.Filter in project intellij-community by JetBrains.

the class TestFrameworkActions method getFilter.

private static Filter getFilter(TestConsoleProperties properties) {
    final boolean shouldFilterPassed = TestConsoleProperties.HIDE_PASSED_TESTS.value(properties);
    final Filter hidePassedFilter = shouldFilterPassed ? Filter.NOT_PASSED.or(Filter.DEFECT) : Filter.NO_FILTER;
    final boolean shouldFilterIgnored = TestConsoleProperties.HIDE_IGNORED_TEST.value(properties);
    final Filter hideIgnoredFilter;
    if (shouldFilterIgnored) {
        final Filter ignoredFilter = Filter.IGNORED.not();
        hideIgnoredFilter = !shouldFilterPassed ? ignoredFilter.or(Filter.HAS_PASSED) : ignoredFilter;
    } else {
        hideIgnoredFilter = Filter.NO_FILTER;
    }
    final boolean hideSuccessfulConfigs = TestConsoleProperties.HIDE_SUCCESSFUL_CONFIG.value(properties);
    final Filter hideConfigsFilter = hideSuccessfulConfigs ? Filter.HIDE_SUCCESSFUL_CONFIGS : Filter.NO_FILTER;
    return hidePassedFilter.and(hideIgnoredFilter).and(hideConfigsFilter);
}
Also used : Filter(com.intellij.execution.testframework.Filter)

Example 2 with Filter

use of com.intellij.execution.testframework.Filter in project intellij-community by JetBrains.

the class GeneralToSMTRunnerEventsConvertorTest method testOnTestIgnored.

public void testOnTestIgnored() {
    onTestStarted("some_test");
    myEventsProcessor.onTestIgnored(new TestIgnoredEvent("some_test", "", null));
    final String fullName = myEventsProcessor.getFullTestName("some_test");
    final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName);
    assertNotNull(proxy);
    assertTrue(proxy.isDefect());
    assertFalse(proxy.isInProgress());
    final Filter filter = AbstractRerunFailedTestsAction.getFailuresFilter(myConsole.getProperties());
    assertFalse(filter.shouldAccept(proxy));
}
Also used : Filter(com.intellij.execution.testframework.Filter)

Example 3 with Filter

use of com.intellij.execution.testframework.Filter in project intellij-community by JetBrains.

the class AbstractRerunFailedTestsAction method isActive.

private boolean isActive(AnActionEvent e) {
    Project project = e.getProject();
    if (project == null) {
        return false;
    }
    TestFrameworkRunningModel model = getModel();
    if (model == null || model.getRoot() == null) {
        return false;
    }
    Filter filter = getFailuresFilter();
    for (AbstractTestProxy test : model.getRoot().getAllTests()) {
        //noinspection unchecked
        if (filter.shouldAccept(test)) {
            return true;
        }
    }
    return false;
}
Also used : Project(com.intellij.openapi.project.Project) TestFrameworkRunningModel(com.intellij.execution.testframework.TestFrameworkRunningModel) Filter(com.intellij.execution.testframework.Filter) AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy)

Aggregations

Filter (com.intellij.execution.testframework.Filter)3 AbstractTestProxy (com.intellij.execution.testframework.AbstractTestProxy)1 TestFrameworkRunningModel (com.intellij.execution.testframework.TestFrameworkRunningModel)1 Project (com.intellij.openapi.project.Project)1