Search in sources :

Example 1 with StandardScriptEvaluator

use of org.forgerock.openam.scripting.StandardScriptEvaluator 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);
}
Also used : StandardScriptEngineManager(org.forgerock.openam.scripting.StandardScriptEngineManager) StandardScriptEvaluator(org.forgerock.openam.scripting.StandardScriptEvaluator) ScriptObject(org.forgerock.openam.scripting.ScriptObject) GroovyScriptEngineFactory(org.codehaus.groovy.jsr223.GroovyScriptEngineFactory) SupportedScriptingLanguage(org.forgerock.openam.scripting.SupportedScriptingLanguage) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

GroovyScriptEngineFactory (org.codehaus.groovy.jsr223.GroovyScriptEngineFactory)1 ScriptObject (org.forgerock.openam.scripting.ScriptObject)1 StandardScriptEngineManager (org.forgerock.openam.scripting.StandardScriptEngineManager)1 StandardScriptEvaluator (org.forgerock.openam.scripting.StandardScriptEvaluator)1 SupportedScriptingLanguage (org.forgerock.openam.scripting.SupportedScriptingLanguage)1 BeforeClass (org.testng.annotations.BeforeClass)1