private SetModel parseSet(Element element) { SetModel set = new SetModel(element.getAttribute("name"), element.getAttribute("value")); set.setType(element.getAttribute("type")); set.setAttributes(parseAttributes(element)); return set; }
public Model createCopy() { final SetModel copy = new SetModel(name, value); super.fillCopy(copy); copy.setType(type); return copy; }
private SetModel parseSet(Element element) { SetModel set = new SetModel(element.getAttribute("name"), element.getAttribute("value")); set.setType(element.getAttribute("type")); set.setAttributes(parseAttributes(element)); return set; }
private SetModel parseSet(Element element) { SetModel set = new SetModel(element.getAttribute("name"), element.getAttribute("value")); set.setType(element.getAttribute("type")); set.addAttributes(parseAttributes(element)); return set; }
public Model createCopy() { final SetModel copy = new SetModel(name, value); super.fillCopy(copy); copy.setType(type); return copy; }
public void testSetActionWithResultType() throws Exception { SetModel setModel = new SetModel("flowScope.stringArray", "intArray"); setModel.setType("java.lang.String[]"); model.setOnStartActions(asList(setModel)); model.setStates(asList(new ViewStateModel("view"))); Flow flow = getFlow(model); AnnotatedAction action = (AnnotatedAction) flow.getStartActionList().get(0); MockRequestContext context = new MockRequestContext(flow); context.getFlowScope().put("intArray", new int[] { 1, 2 }); action.execute(context); String[] expected = (String[]) context.getFlowScope().get("stringArray"); assertEquals("1", expected[0]); assertEquals("2", expected[1]); }