Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1029 by [email protected]: RunnerFactory returns instance
with the same state on multiple invocations
http://code.google.com/p/robotframework/issues/detail?id=1029
Whenever we do multiple invocations of RunnerFactory, we should get a clean
version of RobotRunner. However what we observe is that if we invoke the
following multiple times, we get the jython object with the same
PySystemState.
runner = new RunnerFactory().createRunner()
This leads to the following issue. If we edit a resource file and create a
new runner and run it, it does not pick up the new changes in the resource
file. Currently, to get around this problem I am doing
Py.setSystemState(new PySystemState());
However it can be fixed properly by changing the following from
private PyObject importRunnerClass() {
PythonInterpreter localPythonInterpreter = new PythonInterpreter();
localPythonInterpreter.exec("import robot; from robot.jarrunner import
JarRunner");
return localPythonInterpreter.get("JarRunner");
}
to
private PyObject importRunnerClass() {
PythonInterpreter localPythonInterpreter = new PythonInterpreter(null, new
PySystemState());
localPythonInterpreter.exec("import robot; from robot.jarrunner import
JarRunner");
return localPythonInterpreter.get("JarRunner");
}