private void assertXsd( final SrampArchive srampArchive, final String fileEntryPath ) { final SrampArchiveEntry manifestEntry = srampArchive.getEntry(fileEntryPath); assertThat(manifestEntry, is(not(nullValue()))); final BaseArtifactType manifestArtifact = manifestEntry.getMetaData(); assertThat(manifestArtifact, is(instanceOf(XsdDocument.class))); }
private void assertManifest( final SrampArchive srampArchive ) { final SrampArchiveEntry manifestEntry = srampArchive.getEntry(VdbManifest.PATH); assertThat(manifestEntry, is(not(nullValue()))); final BaseArtifactType manifestArtifact = manifestEntry.getMetaData(); assertThat(manifestArtifact, is(instanceOf(ExtendedDocument.class))); assertThat(((ExtendedDocument)manifestArtifact).getExtendedType(), is(VdbManifest.ARTIFACT_TYPE.extendedType())); }
private void assertModel( final SrampArchive srampArchive, final String modelEntryPath ) { final SrampArchiveEntry manifestEntry = srampArchive.getEntry(modelEntryPath); assertThat(manifestEntry, is(not(nullValue()))); final BaseArtifactType manifestArtifact = manifestEntry.getMetaData(); assertThat(manifestArtifact, is(instanceOf(ExtendedDocument.class))); assertThat(((ExtendedDocument)manifestArtifact).getExtendedType(), is(TeiidArtifactType.MODEL.extendedType())); }
/** * Asserts that the s-ramp archive was properly created. * @param archive * @throws SrampArchiveException */ private void doAllAssertions(SrampArchive archive) throws SrampArchiveException { Collection<SrampArchiveEntry> entries = archive.getEntries(); // Make sure all the entries we expect to be there are there. TreeSet<String> entryNames = new TreeSet<String>(); for (SrampArchiveEntry srampArchiveEntry : entries) { entryNames.add(srampArchiveEntry.getPath()); } StringBuilder buff = new StringBuilder(); for (String entryName : entryNames) { buff.append(entryName).append("\n"); //$NON-NLS-1$ } Assert.assertEquals(EXPECTED_ENTRIES, buff.toString()); // Now spot-check some representative entries. // Check the kmodule.xml SrampArchiveEntry entry = archive.getEntry("META-INF/kmodule.xml"); //$NON-NLS-1$ Assert.assertNotNull(entry); Assert.assertEquals("kmodule.xml", entry.getMetaData().getName()); //$NON-NLS-1$ Assert.assertEquals(BaseArtifactEnum.EXTENDED_DOCUMENT, entry.getMetaData().getArtifactType()); ExtendedDocument kieXmlDoc = (ExtendedDocument) entry.getMetaData(); Assert.assertEquals(KieJarModel.KieXmlDocument, kieXmlDoc.getExtendedType()); }
SrampArchiveEntry entry = archive.getEntry("META-INF/switchyard.xml"); //$NON-NLS-1$ Assert.assertNotNull(entry); Assert.assertEquals("switchyard.xml", entry.getMetaData().getName()); //$NON-NLS-1$ entry = archive.getEntry("org/switchyard/quickstarts/bean/service/InventoryService.class"); //$NON-NLS-1$ Assert.assertNotNull(entry); Assert.assertEquals("InventoryService.class", entry.getMetaData().getName()); //$NON-NLS-1$ entry = archive.getEntry("wsdl/OrderService.wsdl"); //$NON-NLS-1$ Assert.assertNotNull(entry); Assert.assertEquals("OrderService.wsdl", entry.getMetaData().getName()); //$NON-NLS-1$
/** * Test method for {@link org.overlord.sramp.atom.archive.jar.ZipToSrampArchive.jar.JarToSrampArchive#createSrampArchive()}. */ @Test public void testMetaData() throws Exception { InputStream resourceAsStream = ZipToSrampArchiveTest.class.getResourceAsStream("sample-webservice-0.0.1.jar"); //$NON-NLS-1$ ZipToSrampArchive j2sramp = null; SrampArchive archive = null; try { j2sramp = new ZipToSrampArchive(resourceAsStream){}; archive = j2sramp.createSrampArchive(); Assert.assertNotNull(archive); SrampArchiveEntry entry = archive.getEntry("schema/teetime.xsd"); //$NON-NLS-1$ Assert.assertNotNull(entry); BaseArtifactType metaData = entry.getMetaData(); Assert.assertNotNull(metaData); Assert.assertTrue(metaData instanceof XsdDocument); XsdDocument md = (XsdDocument) metaData; Assert.assertEquals("teetime.xsd", md.getName()); //$NON-NLS-1$ Assert.assertNotNull(md.getUuid()); } finally { ZipToSrampArchive.closeQuietly(j2sramp); SrampArchive.closeQuietly(archive); } }
archive = j2sramp.createSrampArchive(); Assert.assertNotNull(archive); SrampArchiveEntry entry = archive.getEntry("schema/teetime.xsd"); //$NON-NLS-1$ Assert.assertNotNull(entry); BaseArtifactType metaData = entry.getMetaData();