use of org.codehaus.groovy.jsr223.GroovyScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineFactoryTest method registerAndGetScriptEngineByExtensionSuccessfully.
@Test
public void registerAndGetScriptEngineByExtensionSuccessfully() {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
GroovyScriptEngineFactory groovyScriptEngineFactory = new GroovyScriptEngineFactory();
scriptEngineManager.registerEngineExtension("groovy", groovyScriptEngineFactory);
ScriptEngine scriptEngine = scriptEngineManager.getEngineByExtension("groovy");
assertNotNull(scriptEngine);
ScriptEngineFactory scriptEngineFactory = scriptEngine.getFactory();
verifyScriptEngineFactory(scriptEngineFactory);
}
use of org.codehaus.groovy.jsr223.GroovyScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineTest method scriptEngineEvaluatedSuccessfully.
@Test
public void scriptEngineEvaluatedSuccessfully() throws ScriptException {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
GroovyScriptEngineFactory groovyScriptEngineFactory = new GroovyScriptEngineFactory();
scriptEngineManager.registerEngineName("groovy", groovyScriptEngineFactory);
ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("groovy");
assertNotNull(scriptEngine);
verifyScriptEngineEvaluation(scriptEngine);
}
use of org.codehaus.groovy.jsr223.GroovyScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineFactoryTest method registerAndGetScriptEngineByMimeTypeSuccessfully.
@Test
public void registerAndGetScriptEngineByMimeTypeSuccessfully() {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
GroovyScriptEngineFactory groovyScriptEngineFactory = new GroovyScriptEngineFactory();
scriptEngineManager.registerEngineMimeType("application/x-groovy", groovyScriptEngineFactory);
ScriptEngine scriptEngine = scriptEngineManager.getEngineByMimeType("application/x-groovy");
assertNotNull(scriptEngine);
ScriptEngineFactory scriptEngineFactory = scriptEngine.getFactory();
verifyScriptEngineFactory(scriptEngineFactory);
}
use of org.codehaus.groovy.jsr223.GroovyScriptEngineFactory in project hazelcast by hazelcast.
the class HazelcastOSGiScriptEngineFactoryTest method registerAndGetScriptEngineByNameSuccessfully.
@Test
public void registerAndGetScriptEngineByNameSuccessfully() {
ScriptEngineManager scriptEngineManager = ScriptEngineManagerContext.getScriptEngineManager();
GroovyScriptEngineFactory groovyScriptEngineFactory = new GroovyScriptEngineFactory();
scriptEngineManager.registerEngineName("groovy", groovyScriptEngineFactory);
ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("groovy");
assertNotNull(scriptEngine);
ScriptEngineFactory scriptEngineFactory = scriptEngine.getFactory();
verifyScriptEngineFactory(scriptEngineFactory);
}
use of org.codehaus.groovy.jsr223.GroovyScriptEngineFactory in project OpenAM by OpenRock.
the class OidcClaimsExtensionTest method setupScript.
@BeforeClass
public void setupScript() throws Exception {
String rawScript = IOUtils.readStream(this.getClass().getClassLoader().getResourceAsStream("oidc-claims-extension.groovy"));
SupportedScriptingLanguage scriptType = SupportedScriptingLanguage.GROOVY;
this.script = new ScriptObject("oidc-claims-script", rawScript, scriptType, null);
StandardScriptEngineManager scriptEngineManager = new StandardScriptEngineManager();
scriptEngineManager.registerEngineName(SupportedScriptingLanguage.GROOVY_ENGINE_NAME, new GroovyScriptEngineFactory());
scriptEvaluator = new StandardScriptEvaluator(scriptEngineManager);
}
Aggregations