From 808087b883b8bc749b00ffb2b332d212840ce89d Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Wed, 28 Sep 2016 17:04:27 +0200 Subject: [PATCH] sm runner: ensure test failure if comparison failure is incomplete, log the problem --- .../sm/runner/GeneralToSMTRunnerEventsConvertor.java | 1 + .../GeneralToSMTRunnerEventsConvertorTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java index 7894681f8928..5aee60f8e536 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java @@ -392,6 +392,7 @@ public class GeneralToSMTRunnerEventsConvertor extends GeneralTestEventsProcesso testProxy.setTestFailed(localizedMessage, stackTrace, isTestError); } else { + testProxy.setTestFailed(localizedMessage, stackTrace, isTestError); logProblem("Comparison failure actual and expected texts should be both null or not null.\n" + "Expected:\n" + comparisionFailureExpectedText + "\n" diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java index 505215eb7626..e702c6805ed1 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java @@ -177,6 +177,18 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase assertFalse(proxy.isInProgress()); } + public void testOnTestTruncatedComparisonFailure() { + onTestStarted("some_test"); + myEventsProcessor.onTestFailure(new TestFailedEvent("some_test", "", "", false, "actual", null)); + + final String fullName = myEventsProcessor.getFullTestName("some_test"); + final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName); + + assertNotNull(proxy); + assertTrue(proxy.isDefect()); + assertFalse(proxy.isInProgress()); + } + public void testOnTestFailure_Twice() { myMockResettablePrinter.resetIfNecessary(); onTestStarted("some_test");