use of com.archimatetool.model.IJunction in project archi by archimatetool.
the class ArchiLabelProviderTests method testGetRelationshipSentence.
@Test
public void testGetRelationshipSentence() {
// Null object
assertEquals("", ArchiLabelProvider.INSTANCE.getRelationshipSentence(null));
IBusinessActor actor = IArchimateFactory.eINSTANCE.createBusinessActor();
actor.setName("Fred");
IBusinessRole role = IArchimateFactory.eINSTANCE.createBusinessRole();
role.setName("Nobody");
IArchimateRelationship relation = IArchimateFactory.eINSTANCE.createAssignmentRelationship();
relation.setSource(actor);
relation.setTarget(role);
assertEquals("Fred is assigned to Nobody", ArchiLabelProvider.INSTANCE.getRelationshipSentence(relation));
relation.setSource(role);
relation.setTarget(actor);
assertEquals("Nobody is assigned to Fred", ArchiLabelProvider.INSTANCE.getRelationshipSentence(relation));
// Junctions
IJunction j1 = IArchimateFactory.eINSTANCE.createJunction();
j1.setName("Johnny");
relation.setSource(j1);
relation.setTarget(actor);
assertEquals("Johnny connects to Fred", ArchiLabelProvider.INSTANCE.getRelationshipSentence(relation));
relation.setSource(actor);
relation.setTarget(j1);
assertEquals("Fred connects to Johnny", ArchiLabelProvider.INSTANCE.getRelationshipSentence(relation));
}
Aggregations