mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correct total tests; update status text on test finished (IDEA-194570)
This commit is contained in:
+1
@@ -774,6 +774,7 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
|
||||
if (!isModeConsistent(isCustomMessage)) return;
|
||||
myFinishedTestCount++;
|
||||
updateProgressOnTestDone();
|
||||
updateStatusLabel(false);
|
||||
}
|
||||
|
||||
private void updateOnTestIgnored() {
|
||||
|
||||
+7
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
+10
-2
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user