test_class.file: app-cleaner/src/test/java/com/kdgregory/pomutil/cleaner/transform/TestOrganizePom.java
test_class.identifier: TestOrganizePom
test_class.superclass: extends AbstractTransformerTest
test_case.body: @Test
      public void testUnrecognizedChildrenAreRetained() throws Exception
      {
          loadPom("cleaner/OrganizePom2.xml");
          Element root = dom().getDocumentElement();
  
          List<Element> initialChildren = DomUtil.getChildren(root);
          assertEquals("number of children before organize", 7, initialChildren.size());
  
          CommandLine args = new CommandLine("--organizePom");
          new OrganizePom(pom, args).transform();
  
          List<Element> children = DomUtil.getChildren(root);
          assertEquals("number of children after organize", 7, children.size());
  
          assertEquals("child 0 name", "modelVersion",    children.get(0).getLocalName());
          assertEquals("child 1 name", "groupId",         children.get(1).getLocalName());
          assertEquals("child 2 name", "artifactId",      children.get(2).getLocalName());
          assertEquals("child 3 name", "version",         children.get(3).getLocalName());
          assertEquals("child 4 name", "packaging",       children.get(4).getLocalName());
          assertEquals("child 5 name", "description",     children.get(5).getLocalName());
          assertEquals("child 6 name", "argle",           children.get(6).getLocalName());
      }
test_case.class_method_signature: TestOrganizePom.testUnrecognizedChildrenAreRetained()
test_case.full_signature: @Test public void testUnrecognizedChildrenAreRetained()
test_case.identifier: testUnrecognizedChildrenAreRetained
test_case.invocations: loadPom getDocumentElement dom getChildren assertEquals size transform getChildren assertEquals size assertEquals getLocalName get assertEquals getLocalName get assertEquals getLocalName get assertEquals getLocalName get assertEquals getLocalName get assertEquals getLocalName get assertEquals getLocalName get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUnrecognizedChildrenAreRetained()
focal_class.declarator: enabled
focal_class.modifier: private
focal_class.original_string: private boolean enabled;
focal_class.type: boolean
focal_class.var_name: enabled
focal_class.file: app-cleaner/src/main/java/com/kdgregory/pomutil/cleaner/transform/OrganizePom.java
focal_class.identifier: OrganizePom
focal_class.class_method_signature: OrganizePom.OrganizePom(PomWrapper pom, CommandLine args)
focal_class.full_signature: public  OrganizePom(PomWrapper pom, CommandLine args)
focal_class.identifier: OrganizePom
focal_class.modifiers: public
focal_class.parameters: (PomWrapper pom, CommandLine args)
focal_class.signature:  OrganizePom(PomWrapper pom, CommandLine args)
focal_class.class_method_signature: OrganizePom.transform()
focal_class.full_signature: @Override public void transform()
focal_class.identifier: transform
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void transform()
focal_class.class_method_signature: OrganizePom.loadPrototype()
focal_class.full_signature: private String[] loadPrototype()
focal_class.identifier: loadPrototype
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] loadPrototype()
focal_class.class_method_signature: OrganizePom.selectElements(Element root)
focal_class.full_signature: private Map<String,Element> selectElements(Element root)
focal_class.identifier: selectElements
focal_class.modifiers: private
focal_class.parameters: (Element root)
focal_class.return: Map<String,Element>
focal_class.signature: Map<String,Element> selectElements(Element root)
focal_class.superclass: extends AbstractTransformer
focal_method.body: @Override
      public void transform()
      {
          if (!enabled)
              return;
  
          String[] expectedElements = loadPrototype();
  
          Element root = pom.getDom().getDocumentElement();
          Map<String,Element> children = selectElements(root);
          Utils.reconstruct(root, children, expectedElements);
      }
focal_method.class_method_signature: OrganizePom.transform()
focal_method.full_signature: @Override public void transform()
focal_method.identifier: transform
focal_method.invocations: loadPrototype getDocumentElement getDom selectElements reconstruct
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void transform()