public Model createCopy() { AttributeModel copy = new AttributeModel(name, value); copy.setType(type); return copy; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
public Model createCopy() { AttributeModel copy = new AttributeModel(name, value); copy.setType(type); return copy; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
public void testNotMergeable() { AttributeModel child = new AttributeModel("child", "value"); AttributeModel parent = new AttributeModel("parent", "value"); assertFalse(child.isMergeableWith(parent)); }
public void testNotMergeableWithNull() { AttributeModel child = new AttributeModel("child", "value"); assertFalse(child.isMergeableWith(null)); }
public void testMergeModel() { AttributeModel parent = new AttributeModel("foo", "bar"); AttributeModel child = new AttributeModel("foo", null); FlowModel model = new FlowModel(); model.merge(child, parent); assertEquals("bar", child.getValue()); }
public void testMerge() { AttributeModel child = new AttributeModel("child", "childvalue"); AttributeModel parent = new AttributeModel("child", "childvalue"); parent.setType("string"); child.merge(parent); assertEquals("string", child.getType()); }
public void testMergeable() { AttributeModel child = new AttributeModel("child", "value"); assertTrue(child.isMergeableWith(child)); }
public void testMergeParentCreateCopy() { AttributeModel parent = new AttributeModel("foo", "bar"); AttributeModel child = null; FlowModel model = new FlowModel(); child = (AttributeModel) model.merge(child, parent); assertEquals("bar", child.getValue()); assertNotSame(parent, child); }
public void testMergeAttributes() { FlowModel child = new FlowModel(); FlowModel parent = new FlowModel(); child.setAttributes(asList(new AttributeModel("name", "value"))); AttributeModel parentAttribute1 = new AttributeModel("name", "value"); parentAttribute1.setType("type"); AttributeModel parentAttribute2 = new AttributeModel("name2", "value2"); parentAttribute2.setType("type2"); parent.setAttributes(asList(parentAttribute1, parentAttribute2)); child.merge(parent); assertEquals(2, child.getAttributes().size()); assertEquals("name", child.getAttributes().get(0).getName()); assertEquals("type", child.getAttributes().get(0).getType()); assertEquals("name2", child.getAttributes().get(1).getName()); assertEquals("type2", child.getAttributes().get(1).getType()); }
public void testCustomFlowAttribute() { AttributeModel attribute1 = new AttributeModel("foo", "bar"); AttributeModel attribute2 = new AttributeModel("number", "1"); attribute2.setType("integer"); model.setAttributes(asList(attribute1, attribute2)); model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("bar", flow.getAttributes().get("foo")); assertEquals(1, flow.getAttributes().get("number")); }
public void testCopyModel() { AttributeModel model = new AttributeModel("foo", "bar"); FlowModel m = new FlowModel(); AttributeModel copy = (AttributeModel) m.copy(model); assertEquals("foo", copy.getName()); assertEquals("bar", copy.getValue()); }
attributes.add(new AttributeModel("foo", "bar")); parent.setAttributes(attributes);