From d916bc5851d9361358e6e56eb2b1daa93903e810 Mon Sep 17 00:00:00 2001 From: Gregory Shrago Date: Mon, 11 Apr 2011 22:35:06 +0400 Subject: [PATCH] OC-545 OCUnit: improve test output --- .../OutputToGeneralTestEventsConverter.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java index 2f5a921a296d..4257912d97ca 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java @@ -175,10 +175,7 @@ public class OutputToGeneralTestEventsConverter implements ProcessOutputConsumer private void processConsistentText(final String text, final Key outputType, boolean tcLikeFakeOutput) { try { - final ServiceMessage serviceMessage = parseServiceMessage(text, outputType); - if (serviceMessage != null) { - serviceMessage.visit(myServiceMessageVisitor); - } else { + if (!processServiceMessages(text, outputType, myServiceMessageVisitor)) { // Filters \n if (text.equals("\n") && tcLikeFakeOutput) { // ServiceMessages protocol requires that every message @@ -199,11 +196,17 @@ public class OutputToGeneralTestEventsConverter implements ProcessOutputConsumer } } - @Nullable - protected ServiceMessage parseServiceMessage(final String text, final Key outputType) throws ParseException { - return ServiceMessage.parse(text); + protected boolean processServiceMessages(final String text, + final Key outputType, + final ServiceMessageVisitor visitor) throws ParseException { + final ServiceMessage message = ServiceMessage.parse(text); + if (message != null) { + message.visit(visitor); + } + return message != null; } + private void fireOnTestStarted(final String testName, @Nullable final String locationUrl) { assertNotNull(testName);