private void processVdb( final Collection<BaseArtifactType> derivedArtifacts, final ExtendedDocument vdbArtifact, final Element vdb, final XPath xpath ) throws Exception { { // name final String name = vdb.getAttribute(VdbManifest.ManifestId.NAME); vdbArtifact.setName(name); } // description setDescriptionFromElementValue(vdb, XmlId.DESCRIPTION, vdbArtifact, xpath); // version setVdbVersion(vdb, VdbManifest.ManifestId.VERSION, vdbArtifact, VdbManifest.PropertyId.VERSION); if (LOGGER.isDebugEnabled()) { LOGGER.debug("VdbManifestDeriver:VDB name '{}'", vdbArtifact.getName()); //$NON-NLS-1$ LOGGER.debug("VdbManifestDeriver:VDB description '{}'", vdbArtifact.getDescription()); //$NON-NLS-1$ LOGGER.debug("VdbManifestDeriver:VDB version '{}'", vdbArtifact.getVersion()); //$NON-NLS-1$ } processProperties(vdbArtifact, vdb, xpath); // derive artifacts processVdbImports(derivedArtifacts, vdbArtifact, vdb, xpath); processTranslators(derivedArtifacts, vdbArtifact, vdb, xpath); processDataRoles(derivedArtifacts, vdbArtifact, vdb, xpath); processEntries(derivedArtifacts, vdbArtifact, vdb, xpath); processSchemas(derivedArtifacts, vdbArtifact, vdb, xpath); }
/** * Test method for {@link org.overlord.sramp.integration.switchyard.deriver.SwitchYardXmlDeriver#derive(java.util.Collection, org.s_ramp.xmlns._2010.s_ramp.BaseArtifactType, org.w3c.dom.Element, javax.xml.xpath.XPath)}. * @throws IOException */ @Test public void testJavaDeriver() throws IOException { MavenPomDeriver deriver = new MavenPomDeriver(); ExtendedDocument artifact = new ExtendedDocument(); artifact.setArtifactType(BaseArtifactEnum.EXTENDED_ARTIFACT_TYPE); artifact.setName("pom.xml"); //$NON-NLS-1$ InputStream is = getClass().getResourceAsStream("pom.xml"); //$NON-NLS-1$ // Derive @SuppressWarnings("unused") Collection<BaseArtifactType> derivedArtifacts = deriver.derive(artifact, is); is.close(); // Assert Assert.assertNotNull(artifact.getProperty()); for (Property property : artifact.getProperty()) { System.out.println(property.getPropertyName() + " - " + property.getPropertyValue()); } System.out.println(artifact.getDescription()); }
assertThat(this.vdbManifestArtifact.getDescription(), is("vdb description")); assertThat(this.vdbManifestArtifact.getVersion(), is("3")); assertPropertyValue(this.vdbManifestArtifact, VdbManifest.PropertyId.VERSION, "3");
assertThat(this.vdbManifestArtifact.getDescription(), is("Shows how to call Web Services")); assertThat(this.vdbManifestArtifact.getVersion(), is("1")); assertPropertyValue(this.vdbManifestArtifact, VdbManifest.PropertyId.VERSION, "1");