store script object in CodeGenTest field
This commit is contained in:
@@ -61,6 +61,8 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
|||||||
private List<File> extraClasspath = Lists.newArrayList();
|
private List<File> extraClasspath = Lists.newArrayList();
|
||||||
protected CodegenTestFile myFile;
|
protected CodegenTestFile myFile;
|
||||||
|
|
||||||
|
protected Object scriptInstance;
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdkAndIdeaAnnotations() {
|
protected void createEnvironmentWithMockJdkAndIdeaAnnotations() {
|
||||||
if (myEnvironment != null) {
|
if (myEnvironment != null) {
|
||||||
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
||||||
@@ -107,6 +109,7 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
|||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
myFile = null;
|
myFile = null;
|
||||||
myEnvironment = null;
|
myEnvironment = null;
|
||||||
|
scriptInstance = null;
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +190,7 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
|||||||
Class<?> scriptClass = loader.loadClass("Script");
|
Class<?> scriptClass = loader.loadClass("Script");
|
||||||
|
|
||||||
Constructor constructor = getConstructor(scriptClass, state.getScriptConstructorMethod());
|
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());
|
assertFalse("expecting at least one expectation", myFile.getExpectedValues().isEmpty());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user