@Test public void testExpandVersionInCapabilities() throws Exception { subject = new IUXmlTransformer(); IU iu = IU.read(new File(TestUtil.getBasedir("projects/iuXmlValueReplacement/"), "p2iu.xml")); subject.replaceQualifierInCapabilities(iu.getProvidedCapabilites(), "CAPABILITY"); assertThat(iu.getProvidedCapabilites(), hasItem(capability("anotherId", "2.0.0.CAPABILITY"))); assertThat(iu.getProvidedCapabilites(), hasItem(capability("demo.iu", "1.0.0.CAPABILITY"))); assertThat(iu.getProvidedCapabilites(), hasItem(capability("demo.iu", "1.1.1.CAPABILITY"))); }
public void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier) { if (providedCapabilities == null) return; for (Element capability : providedCapabilities) { String currentVersion = capability.getAttributeValue(IU.VERSION); if (hasQualifier(currentVersion)) capability.setAttribute(IU.VERSION, currentVersion.replaceAll("qualifier", qualifier)); } }
IUXmlTransformer { public void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier) { if (providedCapabilities == null) return; for (Element capability : providedCapabilities) { String currentVersion = capability.getAttributeValue(IU.VERSION); if (hasQualifier(currentVersion)) capability.setAttribute(IU.VERSION, currentVersion.replaceAll("qualifier", qualifier)); } } }
IUXmlTransformer { public void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier) { if (providedCapabilities == null) return; for (Element capability : providedCapabilities) { String currentVersion = capability.getAttributeValue(IU.VERSION); if (hasQualifier(currentVersion)) capability.setAttribute(IU.VERSION, currentVersion.replaceAll("qualifier", qualifier)); } } IUXmlTransformer();  IUXmlTransformer(Logger log); }
IUXmlTransformer { public void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier) { if (providedCapabilities == null) return; for (Element capability : providedCapabilities) { String currentVersion = capability.getAttributeValue(IU.VERSION); if (hasQualifier(currentVersion)) capability.setAttribute(IU.VERSION, currentVersion.replaceAll("qualifier", qualifier)); } } IUXmlTransformer();  IUXmlTransformer(Logger log); void replaceSelfQualifiers(IU iu, String version, String qualifier); void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier); void replaceQualifierInRequirements(IU iu, TargetPlatform targetPlatform); void replaceZerosInRequirements(IU iu, TargetPlatform targetPlatform); void injectMavenProperties(IU iu, MavenProject project); void addSelfCapability(IU iu); }
IUXmlTransformer { public void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier) { if (providedCapabilities == null) return; for (Element capability : providedCapabilities) { String currentVersion = capability.getAttributeValue(IU.VERSION); if (hasQualifier(currentVersion)) capability.setAttribute(IU.VERSION, currentVersion.replaceAll("qualifier", qualifier)); } } IUXmlTransformer();  IUXmlTransformer(Logger log); void replaceSelfQualifiers(IU iu, String version, String qualifier); void replaceQualifierInCapabilities(List<Element> providedCapabilities, String qualifier); void replaceQualifierInRequirements(IU iu, TargetPlatform targetPlatform); void replaceZerosInRequirements(IU iu, TargetPlatform targetPlatform); void injectMavenProperties(IU iu, MavenProject project); void addSelfCapability(IU iu);  }