From 445390c13c968182e49eab6cfa6943f5d96aeae6 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Wed, 26 Sep 2018 12:57:33 +0200 Subject: [PATCH] test runner: don't print empty suite (IDEA-115542) --- .../messages/SMTestsRunnerBundle.properties | 2 -- .../testframework/sm/runner/SMTestProxy.java | 2 +- .../sm/runner/states/SuiteFinishedState.java | 23 ------------------- .../sm/runner/SMTRunnerConsoleTest.java | 2 +- 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/platform/platform-resources-en/src/messages/SMTestsRunnerBundle.properties b/platform/platform-resources-en/src/messages/SMTestsRunnerBundle.properties index 55c648c61a80..cd2fd79e5605 100644 --- a/platform/platform-resources-en/src/messages/SMTestsRunnerBundle.properties +++ b/platform/platform-resources-en/src/messages/SMTestsRunnerBundle.properties @@ -15,7 +15,6 @@ sm.test.runner.ui.tests.tree.presentation.labels.was.terminated=Terminated sm.test.runner.ui.tests.tree.presentation.labels.no.tests.were.found=No tests were found sm.test.runner.ui.tests.tree.presentation.labels.test.reporter.not.attached=Test framework quit unexpectedly sm.test.runner.ui.tests.tree.presentation.labels.no.tests.were.found.with.errors=No tests were found. Errors occurred -sm.test.runner.ui.tests.tree.presentation.labels.empty.test.suite=Empty test suite sm.test.runner.ui.tests.tree.presentation.labels.all.tests.passed=All Tests Passed sm.test.runner.ui.tests.tree.presentation.labels.all.but.ignored.passed=All Tests Passed (except ignored) sm.test.runner.ui.tests.tree.presentation.labels.test.noname= @@ -36,5 +35,4 @@ sm.test.runner.ui.tabs.statistics.columns.results.count.msg.passed=P:{0} sm.test.runner.ui.tabs.statistics.columns.results.count.msg.ignored=I:{0} sm.test.runner.ui.tabs.statistics.columns.results.no.tests= -sm.test.runner.states.suite.is.empty=Empty test suite. sm.test.runner.states.test.is.ignored=Test ignored. \ No newline at end of file diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java index 57fc8485941f..749d0ec7938b 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java @@ -798,7 +798,7 @@ public class SMTestProxy extends AbstractTestProxy { protected AbstractState determineSuiteStateOnFinished() { final AbstractState state; if (isLeaf()) { - state = SuiteFinishedState.EMPTY_LEAF_SUITE; + state = SuiteFinishedState.EMPTY_SUITE; } else if (isDefect()) { // Test suit contains errors if at least one of its tests contains error diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/SuiteFinishedState.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/SuiteFinishedState.java index bb0a07462731..a6f8c0e38fd0 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/SuiteFinishedState.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/SuiteFinishedState.java @@ -15,18 +15,10 @@ */ package com.intellij.execution.testframework.sm.runner.states; -import com.intellij.execution.testframework.CompositePrintable; -import com.intellij.execution.testframework.Printer; -import com.intellij.execution.testframework.sm.SMTestsRunnerBundle; -import com.intellij.execution.ui.ConsoleViewContentType; -import org.jetbrains.annotations.NonNls; - /** * @author Roman Chernyatchik */ public abstract class SuiteFinishedState extends AbstractState { - @NonNls private static final String EMPTY_SUITE_TEXT = SMTestsRunnerBundle.message("sm.test.runner.states.suite.is.empty"); - //This states are common for all instances and doesn't contains //instance-specific information @@ -96,21 +88,6 @@ public abstract class SuiteFinishedState extends AbstractState { } }; - /** - * Finished empty leaf test suite - */ - public static SuiteFinishedState EMPTY_LEAF_SUITE = new EmptySuite() { - - @Override - public void printOn(final Printer printer) { - super.printOn(printer); - - final String msg = EMPTY_SUITE_TEXT + CompositePrintable.NEW_LINE; - printer.print(msg, ConsoleViewContentType.SYSTEM_OUTPUT); - } - - }; - /** * Finished empty test suite */ diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java index 0daabebd40e7..5ed441bc2017 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java @@ -522,7 +522,7 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { //the string above doesn't update tree immediately so we should simulate update myConsole.getPrinter().updateOnTestSelected(myResultsViewer.getTestsRootNode()); - assertAllOutputs(myMockResettablePrinter, "preved", "","Empty test suite.\n"); + assertAllOutputs(myMockResettablePrinter, "preved", "",""); } public void testPrintingOnlyOwnContentForRoot() {