sm runner: print all hyperlinks
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 15 Sep 2016 16:45:45 +0000 (19:45 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 15 Sep 2016 16:45:45 +0000 (19:45 +0300)
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestProxyPrinterProvider.java

index e385f2b6ac711b3f011246a945101e58d64aebbd..d66162f228109603b822c03718d6df0ca93b2f01 100644 (file)
@@ -88,7 +88,7 @@ public final class TestProxyPrinterProvider {
     }
 
     private void printLine(@NotNull String line, @NotNull ConsoleViewContentType contentType) {
-      Filter.Result result = null;
+      Filter.Result result;
       try {
         result = myFilter.applyFilter(line, line.length());
       }
@@ -96,10 +96,12 @@ public final class TestProxyPrinterProvider {
         throw new RuntimeException("Error while applying " + myFilter + " to '"+line+"'", t);
       }
       if (result != null) {
-        defaultPrint(line.substring(0, result.getHighlightStartOffset()), contentType);
-        String linkText = line.substring(result.getHighlightStartOffset(), result.getHighlightEndOffset());
-        printHyperlink(linkText, result.getHyperlinkInfo());
-        defaultPrint(line.substring(result.getHighlightEndOffset()), contentType);
+        for (Filter.ResultItem item : result.getResultItems()) {
+          defaultPrint(line.substring(0, item.getHighlightStartOffset()), contentType);
+          String linkText = line.substring(item.getHighlightStartOffset(), item.getHighlightEndOffset());
+          printHyperlink(linkText, item.getHyperlinkInfo());
+          defaultPrint(line.substring(item.getHighlightEndOffset()), contentType);
+        }
       }
       else {
         defaultPrint(line, contentType);