Fixed python UT testing.
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 10 May 2011 16:12:16 +0000 (20:12 +0400)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 10 May 2011 16:20:42 +0000 (20:20 +0400)
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestResultsViewer.java

index cfdf4eb36c80e4742fa4be67eed726c2c22b7d27..5a896c2db8d19b5edb237e8e02e831485da4926b 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.execution.testframework.sm.runner;
 
  */
 package com.intellij.execution.testframework.sm.runner;
 
+import com.google.common.collect.Lists;
 import com.intellij.execution.Location;
 import com.intellij.execution.testframework.AbstractTestProxy;
 import com.intellij.execution.testframework.Filter;
 import com.intellij.execution.Location;
 import com.intellij.execution.testframework.AbstractTestProxy;
 import com.intellij.execution.testframework.Filter;
@@ -331,9 +332,31 @@ public class SMTestProxy extends AbstractTestProxy {
     myParent = parent;
   }
 
     myParent = parent;
   }
 
+  public List<? extends SMTestProxy> collectChildren(@Nullable final Filter filter) {
+    return filterChildren(filter, collectChildren());
+  }
+
+  public List<? extends SMTestProxy> collectChildren() {
+    final List<? extends SMTestProxy> allChildren = getChildren();
+
+    final List<SMTestProxy> result = Lists.newArrayList();
+
+    result.addAll(allChildren);
+
+    for (SMTestProxy p: allChildren) {
+      result.addAll(p.collectChildren());
+    }
+
+    return result;
+  }
+
   public List<? extends SMTestProxy> getChildren(@Nullable final Filter filter) {
     final List<? extends SMTestProxy> allChildren = getChildren();
 
   public List<? extends SMTestProxy> getChildren(@Nullable final Filter filter) {
     final List<? extends SMTestProxy> allChildren = getChildren();
 
+    return filterChildren(filter, allChildren);
+  }
+
+  private static List<? extends SMTestProxy> filterChildren(@Nullable Filter filter, List<? extends SMTestProxy> allChildren) {
     if (filter == Filter.NO_FILTER || filter == null) {
       return allChildren;
     }
     if (filter == Filter.NO_FILTER || filter == null) {
       return allChildren;
     }
index c81ef7976651d6495002ff8a09e2e2c4607e75e6..3522a8dc648ecf8c6c8da537b7c37a78e7512914 100644 (file)
 package com.intellij.execution.testframework.sm.runner.ui;
 
 import com.intellij.execution.testframework.AbstractTestProxy;
 package com.intellij.execution.testframework.sm.runner.ui;
 
 import com.intellij.execution.testframework.AbstractTestProxy;
+import com.intellij.execution.testframework.TestFrameworkRunningModel;
 import com.intellij.execution.testframework.sm.runner.SMTestProxy;
 import com.intellij.openapi.Disposable;
 import com.intellij.execution.testframework.sm.runner.SMTestProxy;
 import com.intellij.openapi.Disposable;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 /**
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -50,4 +52,21 @@ public interface TestResultsViewer extends Disposable {
     void onTestingFinished(TestResultsViewer sender);
     void onTestNodeAdded(TestResultsViewer sender, SMTestProxy test);
   }
     void onTestingFinished(TestResultsViewer sender);
     void onTestNodeAdded(TestResultsViewer sender, SMTestProxy test);
   }
+
+  class SMEventsAdapter implements  EventsListener {
+
+    @Override
+    public void onTestingStarted(TestResultsViewer sender) {}
+
+    @Override
+    public void onTestingFinished(TestResultsViewer sender) {}
+
+    @Override
+    public void onTestNodeAdded(TestResultsViewer sender, SMTestProxy test) {}
+
+    @Override
+    public void onSelected(@Nullable SMTestProxy selectedTestProxy,
+                           @NotNull TestResultsViewer viewer,
+                           @NotNull TestFrameworkRunningModel model) {}
+  }
 }
 }