MappingElement element = new MappingElement("Test"); //$NON-NLS-1$
assertNull(element.getSource());
}
public void testChildren() {
MappingElement element = new MappingElement("Test"); //$NON-NLS-1$
element.addCommentNode(new MappingCommentNode("this is comment text")); //$NON-NLS-1$
element.addAttribute(new MappingAttribute("foo", "fooReal")); //$NON-NLS-1$ //$NON-NLS-2$
element.addChildElement(new MappingElement("child1")); //$NON-NLS-1$
element.addChoiceNode(new MappingChoiceNode());
element.addSequenceNode(new MappingSequenceNode());
element.addAllNode(new MappingAllNode());
assertEquals(5, element.getNodeChildren().size());
assertEquals(1, element.getAttributes().size());
List list = element.getNodeChildren();
assertTrue(list.get(0) instanceof MappingCommentNode);
assertTrue(list.get(1) instanceof MappingElement);
assertTrue(list.get(2) instanceof MappingChoiceNode);
assertTrue(list.get(3) instanceof MappingSequenceNode);
assertTrue(list.get(4) instanceof MappingAllNode);