StandAloneScenarioScript extends Script { public void shockList(Closure<?> body) { ShocksDelegate delegate = new ShocksDelegate(); body.setDelegate(delegate); body.setResolveStrategy(Closure.DELEGATE_FIRST); body.call(); _scenarioParamList.addAll(delegate.list()); } StandAloneScenarioScript(); void view(Closure<?> body); void shockGrid(Closure<?> body); void shockList(Closure<?> body); void scenarios(Closure<?> body);  }
@Test public void shockList() { String scriptText = "shockList {\n" + " foo = [1, 2, 3]\n" + " bar = ['a', 'b', 'c']\n" + "}"; StandAloneScenarioScript script = createScript(scriptText); List<Map<String,Object>> params = script.getScenarioParameterList(); assertEquals(3, params.size()); assertEquals(1, params.get(0).get(FOO)); assertEquals("a", params.get(0).get(BAR)); assertEquals(2, params.get(1).get(FOO)); assertEquals("b", params.get(1).get(BAR)); assertEquals(3, params.get(2).get(FOO)); assertEquals("c", params.get(2).get(BAR)); }