public Model createCopy() { DecisionStateModel copy = new DecisionStateModel(getId()); super.fillCopy(copy); copy.setIfs(copyList(ifs)); copy.setOnExitActions(copyList(onExitActions)); return copy; }
private DecisionStateModel parseDecisionState(Element element) { DecisionStateModel state = new DecisionStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setIfs(parseIfs(element)); state.setOnExitActions(parseOnExitActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); return state; }
public void testNotMergeable() { DecisionStateModel child = new DecisionStateModel("child"); DecisionStateModel parent = new DecisionStateModel("parent"); assertFalse(child.isMergeableWith(parent)); }
public void testMergeable() { DecisionStateModel child = new DecisionStateModel("child"); assertTrue(child.isMergeableWith(child)); }
public void testNotMergeableWithNull() { DecisionStateModel child = new DecisionStateModel("child"); assertFalse(child.isMergeableWith(null)); }
public Model createCopy() { DecisionStateModel copy = new DecisionStateModel(getId()); super.fillCopy(copy); copy.setIfs(copyList(ifs)); copy.setOnExitActions(copyList(onExitActions)); return copy; }
private DecisionStateModel parseDecisionState(Element element) { DecisionStateModel state = new DecisionStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setIfs(parseIfs(element)); state.setOnExitActions(parseOnExitActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); return state; }
private DecisionStateModel parseDecisionState(Element element) { DecisionStateModel state = new DecisionStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setIfs(parseIfs(element)); state.setOnExitActions(parseOnExitActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); return state; }
public void testMerge() { DecisionStateModel child = new DecisionStateModel("child"); DecisionStateModel parent = new DecisionStateModel("child"); parent.setSecured(new SecuredModel("secured")); LinkedList<IfModel> ifs = new LinkedList<>(); ifs.add(new IfModel("test", "foo")); parent.setIfs(ifs); child.merge(parent); assertNotNull(child.getSecured()); assertNotNull("test", child.getIfs().get(0).getTest()); }
public void testMergeStates() { FlowModel child = new FlowModel(); child.setStates(asList(new ViewStateModel("view"), new EndStateModel("end"))); FlowModel parent = new FlowModel(); ViewStateModel view = new ViewStateModel("view"); view.setView("jsp"); parent.setStates(asList(view, new DecisionStateModel("decider"), new ActionStateModel("action"))); child.merge(parent); assertEquals(4, child.getStates().size()); assertEquals("jsp", ((ViewStateModel) child.getStates().get(0)).getView()); }