private void processWsdlImports() throws XPathExpressionException { WsdlDocument wsdlDocument; if (getPrimaryArtifact() instanceof WsdlDocument) { wsdlDocument = (WsdlDocument) getPrimaryArtifact(); } else { return; } NodeList nodes = (NodeList) this.query(rootElement, ".//wsdl:import", XPathConstants.NODESET); for (int idx = 0; idx < nodes.getLength(); idx++) { Element node = (Element) nodes.item(idx); if (node.hasAttribute("namespace")) { String namespace = node.getAttribute("namespace"); String location = node.getAttribute("location"); stripPath(location); WsdlDocument wsdlDocumentRef = derivedArtifacts.lookupWsdlDocument(namespace); WsdlDocumentTarget wsdlDocumentTarget = new WsdlDocumentTarget(); wsdlDocumentTarget.setArtifactType(WsdlDocumentEnum.WSDL_DOCUMENT); if (wsdlDocumentRef != null) { wsdlDocumentTarget.setValue(wsdlDocumentRef.getUuid()); } else { relationshipSources.add(new NamespaceRelationshipSource(namespace, location, wsdlDocumentTarget, wsdlDocument.getImportedWsdls(), ArtifactTypeEnum.WsdlDocument.getModel(), ArtifactTypeEnum.WsdlDocument.getType())); } wsdlDocument.getImportedWsdls().add(wsdlDocumentTarget); } } }
WsdlDocument wsdlDoc = addWsdlDoc(); SrampModelUtils.addGenericRelationship(xsdDoc, "importedBy", wsdlDoc.getUuid()); //$NON-NLS-1$ SrampModelUtils.addGenericRelationship(xsdDoc, "markerRel", null); //$NON-NLS-1$ query.setString(wsdlDoc.getUuid()); artifactSet = query.executeQuery(); Assert.assertNotNull(artifactSet);