Program: 13002
Project: 13002
Buggy source:
/** 
 * 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 testSwitchyardDeriver() throws IOException {
  SwitchYardXmlDeriver deriver=new SwitchYardXmlDeriver();
  ExtendedDocument artifact=new ExtendedDocument();
  artifact.setArtifactType(BaseArtifactEnum.EXTENDED_ARTIFACT_TYPE);
  artifact.setName("String_Node_Str");
  artifact.setExtendedType(SwitchYardModel.SwitchYardXmlDocument);
  InputStream is=getClass().getResourceAsStream("String_Node_Str");
  Collection<BaseArtifactType> derivedArtifacts=deriver.derive(artifact,is);
  Assert.assertNotNull(derivedArtifacts);
  Assert.assertEquals(9,derivedArtifacts.size());
  Assert.assertEquals("String_Node_Str",artifact.getName());
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(artifact,"String_Node_Str"));
  BaseArtifactType orderService=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardServiceType,"String_Node_Str");
  Assert.assertNotNull(orderService);
  Assert.assertEquals("String_Node_Str",orderService.getName());
  BaseArtifactType inventoryServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(inventoryServiceComponent);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(inventoryServiceComponent,"String_Node_Str"));
  Relationship relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  BaseArtifactType orderServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(orderServiceComponent);
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderService,SwitchYardModel.REL_PROMOTES);
  Assert.assertNotNull(relationship);
  Assert.assertNotNull(relationship.getRelationshipTarget());
  Assert.assertFalse(relationship.getRelationshipTarget().isEmpty());
  Assert.assertEquals(orderServiceComponent.getUuid(),relationship.getRelationshipTarget().iterator().next().getValue());
  BaseArtifactType camelServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(camelServiceComponent);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(camelServiceComponent,"String_Node_Str"));
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  BaseArtifactType transformJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  Assert.assertNotNull(transformJava);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(transformJava,SwitchYardModel.PROP_TRANSFORMER_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  BaseArtifactType transformXslt=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  Assert.assertNotNull(transformXslt);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(transformXslt,SwitchYardModel.PROP_TRANSFORMER_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(transformXslt,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  BaseArtifactType validateJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardValidatorType,"String_Node_Str");
  Assert.assertNotNull(validateJava);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(validateJava,SwitchYardModel.PROP_VALIDATE_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_VALIDATES);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  LinkerContext context=new LinkerContext(){
    @Override public Collection<BaseArtifactType> findArtifacts(    String model,    String type,    Map<String,String> criteria){
      BaseArtifactType doc=new Document();
      doc.setArtifactType(BaseArtifactEnum.DOCUMENT);
      doc.setName("String_Node_Str");
      doc.setUuid(UUID.randomUUID().toString());
      return Collections.singletonList(doc);
    }
  }
;
  deriver.link(context,artifact,derivedArtifacts);
  inventoryServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  orderServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  camelServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  transformJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  transformXslt=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(transformXslt,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  validateJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardValidatorType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_VALIDATES);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
}

Fixed version (ground truth):
/** 
 * 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 testSwitchyardDeriver() throws IOException {
  SwitchYardXmlDeriver deriver=new SwitchYardXmlDeriver();
  ExtendedDocument artifact=new ExtendedDocument();
  artifact.setArtifactType(BaseArtifactEnum.EXTENDED_ARTIFACT_TYPE);
  artifact.setName("String_Node_Str");
  artifact.setExtendedType(SwitchYardModel.SwitchYardXmlDocument);
  InputStream is=getClass().getResourceAsStream("String_Node_Str");
  Collection<BaseArtifactType> derivedArtifacts=deriver.derive(artifact,is);
  Assert.assertNotNull(derivedArtifacts);
  Assert.assertEquals(12,derivedArtifacts.size());
  Assert.assertEquals("String_Node_Str",artifact.getName());
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(artifact,"String_Node_Str"));
  BaseArtifactType orderService=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardServiceType,"String_Node_Str");
  Assert.assertNotNull(orderService);
  Assert.assertEquals("String_Node_Str",orderService.getName());
  Relationship relationship=SrampModelUtils.getGenericRelationship(orderService,SwitchYardModel.REL_IMPLEMENTS);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  Assert.assertEquals("String_Node_Str",relationship.getOtherAttributes().get(SwitchYardXmlDeriver.UNRESOLVED_REF));
  BaseArtifactType inventoryServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(inventoryServiceComponent);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(inventoryServiceComponent,"String_Node_Str"));
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  BaseArtifactType orderServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(orderServiceComponent);
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderService,SwitchYardModel.REL_PROMOTES);
  Assert.assertNotNull(relationship);
  Assert.assertNotNull(relationship.getRelationshipTarget());
  Assert.assertFalse(relationship.getRelationshipTarget().isEmpty());
  Assert.assertEquals(orderServiceComponent.getUuid(),relationship.getRelationshipTarget().iterator().next().getValue());
  BaseArtifactType camelServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  Assert.assertNotNull(camelServiceComponent);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(camelServiceComponent,"String_Node_Str"));
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  BaseArtifactType inventoryServiceComponentSvc=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentServiceType,"String_Node_Str");
  Assert.assertNotNull(camelServiceComponent);
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponentSvc,SwitchYardModel.REL_IMPLEMENTS);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  Assert.assertEquals("String_Node_Str",relationship.getOtherAttributes().get(SwitchYardXmlDeriver.UNRESOLVED_REF));
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(inventoryServiceComponentSvc,"String_Node_Str"));
  BaseArtifactType transformJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  Assert.assertNotNull(transformJava);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(transformJava,SwitchYardModel.PROP_TRANSFORMER_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  BaseArtifactType transformXslt=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  Assert.assertNotNull(transformXslt);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(transformXslt,SwitchYardModel.PROP_TRANSFORMER_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(transformXslt,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  BaseArtifactType validateJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardValidatorType,"String_Node_Str");
  Assert.assertNotNull(validateJava);
  Assert.assertEquals("String_Node_Str",SrampModelUtils.getCustomProperty(validateJava,SwitchYardModel.PROP_VALIDATE_TYPE));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_VALIDATES);
  Assert.assertNotNull(relationship);
  Assert.assertTrue(relationship.getRelationshipTarget().isEmpty());
  Assert.assertTrue(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  LinkerContext context=new LinkerContext(){
    @Override public Collection<BaseArtifactType> findArtifacts(    String model,    String type,    Map<String,String> criteria){
      BaseArtifactType doc=new Document();
      doc.setArtifactType(BaseArtifactEnum.DOCUMENT);
      doc.setName("String_Node_Str");
      doc.setUuid(UUID.randomUUID().toString());
      return Collections.singletonList(doc);
    }
  }
;
  deriver.link(context,artifact,derivedArtifacts);
  inventoryServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(inventoryServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNull(relationship);
  orderServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(orderServiceComponent,SwitchYardModel.REL_REFERENCES);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  camelServiceComponent=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardComponentType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(camelServiceComponent,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  transformJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  transformXslt=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardTransformerType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(transformXslt,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_FROM);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(transformJava,SwitchYardModel.REL_TRANSFORMS_TO);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  validateJava=getDerivedArtifact(derivedArtifacts,SwitchYardModel.SwitchYardValidatorType,"String_Node_Str");
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_IMPLEMENTED_BY);
  Assert.assertNotNull(relationship);
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
  relationship=SrampModelUtils.getGenericRelationship(validateJava,SwitchYardModel.REL_VALIDATES);
  Assert.assertNotNull(relationship);
  Assert.assertEquals(1,relationship.getRelationshipTarget().size());
  Assert.assertFalse(relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF));
}