private InputModel parseInput(Element element) { InputModel input = new InputModel(element.getAttribute("name"), element.getAttribute("value")); input.setType(element.getAttribute("type")); input.setRequired(element.getAttribute("required")); return input; }
public Model createCopy() { InputModel copy = new InputModel(getName(), getValue()); super.fillCopy(copy); return copy; } }
private InputModel parseInput(Element element) { InputModel input = new InputModel(element.getAttribute("name"), element.getAttribute("value")); input.setType(element.getAttribute("type")); input.setRequired(element.getAttribute("required")); return input; }
private InputModel parseInput(Element element) { InputModel input = new InputModel(element.getAttribute("name"), element.getAttribute("value")); input.setType(element.getAttribute("type")); input.setRequired(element.getAttribute("required")); return input; }
public Model createCopy() { InputModel copy = new InputModel(getName(), getValue()); super.fillCopy(copy); return copy; } }
public void testNotMergeable() { InputModel child = new InputModel("child", "childvalue"); InputModel parent = new InputModel("parent", "parentvalue"); assertFalse(child.isMergeableWith(parent)); }
public void testMerge() { InputModel child = new InputModel("child", "childvalue"); InputModel parent = new InputModel("child", "parentvalue"); parent.setType("parenttype"); child.merge(parent); assertEquals("parenttype", child.getType()); }
public void testNotMergeableWithNull() { InputModel child = new InputModel("child", "childvalue"); assertFalse(child.isMergeableWith(null)); }
public void testMergeable() { InputModel child = new InputModel("child", "childvalue"); assertTrue(child.isMergeableWith(child)); }
public void testMergeMappings() { FlowModel child = new FlowModel(); FlowModel parent = new FlowModel(); InputModel input1 = new InputModel("name", "value"); input1.setType("type"); input1.setType("required"); InputModel input2 = new InputModel("name2", "value2"); input2.setType("type2"); input2.setRequired("required2"); InputModel input3 = new InputModel("name3", "value3"); input2.setType("type3"); input2.setRequired("required3"); child.setInputs(asList(input1, input2, input3)); InputModel parentInput = new InputModel("name3", "value3"); parentInput.setType("type3"); parentInput.setRequired("required3"); parent.setInputs(asList(parentInput)); child.merge(parent); assertEquals(3, child.getInputs().size()); }
public void testFlowInputOutputMapping() { InputModel input1 = new InputModel("foo", "flowScope.foo"); InputModel input2 = new InputModel("foo", "flowScope.bar"); InputModel input3 = new InputModel("number", "flowScope.baz"); input3.setType("integer"); InputModel input4 = new InputModel("required", "flowScope.boop"); input4.setRequired("true"); model.setInputs(asList(input1, input2, input3, input4));