use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.
the class ColorFactoryTests method testGetUserDefaultFillColor.
@Test
public void testGetUserDefaultFillColor() {
IBusinessActor actor = IArchimateFactory.eINSTANCE.createBusinessActor();
Color color = ColorFactory.getUserDefaultFillColor(actor);
assertNull(color);
Preferences.STORE.setValue(IPreferenceConstants.DEFAULT_FILL_COLOR_PREFIX + actor.eClass().getName(), "#010203");
color = ColorFactory.getUserDefaultFillColor(actor);
assertEquals(1, color.getRed());
assertEquals(2, color.getGreen());
assertEquals(3, color.getBlue());
}
use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.
the class ColorFactoryTests method testGetUserDefaultLineColor_Element.
@Test
public void testGetUserDefaultLineColor_Element() {
IBusinessActor actor = IArchimateFactory.eINSTANCE.createBusinessActor();
Color color = ColorFactory.getUserDefaultLineColor(actor);
assertNull(color);
Preferences.STORE.setValue(IPreferenceConstants.DEFAULT_ELEMENT_LINE_COLOR, "#020304");
color = ColorFactory.getUserDefaultLineColor(actor);
assertEquals(2, color.getRed());
assertEquals(3, color.getGreen());
assertEquals(4, color.getBlue());
Preferences.STORE.setToDefault(IPreferenceConstants.DEFAULT_ELEMENT_LINE_COLOR);
}
use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.
the class ArchimateDiagramModelFactoryTests method testGetNewObjectArchimateDiagramObject.
@Test
public void testGetNewObjectArchimateDiagramObject() {
ICreationFactory factory = new ArchimateDiagramModelFactory(IArchimatePackage.eINSTANCE.getBusinessActor());
IDiagramModelArchimateObject dmo = (IDiagramModelArchimateObject) factory.getNewObject();
assertTrue(dmo.getArchimateElement() instanceof IBusinessActor);
assertEquals("Business Actor", dmo.getName());
}
use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.
the class ArchiLabelProviderTests method testGetImage.
@Test
public void testGetImage() {
// Null object
assertNull(ArchiLabelProvider.INSTANCE.getImage(null));
// Object
IBusinessActor actor = IArchimateFactory.eINSTANCE.createBusinessActor();
Image image1 = ArchiLabelProvider.INSTANCE.getImage(actor);
assertNotNull(image1);
// Same image for object's class
Image image2 = ArchiLabelProvider.INSTANCE.getImage(actor.eClass());
assertSame(image1, image2);
}
use of com.archimatetool.model.IBusinessActor 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