Clean up test data after end of the test

This commit is contained in:
Nikolay Krasko
2012-11-27 16:37:04 +04:00
parent 673eba662d
commit 85f7b4069f
10 changed files with 86 additions and 3 deletions
@@ -62,9 +62,19 @@ public class CheckLocalVariablesTableTest extends TestCaseWithTmpdir {
}
@Override
protected void runTest() throws Throwable {
protected void setUp() throws Exception {
super.setUp();
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable);
}
@Override
protected void tearDown() throws Exception {
jetCoreEnvironment = null;
super.tearDown();
}
@Override
protected void runTest() throws Throwable {
String text = FileUtil.loadFile(ktFile);
JetFile psiFile = JetTestUtils.createFile(ktFile.getName(), text, jetCoreEnvironment.getProject());
@@ -50,6 +50,12 @@ public abstract class AbstractWriteFlagsTest extends UsefulTestCase {
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
}
@Override
protected void tearDown() throws Exception {
jetCoreEnvironment = null;
super.tearDown();
}
protected void doTest(String path) throws IOException {
File ktFile = new File(path);
assertTrue("Cannot find a file " + ktFile.getAbsolutePath(), ktFile.exists());