ActiveVOS9Deployment extends AbstractDeployment { @Override public List<IBPELProcess> getBPELProcesses() throws DeploymentException { extractBPRIfNecessary(); return new ArrayList<IBPELProcess>(allProcesses); } ActiveVOS9Deployment(File bpr); @Override List<IBPELProcess> getBPELProcesses(); static final String NAMESPACE_PDD; }
@Test @Ignore public void testAddFilesToProcess() throws Exception { deployment = new ActiveVOS9Deployment(new File("src/test/resources/simplebpel.bpr")); List<IBPELProcess> processes = deployment.getBPELProcesses(); assertEquals(1, processes.size()); BPELInfo firstProcess = (BPELInfo)processes.get(0); assertEquals("../../../wsdl/bpelunit/coverage.wsdl", firstProcess.calculateRelativePathTo("coverage.wsdl")); File newBPR = saveNewDeployment(); FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream(newBPR); out = new FileOutputStream(new File("target/simplebpel_updated.bpr")); IOUtils.copy(in, out); } finally { IOUtils.closeQuietly(in); IOUtils.closeQuietly(out); } firstProcess.addWSDLImport("coverage.wsdl", "http: IProcess bpelModel = firstProcess.getProcessModel(); IImport lastImport = bpelModel.getImports().get(bpelModel.getImports().size()-1); assertEquals("http: assertTrue(lastImport.getLocation().endsWith("coverage.wsdl")); assertEquals(IImport.IMPORTTYPE_WSDL, lastImport.getImportType()); WsdlEntryType[] wsdlsInCatalog = deployment.catalogDoc.getCatalog().getWsdlEntryArray(); WsdlEntryType lastWsdl = wsdlsInCatalog[wsdlsInCatalog.length - 1]; assertEquals("project:/com.innoq.simplebpel/wsdl/bpelunit/coverage.wsdl", lastWsdl.getLocation()); assertTrue(lastWsdl.getClasspath().endsWith("coverage.wsdl")); }