Search in sources :

Example 6 with ScriptEngineRegistry

use of org.elasticsearch.script.ScriptEngineRegistry in project elasticsearch by elastic.

the class AbstractScriptTestCase method init.

@Before
public void init() throws Exception {
    Settings settings = Settings.builder().put("path.home", createTempDir()).put(ScriptService.SCRIPT_AUTO_RELOAD_ENABLED_SETTING.getKey(), false).build();
    ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(Arrays.asList(new MustacheScriptEngineService()));
    ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Collections.emptyList());
    ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, scriptContextRegistry);
    ScriptService scriptService = new ScriptService(settings, new Environment(settings), null, scriptEngineRegistry, scriptContextRegistry, scriptSettings);
    templateService = new InternalTemplateService(scriptService);
}
Also used : ScriptService(org.elasticsearch.script.ScriptService) ScriptSettings(org.elasticsearch.script.ScriptSettings) ScriptEngineRegistry(org.elasticsearch.script.ScriptEngineRegistry) Environment(org.elasticsearch.env.Environment) Settings(org.elasticsearch.common.settings.Settings) ScriptSettings(org.elasticsearch.script.ScriptSettings) MustacheScriptEngineService(org.elasticsearch.script.mustache.MustacheScriptEngineService) ScriptContextRegistry(org.elasticsearch.script.ScriptContextRegistry) Before(org.junit.Before)

Aggregations

Environment (org.elasticsearch.env.Environment)6 ScriptContextRegistry (org.elasticsearch.script.ScriptContextRegistry)6 ScriptEngineRegistry (org.elasticsearch.script.ScriptEngineRegistry)6 ScriptService (org.elasticsearch.script.ScriptService)6 ScriptSettings (org.elasticsearch.script.ScriptSettings)6 Settings (org.elasticsearch.common.settings.Settings)5 MockScriptEngine (org.elasticsearch.script.MockScriptEngine)3 Script (org.elasticsearch.script.Script)3 ResourceWatcherService (org.elasticsearch.watcher.ResourceWatcherService)3 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ElasticsearchException (org.elasticsearch.ElasticsearchException)2 IndexSettings (org.elasticsearch.index.IndexSettings)2 Collections (java.util.Collections)1 List (java.util.List)1 Function (java.util.function.Function)1 IndexRequest (org.elasticsearch.action.index.IndexRequest)1 BytesArray (org.elasticsearch.common.bytes.BytesArray)1