From 877ecf83ad22b9de65c77d4e27177085e2b1a6bd Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Tue, 5 Jun 2012 22:56:26 +0400 Subject: [PATCH] store script object in CodeGenTest field --- .../tests/org/jetbrains/jet/codegen/CodegenTestCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/tests/org/jetbrains/jet/codegen/CodegenTestCase.java b/compiler/tests/org/jetbrains/jet/codegen/CodegenTestCase.java index 9c7faf4f8a0..0bafdce297a 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/CodegenTestCase.java +++ b/compiler/tests/org/jetbrains/jet/codegen/CodegenTestCase.java @@ -61,6 +61,8 @@ public abstract class CodegenTestCase extends UsefulTestCase { private List extraClasspath = Lists.newArrayList(); protected CodegenTestFile myFile; + protected Object scriptInstance; + protected void createEnvironmentWithMockJdkAndIdeaAnnotations() { if (myEnvironment != null) { throw new IllegalStateException("must not set up myEnvironemnt twice"); @@ -107,6 +109,7 @@ public abstract class CodegenTestCase extends UsefulTestCase { protected void tearDown() throws Exception { myFile = null; myEnvironment = null; + scriptInstance = null; super.tearDown(); } @@ -187,7 +190,7 @@ public abstract class CodegenTestCase extends UsefulTestCase { Class scriptClass = loader.loadClass("Script"); Constructor constructor = getConstructor(scriptClass, state.getScriptConstructorMethod()); - Object scriptInstance = constructor.newInstance(myFile.getScriptParameterValues().toArray()); + scriptInstance = constructor.newInstance(myFile.getScriptParameterValues().toArray()); assertFalse("expecting at least one expectation", myFile.getExpectedValues().isEmpty());