diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java index bd64ea002cee..02abb7f66585 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java @@ -774,6 +774,7 @@ public class SMTestRunnerResultsForm extends TestResultsPanel if (!isModeConsistent(isCustomMessage)) return; myFinishedTestCount++; updateProgressOnTestDone(); + updateStatusLabel(false); } private void updateOnTestIgnored() { diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java index cb09a89ff4dc..8fd4be798194 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java @@ -63,8 +63,10 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT public void testOnTestStarted() { onTestStarted("my test", null, "1", TreeNodeEvent.ROOT_NODE_ID, true); + assertStatusLine(""); SMTestProxy proxy = validateTest("1", "my test", null, true, myRootProxy); onTestFailed("1", "", 1); + assertStatusLine("Tests failed: 1 of 1 test"); validateTestFailure("1", proxy, 1); } @@ -111,6 +113,7 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT SMTestProxy testB = validateTest("B", "testB", null, true, suite); assertEquals(1, myResultsViewer.getFinishedTestCount()); onTestIgnored("B"); + assertStatusLine("Tests ignored: 2 of 2 tests"); assertEquals(2, myResultsViewer.getFinishedTestCount()); validateTestIgnored("B", testB); } @@ -192,4 +195,8 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT private void onTestIgnored(@NotNull String id) { myEventsProcessor.onTestIgnored(new TestIgnoredEvent(null, id, null, null)); } + + private void assertStatusLine(@NotNull String expectedTestStatus) { + assertEquals(expectedTestStatus, myResultsViewer.getStatusLine().getStateText()); + } } diff --git a/platform/testRunner/src/com/intellij/execution/testframework/ui/TestResultsPanel.java b/platform/testRunner/src/com/intellij/execution/testframework/ui/TestResultsPanel.java index 66ab855feff6..2b9657ea70fe 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/ui/TestResultsPanel.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/ui/TestResultsPanel.java @@ -63,6 +63,11 @@ public abstract class TestResultsPanel extends JPanel implements Disposable, Dat properties.getProject().getMessageBus().connect(this).subscribe(ToolWindowManagerListener.TOPIC, listener); } + @NotNull + public TestStatusLine getStatusLine() { + return myStatusLine; + } + public void initUI() { myLeftPane = ScrollPaneFactory.createScrollPane(); myLeftPane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.TOP); diff --git a/platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java b/platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java index 6c666b66fb2b..52918b08db2d 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java @@ -24,7 +24,9 @@ import com.intellij.ui.SimpleColoredComponent; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.components.panels.NonOpaquePanel; import com.intellij.util.ui.JBDimension; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.TestOnly; import javax.swing.*; import java.awt.*; @@ -63,7 +65,7 @@ public class TestStatusLine extends NonOpaquePanel { final long endTime) { myState.clear(); if (testsTotal == 0) { - testsTotal = finishedTestsCount + failuresCount + ignoredTestsCount; + testsTotal = finishedTestsCount; if (testsTotal == 0) return; } int passedCount = finishedTestsCount - failuresCount - ignoredTestsCount; @@ -153,9 +155,15 @@ public class TestStatusLine extends NonOpaquePanel { myProgressPanel.setMinimumSize(size); myProgressPanel.setPreferredSize(size); } - + public void setText(String progressStatus_text) { myState.clear(); myState.append(progressStatus_text); } + + @TestOnly + @NotNull + public String getStateText() { + return myState.toString(); + } }