* Test that getChildren() sorts returned elements and attributes
* as required i.e. all attributes must come before all elements and
* both elements and attributes must be ordered alphabetically.
*/
public void testGetChildrenSorting() {
JDOMFactory factory = new DefaultJDOMFactory();
Element parent1 = factory.element("parent1");
Element child1a = factory.element("child1a");
Element child2a = factory.element("child2a");
parent1.addContent(child2a);
parent1.addContent(child1a);
Element parent2 = factory.element("parent2");
Element child1b = factory.element("child1b");
Element child2b = factory.element("child2b");
parent2.addContent(child1b);
parent2.addContent(child2b);
Element root = factory.element("root");
root.addContent(parent2);
root.addContent(parent1);
Attribute rootAttr1 = factory.attribute("rootAttr1", "value");
Attribute rootAttr2 = factory.attribute("rootAttr2", "value");
Attribute parentAttr1 = factory.attribute("parentAttr1", "value");
root.setAttribute(rootAttr2);
root.setAttribute(rootAttr1);
parent1.setAttribute(parentAttr1);