Index: editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTestCase.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTestCase.java (revision 40507) |
+++ editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTestCase.java (working copy) |
@@ -5,9 +5,14 @@ |
import com.google.dart.engine.context.AnalysisContext; |
import com.google.dart.engine.context.AnalysisException; |
import com.google.dart.engine.element.CompilationUnitElement; |
+import com.google.dart.engine.element.Element; |
import com.google.dart.engine.element.LibraryElement; |
import com.google.dart.engine.index.Index; |
import com.google.dart.engine.index.IndexFactory; |
+import com.google.dart.engine.index.Location; |
+import com.google.dart.engine.index.Relationship; |
+import com.google.dart.engine.index.RelationshipCallback; |
+import com.google.dart.engine.internal.index.IndexConstants; |
import com.google.dart.engine.internal.index.file.MemoryNodeManager; |
import com.google.dart.engine.resolver.ResolverTestCase; |
import com.google.dart.engine.search.SearchEngine; |
@@ -35,7 +40,6 @@ |
} |
protected Index index; |
- |
protected SearchEngine searchEngine; |
@Override |
@@ -46,6 +50,7 @@ |
@Override |
public void run() { |
index.run(); |
+ index = null; |
} |
}.start(); |
searchEngine = SearchEngineFactory.createSearchEngine(index); |
@@ -75,6 +80,21 @@ |
return libraryUnit; |
} |
+ @Override |
+ protected void tearDown() throws Exception { |
+ index.getRelationships( |
+ IndexConstants.UNIVERSE, |
+ IndexConstants.IS_READ_BY, |
+ new RelationshipCallback() { |
+ @Override |
+ public void hasRelationships(Element a, Relationship b, Location[] c) { |
+ index.stop(); |
+ } |
+ }); |
+ searchEngine = null; |
+ super.tearDown(); |
+ } |
+ |
/** |
* Run a set of completion tests on the given <code>originalSource</code>. The source string has |
* completion points embedded in it, which are identified by '!X' where X is a single character. |