diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestElement.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestElement.java index c62b66d253..0104d05098 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestElement.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestElement.java @@ -13,15 +13,19 @@ public enum State { SUCCESS, FAILURE, ERROR, - IGNORED; + IGNORED_OR_ABORTED; public boolean isFinished() { - return this == SUCCESS || this == FAILURE || this == ERROR || this == IGNORED; + return this == SUCCESS || this == FAILURE || this == ERROR || this == IGNORED_OR_ABORTED; } public boolean isFailureOrError() { return this == FAILURE || this == ERROR; } + + public boolean canShowStackTrace() { + return this == FAILURE || this == ERROR || this == State.IGNORED_OR_ABORTED; + } } diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestEventListener.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestEventListener.java index 37490b7279..eb6bc50592 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestEventListener.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestEventListener.java @@ -2,7 +2,7 @@ import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.ERROR; import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.FAILURE; -import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.IGNORED; +import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.IGNORED_OR_ABORTED; import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.RUNNING; import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.SUCCESS; import static com.redhat.ceylon.test.eclipse.plugin.model.TestElement.State.UNDEFINED; @@ -16,14 +16,14 @@ import java.util.ArrayList; import java.util.List; -import net.minidev.json.JSONArray; -import net.minidev.json.JSONObject; -import net.minidev.json.JSONValue; - import org.eclipse.debug.core.ILaunch; import com.redhat.ceylon.test.eclipse.plugin.CeylonTestPlugin; +import net.minidev.json.JSONArray; +import net.minidev.json.JSONObject; +import net.minidev.json.JSONValue; + public class TestEventListener { private final static byte EOT = 0x4; @@ -104,6 +104,7 @@ private TestEventType parseTestEventType(String event) { case "testFinish": case "testError": case "testIgnore": + case "testAborted": return TestEventType.TEST_FINISHED; default: throw new IllegalArgumentException(event); @@ -131,7 +132,10 @@ private TestElement parseTestElement(JSONObject json) { e.setState(ERROR); break; case "ignored": - e.setState(IGNORED); + e.setState(IGNORED_OR_ABORTED); + break; + case "aborted": + e.setState(IGNORED_OR_ABORTED); break; default: e.setState(UNDEFINED); diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestRun.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestRun.java index 9dd85c8a0c..bc3a51a5ef 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestRun.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/model/TestRun.java @@ -33,7 +33,7 @@ public static Object acquireLock(TestRun testRun) { private int successCount = 0; private int failureCount = 0; private int errorCount = 0; - private int ignoreCount = 0; + private int ignoreOrAbortedCount = 0; public TestRun(ILaunch launch) { this.launch = launch; @@ -105,7 +105,7 @@ public int getErrorCount() { } public int getIgnoreCount() { - return ignoreCount; + return ignoreOrAbortedCount; } public int getFinishedCount() { @@ -117,7 +117,7 @@ public State getPackageState(String packageName) { int success = 0; int failure = 0; int error = 0; - int ignored = 0; + int ignoredOrAborted = 0; int total = 0; List testsInPackage = testsByPackages.get(packageName); @@ -129,7 +129,7 @@ public State getPackageState(String packageName) { case SUCCESS: success++; break; case FAILURE: failure++; break; case ERROR: error++; break; - case IGNORED: ignored++; break; + case IGNORED_OR_ABORTED: ignoredOrAborted++; break; default: /* noop */ break; } } @@ -139,11 +139,11 @@ public State getPackageState(String packageName) { return State.ERROR; } else if (failure > 0) { return State.FAILURE; - } else if (ignored == total) { - return State.IGNORED; + } else if (ignoredOrAborted == total) { + return State.IGNORED_OR_ABORTED; } else if (undefined == total) { return State.UNDEFINED; - } else if (success + ignored == total) { + } else if (success + ignoredOrAborted == total) { return State.SUCCESS; } else if (total > 0) { return State.RUNNING; @@ -302,8 +302,8 @@ private void updateCounters(TestEventType eventType, TestElement element) { errorCount++; } break; - case IGNORED: - ignoreCount++; + case IGNORED_OR_ABORTED: + ignoreOrAbortedCount++; break; default: throw new IllegalStateException(element.toString()); diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/CompareRunsDialog.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/CompareRunsDialog.java index e6a4a2cf3a..94c896c976 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/CompareRunsDialog.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/CompareRunsDialog.java @@ -443,12 +443,12 @@ public void selectionChanged(SelectionChangedEvent event) { if (comparedElement != null) { if (comparedElement.getTestElement1() != null && comparedElement.getTestElement1().getException() != null && - comparedElement.getTestElement1().getState() != State.IGNORED) { + comparedElement.getTestElement1().getState() != State.IGNORED_OR_ABORTED) { exception1 = comparedElement.getTestElement1().getException(); } if (comparedElement.getTestElement2() != null && comparedElement.getTestElement2().getException() != null && - comparedElement.getTestElement2().getState() != State.IGNORED) { + comparedElement.getTestElement2().getState() != State.IGNORED_OR_ABORTED) { exception2 = comparedElement.getTestElement2().getException(); } } @@ -738,7 +738,7 @@ private ComparedState initState() { state = ComparedState.REMOVED; } else if (testElement1.getState() == State.SUCCESS && testElement2.getState() == State.SUCCESS) { state = ComparedState.UNCHANGED; - } else if (testElement1.getState() == State.IGNORED && testElement2.getState() == State.IGNORED) { + } else if (testElement1.getState() == State.IGNORED_OR_ABORTED && testElement2.getState() == State.IGNORED_OR_ABORTED) { state = ComparedState.UNCHANGED; } else if (testElement1.getState() == State.ERROR && testElement2.getState() == State.ERROR) { state = isUnchangedException() ? ComparedState.UNCHANGED : ComparedState.CHANGED; @@ -748,7 +748,7 @@ private ComparedState initState() { state = ComparedState.REGRESSED_ERROR; } else if (testElement1.getState() != State.FAILURE && testElement2.getState() == State.FAILURE) { state = ComparedState.REGRESSED_FAILURE; - } else if (testElement1.getState() != State.SUCCESS && testElement1.getState() != State.IGNORED && testElement2.getState() == State.SUCCESS) { + } else if (testElement1.getState() != State.SUCCESS && testElement1.getState() != State.IGNORED_OR_ABORTED && testElement2.getState() == State.SUCCESS) { state = ComparedState.FIXED; } else { state = ComparedState.CHANGED; diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/StackTracePanel.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/StackTracePanel.java index 7fd9e63a2e..8670118649 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/StackTracePanel.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/StackTracePanel.java @@ -231,7 +231,7 @@ private void updateActionState() { private boolean isStackTraceAvailable() { if (selectedTestElement != null && selectedTestElement.getException() != null && - selectedTestElement.getState().isFailureOrError()) { + selectedTestElement.getState().canShowStackTrace()) { return true; } return false; diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/TestsPanel.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/TestsPanel.java index 1fc18371f4..8a7a44e6f8 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/TestsPanel.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/ui/TestsPanel.java @@ -512,7 +512,7 @@ public void update(ViewerCell cell) { case SUCCESS: image = getImage(TESTS_SUCCESS); break; case FAILURE: image = getImage(TESTS_FAILED); break; case ERROR: image = getImage(TESTS_ERROR); break; - case IGNORED: image = getImage(TESTS_IGNORED); break; + case IGNORED_OR_ABORTED: image = getImage(TESTS_IGNORED); break; default: image = getImage(TESTS); break; } @@ -748,7 +748,7 @@ public void run() { if (selectedElement instanceof TestElement) { try { TestElement testElement = (TestElement) selectedElement; - if (testElement.getState().isFailureOrError() && testElement.getException() != null) { + if (testElement.getState().canShowStackTrace() && testElement.getException() != null) { List lines = StackTracePanel.parseStackTraceLine(testElement.getException()); for (String line : lines) { String trimmedLine = line.trim(); diff --git a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/util/CeylonTestUtil.java b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/util/CeylonTestUtil.java index a3c65f3658..e81261941f 100644 --- a/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/util/CeylonTestUtil.java +++ b/plugins/com.redhat.ceylon.test.eclipse.plugin/src/com/redhat/ceylon/test/eclipse/plugin/util/CeylonTestUtil.java @@ -293,7 +293,7 @@ public static Image getTestStateImage(TestElement testElement) { case SUCCESS: image = getImage(TEST_SUCCESS); break; case FAILURE: image = getImage(TEST_FAILED); break; case ERROR: image = getImage(TEST_ERROR); break; - case IGNORED: image = getImage(TEST_IGNORED); break; + case IGNORED_OR_ABORTED: image = getImage(TEST_IGNORED); break; default: image = getImage(TEST); break; } } else { @@ -302,7 +302,7 @@ public static Image getTestStateImage(TestElement testElement) { case SUCCESS: image = getImage(TESTS_SUCCESS); break; case FAILURE: image = getImage(TESTS_FAILED); break; case ERROR: image = getImage(TESTS_ERROR); break; - case IGNORED: image = getImage(TESTS_IGNORED); break; + case IGNORED_OR_ABORTED: image = getImage(TESTS_IGNORED); break; default: image = getImage(TESTS); break; } }