update "X of Y tests" label if expected total test count is unspecified (https:/...
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Tue, 4 Oct 2016 15:13:03 +0000 (18:13 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Tue, 4 Oct 2016 15:13:25 +0000 (18:13 +0300)
platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java

index 12d6830b9e0e6d855a8d19c0c98490f67e727cd8..403e3c80de233b5d47ffc006cbc4f870bcb1f13c 100644 (file)
 package com.intellij.execution.testframework.ui;
 
 import com.intellij.execution.ExecutionBundle;
-import com.intellij.execution.testframework.TestConsoleProperties;
 import com.intellij.openapi.progress.util.ColorProgressBar;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.ui.JBProgressBar;
 import com.intellij.ui.SimpleColoredComponent;
 import com.intellij.ui.SimpleTextAttributes;
 import com.intellij.util.ui.JBDimension;
-import com.intellij.util.ui.JBEmptyBorder;
 
 import javax.swing.*;
 import java.awt.*;
@@ -51,14 +49,17 @@ public class TestStatusLine extends JPanel {
     myState.append(ExecutionBundle.message("junit.runing.info.starting.label"));
   }
 
-  public void formatTestMessage(final int testsTotal,
+  public void formatTestMessage(int testsTotal,
                                 final int finishedTestsCount,
                                 final int failuresCount,
                                 final int ignoredTestsCount,
                                 final Long duration,
                                 final long endTime) {
     myState.clear();
-    if (testsTotal == 0) return;
+    if (testsTotal == 0) {
+      testsTotal = finishedTestsCount + failuresCount + ignoredTestsCount;
+      if (testsTotal == 0) return;
+    }
     if (duration == null || endTime == 0) {
       myState.append(finishedTestsCount + " of " + getTestsTotalMessage(testsTotal) + (failuresCount + ignoredTestsCount > 0 ? ": " : ""));
       appendFailuresAndIgnores(failuresCount, ignoredTestsCount);