@Test
    public void testChunking() {
        String script = "{ input myText | chunk chunkerId | summary myChunks | index myChunks }";

        var tester = new ScriptTester();
        tester.chunkers.put("chunkerId", new SentenceChunker());
        var expression = tester.scriptFrom(script);

        SimpleTestAdapter adapter = new SimpleTestAdapter();
        adapter.createField(new Field("myText", DataType.STRING));
        adapter.createField(new Field("myChunks", DataType.getArray(DataType.STRING)));

        expression.resolve(adapter);

        adapter.setValue("myText", new StringFieldValue("Sentence 1. Sentence 2"));
        ExecutionContext context = new ExecutionContext(adapter);
        expression.execute(context);
        var chunks = context.getFieldValue("myChunks");
        assertTrue(chunks instanceof Array);
        var array = (Array<?>)chunks;
        assertEquals(2, array.size());
        assertEquals("Sentence 1.", array.get(0).getWrappedValue());
        assertEquals(" Sentence 2", array.get(1).getWrappedValue());
    }
@author Simon Thoresen Hult
@author bratseth
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java