From 237284d247ce21c1612a17a53921c2dc7b64c15d Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 3 Oct 2017 20:42:34 +0300 Subject: [PATCH] Fix ISE already disposed DefaultPicoContainer in Compiler Tests Some test's won't create their own application, and assumes that ApplicationManager.getApplication() is null But CompilerEnvironmentTest had created application somewhere inside compiler, disposed it, but forgot to reset variable, causing few tests to fail because of not overridden application --- .../kotlin/jvm/compiler/CompileEnvironmentTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileEnvironmentTest.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileEnvironmentTest.java index e9ba15d3ef3..83eee7550fb 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileEnvironmentTest.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileEnvironmentTest.java @@ -22,6 +22,7 @@ import org.jetbrains.kotlin.cli.common.ExitCode; import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler; import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase; import org.junit.Assert; import java.io.File; @@ -53,4 +54,10 @@ public class CompileEnvironmentTest extends TestCase { FileUtil.delete(tempDir); } } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + KtUsefulTestCase.resetApplicationToNull(); + } }