Ejemplo n.º 1
0
        public virtual void testFetchScriptEngineFromPaDisableCaching()
        {
            // then
            processEngineConfiguration.EnableScriptEngineCaching = false;
            ScriptingEngines.EnableScriptEngineCaching           = false;

            EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();

            ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.Reference).addClasspathResource(PROCESS_PATH).deploy();

            // when
            ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);

            // then
            assertNotNull(engine);
            assertFalse(engine.Equals(getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication)));

            // not cached in pa
            assertFalse(engine.Equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, false)));

            repositoryService.deleteDeployment(deployment.Id, true);

            processEngineConfiguration.EnableScriptEngineCaching = true;
            ScriptingEngines.EnableScriptEngineCaching           = true;
        }
Ejemplo n.º 2
0
        public virtual void testFetchScriptEngineFromPaEnableCaching()
        {
            // then
            EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();

            ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.Reference).addClasspathResource(PROCESS_PATH).deploy();

            // when
            ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);

            // then
            assertNotNull(engine);
            assertEquals(engine, getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication));

            // cached in pa
            assertEquals(engine, processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, true));

            repositoryService.deleteDeployment(deployment.Id, true);
        }