IDEA-142739 GeneralIdBasedToSMTRunnerEventsConvertor doesn't accept duration attribut...
[idea/community.git] / platform / smRunner / src / com / intellij / execution / testframework / sm / runner / GeneralIdBasedToSMTRunnerEventsConvertor.java
index 21651ce887796f8d9c33587c9fc7d54324f79b2b..2bc10fced23a0c8d799e04a2359425dc19ba198c 100644 (file)
@@ -310,7 +310,7 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP
         String stackTrace = testFailedEvent.getStacktrace();
         if (comparisonFailureActualText != null && comparisonFailureExpectedText != null) {
           testProxy.setTestComparisonFailed(failureMessage, stackTrace,
-                                            comparisonFailureActualText, comparisonFailureExpectedText);
+                                            comparisonFailureActualText, comparisonFailureExpectedText, testFailedEvent.getFilePath());
         } else if (comparisonFailureActualText == null && comparisonFailureExpectedText == null) {
           testProxy.setTestFailed(failureMessage, stackTrace, testFailedEvent.isTestError());
         } else {
@@ -320,6 +320,10 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP
                      + "Actual:\n"
                      + comparisonFailureActualText);
         }
+        long duration = testFailedEvent.getDurationMillis();
+        if (duration >= 0) {
+          testProxy.setDuration(duration);
+        }
 
         // fire event
         fireOnTestFailed(testProxy);
@@ -388,6 +392,12 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP
     return myNodeByIdMap.get(treeNodeEvent.getId());
   }
 
+  @Nullable
+  public SMTestProxy findProxyById(int id) {
+    Node node = myNodeByIdMap.get(id);
+    return node != null ? node.getProxy() : null;
+  }
+
   private void fireOnTestingStarted() {
     for (SMTRunnerEventsListener listener : myEventsListeners) {
       listener.onTestingStarted(myTestsRootProxy);