Free memory in tearDown()

This commit is contained in:
Nikolay Krasko
2013-01-21 21:43:44 +04:00
parent 126c21de96
commit 731f2d51f6
3 changed files with 20 additions and 1 deletions
@@ -61,6 +61,12 @@ public class JavaElementFinderTest extends JetLiteFixture {
finder = new JavaElementFinder(getProject(), LightClassGenerationSupport.getInstance(getProject()));
}
@Override
protected void tearDown() throws Exception {
finder = null;
super.tearDown();
}
public void testFromEnumEntry() {
assertClass("Direction");
assertNoClass("Direction.NORTH");
@@ -132,7 +132,7 @@ public abstract class KotlinLightClassTest extends KotlinTestWithEnvironment {
}
}
private final File path;
private File path;
private JavaElementFinder finder;
protected KotlinLightClassTest(File path) {
@@ -164,6 +164,13 @@ public abstract class KotlinLightClassTest extends KotlinTestWithEnvironment {
LazyResolveTestUtil.resolveEagerly(jetFiles, getEnvironment());
}
@Override
protected void tearDown() throws Exception {
finder = null;
path = null;
super.tearDown();
}
@NotNull
protected PsiClass findClass(String qualifiedName) {
PsiClass psiClass = finder.findClass(qualifiedName, GlobalSearchScope.allScope(getProject()));
@@ -39,6 +39,12 @@ public abstract class ExtensibleResolveTestCase extends JetLiteFixture {
expectedResolveData = getExpectedResolveData();
}
@Override
protected void tearDown() throws Exception {
expectedResolveData = null;
super.tearDown();
}
protected abstract ExpectedResolveData getExpectedResolveData();
protected void doTest(@NonNls String filePath) throws Exception {