@Override protected void visitSoa(SoaModelType artifact) { super.visitSoa(artifact); try { List<String> targetTypes = new ArrayList<String>(); for (DocumentArtifactTarget documentation : artifact.getDocumentation()) { targetTypes.add(documentation.getArtifactType().toString()); } setRelationships("documentation", RelationshipType.MODELED, artifact.getDocumentation()); } catch (Exception e) { error = e; } }
@Override protected void visitServiceImplementation(ServiceImplementationModelType artifact) { super.visitServiceImplementation(artifact); try { List<String> targetTypes = new ArrayList<String>(); for (DocumentArtifactTarget documentation : artifact.getDocumentation()) { targetTypes.add(documentation.getArtifactType().toString()); } setRelationships("documentation", RelationshipType.MODELED, artifact.getDocumentation()); } catch (Exception e) { error = e; } }
/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visitDerived(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.DerivedArtifactType) */ @Override protected void visitDerived(DerivedArtifactType artifact) { try { setRelationship("relatedDocument", 1, 1, artifact.getRelatedDocument().getArtifactType().toString(), //$NON-NLS-1$ false, artifact.getRelatedDocument()); } catch (Exception e) { error = e; } }
DerivedArtifactType dat = (DerivedArtifactType) derivedArtifact; Assert.assertEquals(testSrcArtifact.getUuid(), dat.getRelatedDocument().getValue()); Assert.assertEquals(DocumentArtifactEnum.XSD_DOCUMENT, dat.getRelatedDocument().getArtifactType());