use of com.archimatetool.editor.diagram.editparts.ArchimateElementEditPart in project archi by archimatetool.
the class PropertiesLabelProviderTests method testGetTextElement.
@Test
public void testGetTextElement() {
// Text for element
IArchimateElement element = IArchimateFactory.eINSTANCE.createArtifact();
String text = provider.getText(new StructuredSelection(element));
assertEquals("Artifact", text);
// Text for DiagramModelArchimateObject
IDiagramModelArchimateObject dmo = IArchimateFactory.eINSTANCE.createDiagramModelArchimateObject();
dmo.setArchimateElement(element);
text = provider.getText(new StructuredSelection(dmo));
assertEquals("Artifact", text);
// Text for EditPart
EditPart editPart = new ArchimateElementEditPart();
editPart.setModel(dmo);
text = provider.getText(new StructuredSelection(editPart));
assertEquals("Artifact", text);
}
use of com.archimatetool.editor.diagram.editparts.ArchimateElementEditPart in project archi by archimatetool.
the class PropertiesLabelProviderTests method testGetImageElement.
@Test
public void testGetImageElement() {
IArchimateElement element = IArchimateFactory.eINSTANCE.createArtifact();
// Image for element
Image image1 = provider.getImage(new StructuredSelection(element));
assertNotNull(image1);
// Image for DiagramModelArchimateObject
IDiagramModelArchimateObject dmo = IArchimateFactory.eINSTANCE.createDiagramModelArchimateObject();
dmo.setArchimateElement(element);
Image image2 = provider.getImage(new StructuredSelection(dmo));
assertSame(image1, image2);
// Image for EditPart
EditPart editPart = new ArchimateElementEditPart();
editPart.setModel(dmo);
Image image3 = provider.getImage(new StructuredSelection(editPart));
assertSame(image1, image3);
}
Aggregations