|
24 | 24 | import org.elasticsearch.test.ESSingleNodeTestCase;
|
25 | 25 | import org.elasticsearch.test.InternalSettingsPlugin;
|
26 | 26 | import org.elasticsearch.xpack.runtimefields.BooleanScriptFieldScript;
|
| 27 | +import org.elasticsearch.xpack.runtimefields.BooleanScriptFieldScriptTests; |
27 | 28 | import org.elasticsearch.xpack.runtimefields.DateScriptFieldScript;
|
28 | 29 | import org.elasticsearch.xpack.runtimefields.DateScriptFieldScriptTests;
|
29 | 30 | import org.elasticsearch.xpack.runtimefields.DoubleScriptFieldScript;
|
| 31 | +import org.elasticsearch.xpack.runtimefields.DoubleScriptFieldScriptTests; |
30 | 32 | import org.elasticsearch.xpack.runtimefields.IpScriptFieldScript;
|
| 33 | +import org.elasticsearch.xpack.runtimefields.IpScriptFieldScriptTests; |
31 | 34 | import org.elasticsearch.xpack.runtimefields.LongScriptFieldScript;
|
| 35 | +import org.elasticsearch.xpack.runtimefields.LongScriptFieldScriptTests; |
32 | 36 | import org.elasticsearch.xpack.runtimefields.RuntimeFields;
|
33 | 37 | import org.elasticsearch.xpack.runtimefields.StringScriptFieldScript;
|
| 38 | +import org.elasticsearch.xpack.runtimefields.StringScriptFieldScriptTests; |
34 | 39 | import org.elasticsearch.xpack.runtimefields.TestScriptEngine;
|
35 | 40 |
|
36 | 41 | import java.io.IOException;
|
@@ -320,59 +325,22 @@ public ScriptEngine getScriptEngine(Settings settings, Collection<ScriptContext<
|
320 | 325 | @Override
|
321 | 326 | protected Object buildScriptFactory(ScriptContext<?> context) {
|
322 | 327 | if (context == BooleanScriptFieldScript.CONTEXT) {
|
323 |
| - return (BooleanScriptFieldScript.Factory) (params, lookup) -> ctx -> new BooleanScriptFieldScript( |
324 |
| - params, |
325 |
| - lookup, |
326 |
| - ctx |
327 |
| - ) { |
328 |
| - @Override |
329 |
| - public void execute() { |
330 |
| - new BooleanScriptFieldScript.Value(this).value(true); |
331 |
| - } |
332 |
| - }; |
| 328 | + return BooleanScriptFieldScriptTests.DUMMY; |
333 | 329 | }
|
334 | 330 | if (context == DateScriptFieldScript.CONTEXT) {
|
335 | 331 | return DateScriptFieldScriptTests.DUMMY;
|
336 | 332 | }
|
337 | 333 | if (context == DoubleScriptFieldScript.CONTEXT) {
|
338 |
| - return (DoubleScriptFieldScript.Factory) (params, lookup) -> ctx -> new DoubleScriptFieldScript( |
339 |
| - params, |
340 |
| - lookup, |
341 |
| - ctx |
342 |
| - ) { |
343 |
| - @Override |
344 |
| - public void execute() { |
345 |
| - new DoubleScriptFieldScript.Value(this).value(1.0); |
346 |
| - } |
347 |
| - }; |
| 334 | + return DoubleScriptFieldScriptTests.DUMMY; |
348 | 335 | }
|
349 | 336 | if (context == IpScriptFieldScript.CONTEXT) {
|
350 |
| - return (IpScriptFieldScript.Factory) (params, lookup) -> ctx -> new IpScriptFieldScript(params, lookup, ctx) { |
351 |
| - @Override |
352 |
| - public void execute() { |
353 |
| - new IpScriptFieldScript.StringValue(this).stringValue("192.168.0.1"); |
354 |
| - } |
355 |
| - }; |
356 |
| - } |
357 |
| - if (context == StringScriptFieldScript.CONTEXT) { |
358 |
| - return (StringScriptFieldScript.Factory) (params, lookup) -> ctx -> new StringScriptFieldScript( |
359 |
| - params, |
360 |
| - lookup, |
361 |
| - ctx |
362 |
| - ) { |
363 |
| - @Override |
364 |
| - public void execute() { |
365 |
| - new StringScriptFieldScript.Value(this).value("test"); |
366 |
| - } |
367 |
| - }; |
| 337 | + return IpScriptFieldScriptTests.DUMMY; |
368 | 338 | }
|
369 | 339 | if (context == LongScriptFieldScript.CONTEXT) {
|
370 |
| - return (LongScriptFieldScript.Factory) (params, lookup) -> ctx -> new LongScriptFieldScript(params, lookup, ctx) { |
371 |
| - @Override |
372 |
| - public void execute() { |
373 |
| - new LongScriptFieldScript.Value(this).value(1); |
374 |
| - } |
375 |
| - }; |
| 340 | + return LongScriptFieldScriptTests.DUMMY; |
| 341 | + } |
| 342 | + if (context == StringScriptFieldScript.CONTEXT) { |
| 343 | + return StringScriptFieldScriptTests.DUMMY; |
376 | 344 | }
|
377 | 345 | throw new IllegalArgumentException("No test script for [" + context + "]");
|
378 | 346 | }
|
|
0 commit comments