test_class.file: app-cleaner/src/test/java/com/kdgregory/pomutil/cleaner/transform/TestReplaceExplicitVersionsWithProperties.java
test_class.identifier: TestReplaceExplicitVersionsWithProperties
test_class.superclass: extends AbstractTransformerTest
test_case.body: @Test
      public void testSameGroupSameVersion() throws Exception
      {
          new ReplaceExplicitVersionsWithProperties(loadPom("cleaner/VersionProps5.xml")).transform();
  
          assertEquals("should only be one property added", 1, newXPath("/mvn:project/mvn:properties/*").evaluate(dom()).size());
  
          assertProperty("org.springframework.version",                       "3.1.2.RELEASE");
  
          assertDependencyReference("org.springframework", "spring-tx",       "${org.springframework.version}");
          assertDependencyReference("org.springframework", "spring-core",     "${org.springframework.version}");
          assertDependencyReference("org.springframework", "spring-context",  "${org.springframework.version}");
      }
test_case.class_method_signature: TestReplaceExplicitVersionsWithProperties.testSameGroupSameVersion()
test_case.full_signature: @Test public void testSameGroupSameVersion()
test_case.identifier: testSameGroupSameVersion
test_case.invocations: transform loadPom assertEquals size evaluate newXPath dom assertProperty assertDependencyReference assertDependencyReference assertDependencyReference
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSameGroupSameVersion()
focal_class.declarator: logger = LoggerFactory.getLogger(getClass())
focal_class.original_string: Logger logger = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: logger
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.declarator: replaceExisting
focal_class.modifier: private
focal_class.original_string: private boolean replaceExisting;
focal_class.type: boolean
focal_class.var_name: replaceExisting
focal_class.declarator: disablePlugins
focal_class.modifier: private
focal_class.original_string: private boolean disablePlugins;
focal_class.type: boolean
focal_class.var_name: disablePlugins
focal_class.declarator: groupsToAppendArtifactId
focal_class.modifier: private
focal_class.original_string: private Set<String> groupsToAppendArtifactId;
focal_class.type: Set<String>
focal_class.var_name: groupsToAppendArtifactId
focal_class.file: app-cleaner/src/main/java/com/kdgregory/pomutil/cleaner/transform/ReplaceExplicitVersionsWithProperties.java
focal_class.identifier: ReplaceExplicitVersionsWithProperties
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.ReplaceExplicitVersionsWithProperties(PomWrapper pom, CommandLine args)
focal_class.full_signature: public  ReplaceExplicitVersionsWithProperties(PomWrapper pom, CommandLine args)
focal_class.identifier: ReplaceExplicitVersionsWithProperties
focal_class.modifiers: public
focal_class.parameters: (PomWrapper pom, CommandLine args)
focal_class.signature:  ReplaceExplicitVersionsWithProperties(PomWrapper pom, CommandLine args)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.ReplaceExplicitVersionsWithProperties(PomWrapper pom)
focal_class.full_signature: public  ReplaceExplicitVersionsWithProperties(PomWrapper pom)
focal_class.identifier: ReplaceExplicitVersionsWithProperties
focal_class.modifiers: public
focal_class.parameters: (PomWrapper pom)
focal_class.signature:  ReplaceExplicitVersionsWithProperties(PomWrapper pom)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.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: ReplaceExplicitVersionsWithProperties.replaceExistingDependencyProps(List<Element> dependencies, Map<String,String> properties)
focal_class.full_signature: private Set<String> replaceExistingDependencyProps(List<Element> dependencies, Map<String,String> properties)
focal_class.identifier: replaceExistingDependencyProps
focal_class.modifiers: private
focal_class.parameters: (List<Element> dependencies, Map<String,String> properties)
focal_class.return: Set<String>
focal_class.signature: Set<String> replaceExistingDependencyProps(List<Element> dependencies, Map<String,String> properties)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.removeReplacedProperties(Set<String> propNames)
focal_class.full_signature: private void removeReplacedProperties(Set<String> propNames)
focal_class.identifier: removeReplacedProperties
focal_class.modifiers: private
focal_class.parameters: (Set<String> propNames)
focal_class.return: void
focal_class.signature: void removeReplacedProperties(Set<String> propNames)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.updateDependencies(List<Element> dependencies, Map<String,String> props)
focal_class.full_signature: private Set<String> updateDependencies(List<Element> dependencies, Map<String,String> props)
focal_class.identifier: updateDependencies
focal_class.modifiers: private
focal_class.parameters: (List<Element> dependencies, Map<String,String> props)
focal_class.return: Set<String>
focal_class.signature: Set<String> updateDependencies(List<Element> dependencies, Map<String,String> props)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.generatePropertyName(Map<String,String> props, Element dependency)
focal_class.full_signature: private String generatePropertyName(Map<String,String> props, Element dependency)
focal_class.identifier: generatePropertyName
focal_class.modifiers: private
focal_class.parameters: (Map<String,String> props, Element dependency)
focal_class.return: String
focal_class.signature: String generatePropertyName(Map<String,String> props, Element dependency)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.updateDependency(Element dependency, String version)
focal_class.full_signature: private void updateDependency(Element dependency, String version)
focal_class.identifier: updateDependency
focal_class.modifiers: private
focal_class.parameters: (Element dependency, String version)
focal_class.return: void
focal_class.signature: void updateDependency(Element dependency, String version)
focal_class.class_method_signature: ReplaceExplicitVersionsWithProperties.addNewProperties(Map<String,String> props, Set<String> newProps)
focal_class.full_signature: private void addNewProperties(Map<String,String> props, Set<String> newProps)
focal_class.identifier: addNewProperties
focal_class.modifiers: private
focal_class.parameters: (Map<String,String> props, Set<String> newProps)
focal_class.return: void
focal_class.signature: void addNewProperties(Map<String,String> props, Set<String> newProps)
focal_class.superclass: extends AbstractTransformer
focal_method.body: @Override
      public void transform()
      {
          if (disabled)
              return;
  
          Map<String,String> allProps = pom.getProperties();
          List<Element> dependencies = selectAllDependencies();
          if (! disablePlugins)
              dependencies.addAll(selectAllPlugins());
  
          if (replaceExisting)
          {
              Set<String> oldProps = replaceExistingDependencyProps(dependencies, allProps);
              removeReplacedProperties(oldProps);
          }
  
          Set<String> newProps = updateDependencies(dependencies, allProps);
          addNewProperties(allProps, newProps);
      }
focal_method.class_method_signature: ReplaceExplicitVersionsWithProperties.transform()
focal_method.full_signature: @Override public void transform()
focal_method.identifier: transform
focal_method.invocations: getProperties selectAllDependencies addAll selectAllPlugins replaceExistingDependencyProps removeReplacedProperties updateDependencies addNewProperties
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void transform()