Search in sources :

Example 6 with IBusinessActor

use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.

the class ElementsDataSourceTests method testGetFieldValue.

@Test
public void testGetFieldValue() throws JRException {
    ds.next();
    JRField field = mock(JRField.class);
    when(field.getName()).thenReturn("this");
    Object object = ds.getFieldValue(field);
    assertTrue(object instanceof IBusinessActor);
    assertEquals("275", ((IBusinessActor) object).getId());
    when(field.getName()).thenReturn("name");
    assertEquals(((IBusinessActor) object).getName(), ds.getFieldValue(field));
}
Also used : IBusinessActor(com.archimatetool.model.IBusinessActor) JRField(net.sf.jasperreports.engine.JRField) Test(org.junit.Test)

Example 7 with IBusinessActor

use of com.archimatetool.model.IBusinessActor in project archi by archimatetool.

the class FieldDataFactoryTests method testGetFieldValue_ID.

@Test
public void testGetFieldValue_ID() {
    IBusinessActor element = IArchimateFactory.eINSTANCE.createBusinessActor();
    element.setId("1234");
    Object o = FieldDataFactory.getFieldValue(element, "id");
    assertEquals("1234", o);
}
Also used : IBusinessActor(com.archimatetool.model.IBusinessActor) Test(org.junit.Test)

Aggregations

IBusinessActor (com.archimatetool.model.IBusinessActor)7 Test (org.junit.Test)7 Color (org.eclipse.swt.graphics.Color)2 IArchimateRelationship (com.archimatetool.model.IArchimateRelationship)1 IBusinessRole (com.archimatetool.model.IBusinessRole)1 IDiagramModelArchimateObject (com.archimatetool.model.IDiagramModelArchimateObject)1 IDiagramModelImage (com.archimatetool.model.IDiagramModelImage)1 IJunction (com.archimatetool.model.IJunction)1 JRField (net.sf.jasperreports.engine.JRField)1 Image (org.eclipse.swt.graphics.Image)1