mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
hide ignored tests (IDEA-61369)
This commit is contained in:
@@ -152,6 +152,11 @@ public class SMTestProxy extends AbstractTestProxy {
|
||||
return myState.wasTerminated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnored() {
|
||||
return myState.getMagnitude() == TestStateInfo.Magnitude.SKIPPED_INDEX;
|
||||
}
|
||||
|
||||
public boolean isPassed() {
|
||||
return myState.getMagnitude() == TestStateInfo.Magnitude.SKIPPED_INDEX ||
|
||||
myState.getMagnitude() == TestStateInfo.Magnitude.COMPLETE_INDEX ||
|
||||
|
||||
@@ -47,6 +47,8 @@ public abstract class AbstractTestProxy extends CompositePrintable {
|
||||
|
||||
public abstract boolean isInterrupted();
|
||||
|
||||
public abstract boolean isIgnored();
|
||||
|
||||
public abstract boolean isPassed();
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
@@ -72,6 +72,12 @@ public abstract class Filter<T extends AbstractTestProxy> {
|
||||
}
|
||||
};
|
||||
|
||||
public static final Filter IGNORED = new Filter() {
|
||||
public boolean shouldAccept(final AbstractTestProxy test) {
|
||||
return test.isIgnored();
|
||||
}
|
||||
};
|
||||
|
||||
public static final Filter NOT_PASSED = new Filter() {
|
||||
public boolean shouldAccept(final AbstractTestProxy test) {
|
||||
return !test.isPassed();
|
||||
|
||||
+1
@@ -44,6 +44,7 @@ public abstract class TestConsoleProperties extends StoringPropertyContainer imp
|
||||
public static final BooleanProperty SORT_ALPHABETICALLY = new BooleanProperty("sortTestsAlphabetically", false);
|
||||
public static final BooleanProperty SELECT_FIRST_DEFECT = new BooleanProperty("selectFirtsDefect", false);
|
||||
public static final BooleanProperty TRACK_RUNNING_TEST = new BooleanProperty("trackRunningTest", true);
|
||||
public static final BooleanProperty HIDE_IGNORED_TEST = new BooleanProperty("hideIgnoredTests", false);
|
||||
public static final BooleanProperty HIDE_PASSED_TESTS = new BooleanProperty("hidePassedTests", true);
|
||||
public static final BooleanProperty SCROLL_TO_SOURCE = new BooleanProperty("scrollToSource", false);
|
||||
public static final BooleanProperty OPEN_FAILURE_LINE = new BooleanProperty("openFailureLine", false);
|
||||
|
||||
@@ -67,6 +67,7 @@ public class ToolbarPanel extends JPanel implements OccurenceNavigator, Disposab
|
||||
ExecutionBundle.message("junit.runing.info.track.test.action.description"),
|
||||
AllIcons.RunConfigurations.TrackTests,
|
||||
properties, TestConsoleProperties.TRACK_RUNNING_TEST)).setAsSecondary(true);
|
||||
actionGroup.addAction(new ToggleBooleanProperty("Hide Ignored", null, null, properties, TestConsoleProperties.HIDE_IGNORED_TEST)).setAsSecondary(true);
|
||||
|
||||
actionGroup.addAction(new ToggleBooleanProperty(ExecutionBundle.message("junit.runing.info.sort.alphabetically.action.name"),
|
||||
ExecutionBundle.message("junit.runing.info.sort.alphabetically.action.description"),
|
||||
|
||||
+9
@@ -38,6 +38,15 @@ public class TestFrameworkActions {
|
||||
}
|
||||
};
|
||||
addPropertyListener(TestConsoleProperties.HIDE_PASSED_TESTS, hidePropertyListener, model, true);
|
||||
|
||||
final TestConsoleProperties ignoreProperties = model.getProperties();
|
||||
final TestFrameworkPropertyListener<Boolean> ignorePropertyListener = new TestFrameworkPropertyListener<Boolean>() {
|
||||
public void onChanged(final Boolean value) {
|
||||
final boolean shouldFilter = TestConsoleProperties.HIDE_IGNORED_TEST.value(ignoreProperties);
|
||||
model.setFilter(shouldFilter ? Filter.IGNORED.not() : Filter.NO_FILTER);
|
||||
}
|
||||
};
|
||||
addPropertyListener(TestConsoleProperties.HIDE_IGNORED_TEST, ignorePropertyListener, model, true);
|
||||
}
|
||||
|
||||
public static void addPropertyListener(final AbstractProperty<Boolean> property,
|
||||
|
||||
@@ -141,6 +141,11 @@ public class TestProxy extends AbstractTestProxy {
|
||||
return getMagnitude() == PoolOfTestStates.TERMINATED_INDEX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnored() {
|
||||
return getMagnitude() == PoolOfTestStates.IGNORED_INDEX;
|
||||
}
|
||||
|
||||
public boolean isPassed() {
|
||||
return getMagnitude() <= PoolOfTestStates.PASSED_INDEX;
|
||||
}
|
||||
|
||||
@@ -230,6 +230,11 @@ public class TestProxy extends AbstractTestProxy {
|
||||
return !isInProgress() && inProgress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnored() {
|
||||
return resultMessage != null && MessageHelper.SKIPPED_TEST == resultMessage.getResult();
|
||||
}
|
||||
|
||||
public boolean isTearDownFailure() {
|
||||
for (TestProxy result : results) {
|
||||
if (result.isTearDownFailure()) return true;
|
||||
|
||||
Reference in New Issue
Block a user