public void testSaveAs_Sorted() throws Exception {
File testFolder = setupTestDirectory("testSaveAs_Sorted");
DataChannelDescriptor rootNode = new DataChannelDescriptor();
rootNode.setName("test");
// add maps and nodes in reverse alpha order. Check that they are saved in alpha
// order
rootNode.getDataMaps().add(new DataMap("C"));
rootNode.getDataMaps().add(new DataMap("B"));
rootNode.getDataMaps().add(new DataMap("A"));
DataNodeDescriptor[] nodes = new DataNodeDescriptor[3];
nodes[0] = new DataNodeDescriptor("Z");
nodes[1] = new DataNodeDescriptor("Y");
nodes[2] = new DataNodeDescriptor("X");
nodes[0].getDataMapNames().add("C");
nodes[0].getDataMapNames().add("B");
nodes[0].getDataMapNames().add("A");
rootNode.getNodeDescriptors().addAll(Arrays.asList(nodes));
Project project = new Project(new ConfigurationTree<DataChannelDescriptor>(
rootNode));
saver.saveAs(project, new URLResource(testFolder.toURL()));