use of javax.script.ScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineFactoryTest method scriptEngineFactoriesIteratedAndAccessedSuccessfully.
@Test
public void scriptEngineFactoriesIteratedAndAccessedSuccessfully() {
OSGiScriptEngineManager scriptEngineManager = (OSGiScriptEngineManager) ScriptEngineManagerContext.getScriptEngineManager();
List<ScriptEngineFactory> engineFactories = scriptEngineManager.getEngineFactories();
assertNotNull(engineFactories);
for (ScriptEngineFactory engineFactory : engineFactories) {
assertTrue(engineFactory instanceof OSGiScriptEngineFactory);
}
scriptEngineManager.reloadManagers();
engineFactories = scriptEngineManager.getEngineFactories();
assertNotNull(engineFactories);
for (ScriptEngineFactory engineFactory : engineFactories) {
assertTrue(engineFactory instanceof OSGiScriptEngineFactory);
}
}
use of javax.script.ScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineTest method putAndGetContextSuccessfully.
@Test
public void putAndGetContextSuccessfully() {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
List<ScriptEngineFactory> engineFactories = scriptEngineManager.getEngineFactories();
assertNotNull(engineFactories);
for (ScriptEngineFactory engineFactory : engineFactories) {
verifyThatPutAndGetContextSuccessfully(engineFactory.getScriptEngine());
}
}
use of javax.script.ScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineTest method putAndGetSuccessfully.
@Test
public void putAndGetSuccessfully() {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
List<ScriptEngineFactory> engineFactories = scriptEngineManager.getEngineFactories();
assertNotNull(engineFactories);
for (ScriptEngineFactory engineFactory : engineFactories) {
verifyThatPutAndGetSuccessfully(engineFactory.getScriptEngine());
}
}
use of javax.script.ScriptEngineFactory in project OpenAM by OpenRock.
the class SandboxedGroovyScriptEngineTest method shouldReturnCorrectEngineFactory.
@Test
public void shouldReturnCorrectEngineFactory() throws Exception {
// Given
// When
ScriptEngineFactory result = testEngine.getFactory();
// Then
assertThat(result).isEqualTo(engineFactory);
}
use of javax.script.ScriptEngineFactory in project zaproxy by zaproxy.
the class ExtensionScript method getScriptingEngines.
public List<String> getScriptingEngines() {
List<String> engineNames = new ArrayList<>();
List<ScriptEngineFactory> engines = mgr.getEngineFactories();
for (ScriptEngineFactory engine : engines) {
engineNames.add(engine.getLanguageName() + LANG_ENGINE_SEP + engine.getEngineName());
}
for (ScriptEngineWrapper sew : this.engineWrappers) {
if (!engines.contains(sew.getEngine().getFactory())) {
engineNames.add(sew.getLanguageName() + LANG_ENGINE_SEP + sew.getEngineName());
}
}
Collections.sort(engineNames);
return engineNames;
}
Aggregations