test_class.file: app-cleaner/src/test/java/com/kdgregory/pomutil/cleaner/transform/TestNormalizePlugins.java
test_class.identifier: TestNormalizePlugins
test_class.superclass: extends AbstractTransformerTest
test_case.body: @Test
      public void testBasicOperation() throws Exception
      {
          new NormalizePlugins(loadPom("cleaner/PluginNormalize1.xml")).transform();
  
          Element plug1 = newXPath("//mvn:artifactId[text()='maven-antrun-plugin']/..").evaluateAsElement(dom());
          List<Element> children1 = DomUtil.getChildren(plug1);
          assertEquals("plugin #1, #/children", 3, children1.size());
          assertEquals("plugin #1, child #1 name",  "groupId",                  DomUtil.getLocalName(children1.get(0)));
          assertEquals("plugin #1, child #1 value", "org.apache.maven.plugins", DomUtil.getText(children1.get(0)));
          assertEquals("plugin #1, child #2 name",  "artifactId",               DomUtil.getLocalName(children1.get(1)));
          assertEquals("plugin #1, child #2 value", "maven-antrun-plugin",      DomUtil.getText(children1.get(1)));
          assertEquals("plugin #1, child #3 name",  "version",                  DomUtil.getLocalName(children1.get(2)));
          assertEquals("plugin #1, child #3 value", "1.3",                      DomUtil.getText(children1.get(2)));
  
          Element plug2 = newXPath("//mvn:artifactId[text()='cobertura-maven-plugin']/..").evaluateAsElement(dom());
          List<Element> children2 = DomUtil.getChildren(plug2);
          assertEquals("plugin #2, #/children", 3, children2.size());
          assertEquals("plugin #2, child #1 name",  "groupId",                  DomUtil.getLocalName(children2.get(0)));
          assertEquals("plugin #2, child #1 value", "org.codehaus.mojo",        DomUtil.getText(children2.get(0)));
          assertEquals("plugin #2, child #2 name",  "artifactId",               DomUtil.getLocalName(children2.get(1)));
          assertEquals("plugin #2, child #2 value", "cobertura-maven-plugin",   DomUtil.getText(children2.get(1)));
          assertEquals("plugin #2, child #3 name",  "configuration",            DomUtil.getLocalName(children2.get(2)));
  
          Element plug3 = newXPath("//mvn:artifactId[text()='maven-site-plugin']/..").evaluateAsElement(dom());
          List<Element> children3 = DomUtil.getChildren(plug3);
          assertEquals("plugin #3, #/children", 3, children3.size());
          assertEquals("plugin #3, child #1 name",  "groupId",                  DomUtil.getLocalName(children3.get(0)));
          assertEquals("plugin #3, child #1 value", "org.apache.maven.plugins", DomUtil.getText(children3.get(0)));
          assertEquals("plugin #3, child #2 name",  "artifactId",               DomUtil.getLocalName(children3.get(1)));
          assertEquals("plugin #3, child #2 value", "maven-site-plugin",        DomUtil.getText(children3.get(1)));
          assertEquals("plugin #3, child #3 name",  "version",                  DomUtil.getLocalName(children3.get(2)));
          assertEquals("plugin #3, child #3 value", "2.0.1",                    DomUtil.getText(children3.get(2)));
      }
test_case.class_method_signature: TestNormalizePlugins.testBasicOperation()
test_case.full_signature: @Test public void testBasicOperation()
test_case.identifier: testBasicOperation
test_case.invocations: transform loadPom evaluateAsElement newXPath dom getChildren assertEquals size assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get assertEquals getText get evaluateAsElement newXPath dom getChildren assertEquals size assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get evaluateAsElement newXPath dom getChildren assertEquals size assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get assertEquals getText get assertEquals getLocalName get assertEquals getText get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBasicOperation()
focal_class.declarator: STANDARD_CHILDREN = new String[] {
              "groupId", "artifactId", "version",
              "extensions", "inherited", "configuration",
              "dependencies", "executions"
              }
focal_class.modifier: private static final
focal_class.original_string: private static final String[] STANDARD_CHILDREN = new String[] {
              "groupId", "artifactId", "version",
              "extensions", "inherited", "configuration",
              "dependencies", "executions"
              };
focal_class.type: String[]
focal_class.var_name: STANDARD_CHILDREN
focal_class.declarator: disabled
focal_class.modifier: private
focal_class.original_string: private boolean disabled;
focal_class.type: boolean
focal_class.var_name: disabled
focal_class.file: app-cleaner/src/main/java/com/kdgregory/pomutil/cleaner/transform/NormalizePlugins.java
focal_class.identifier: NormalizePlugins
focal_class.class_method_signature: NormalizePlugins.NormalizePlugins(PomWrapper pom, CommandLine args)
focal_class.full_signature: public  NormalizePlugins(PomWrapper pom, CommandLine args)
focal_class.identifier: NormalizePlugins
focal_class.modifiers: public
focal_class.parameters: (PomWrapper pom, CommandLine args)
focal_class.signature:  NormalizePlugins(PomWrapper pom, CommandLine args)
focal_class.class_method_signature: NormalizePlugins.NormalizePlugins(PomWrapper pom)
focal_class.full_signature: public  NormalizePlugins(PomWrapper pom)
focal_class.identifier: NormalizePlugins
focal_class.modifiers: public
focal_class.parameters: (PomWrapper pom)
focal_class.signature:  NormalizePlugins(PomWrapper pom)
focal_class.class_method_signature: NormalizePlugins.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.superclass: extends AbstractTransformer
focal_method.body: @Override
      public void transform()
      {
          if (disabled)
              return;
  
          for (Element plugin : selectAllPlugins())
          {
              if (DomUtil.getChild(plugin, "groupId") == null)
              {
                  Element groupId = DomUtil.appendChildInheritNamespace(plugin, "groupId");
                  DomUtil.setText(groupId, "org.apache.maven.plugins");
              }
              Utils.reconstruct(plugin, STANDARD_CHILDREN);
          }
      }
focal_method.class_method_signature: NormalizePlugins.transform()
focal_method.full_signature: @Override public void transform()
focal_method.identifier: transform
focal_method.invocations: selectAllPlugins getChild appendChildInheritNamespace setText reconstruct
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void transform()