processEngineConfiguration.setEnableScriptCompilation(true);
}
public void testOverrideScriptSource() {
// when a script is created and executed
SourceExecutableScript script = createScript(SCRIPT_LANGUAGE, EXAMPLE_SCRIPT);
assertNotNull(script);
executeScript(script);
// it was compiled
assertFalse(script.isShouldBeCompiled());
assertNotNull(script.getCompiledScript());
// if the script source changes
script.setScriptSource(EXAMPLE_SCRIPT);
// then it should not be compiled after change
assertTrue(script.isShouldBeCompiled());
assertNull(script.getCompiledScript());
// but after next execution
executeScript(script);
// it is compiled again
assertFalse(script.isShouldBeCompiled());
assertNotNull(script.getCompiledScript());
}