Search in sources :

Example 16 with AttributeGroupDTO

use of org.activityinfo.shared.dto.AttributeGroupDTO in project activityinfo by bedatadriven.

the class AttributeGroupTest method testCreate.

@Test
public void testCreate() throws Exception {
    // execute the command
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put("name", "Type de Conflit");
    properties.put("multipleAllowed", true);
    properties.put("activityId", 1);
    CreateEntity cmd = new CreateEntity("AttributeGroup", properties);
    CreateResult result = execute(cmd);
    // check if it has been added
    SchemaDTO schema = execute(new GetSchema());
    ActivityDTO activity = schema.getActivityById(1);
    AttributeGroupDTO group = activity.getAttributeGroupById(result.getNewId());
    Assert.assertNotNull("attribute group is created", group);
    Assert.assertEquals("name is correct", group.getName(), "Type de Conflit");
    Assert.assertTrue("multiple allowed is set to true", group.isMultipleAllowed());
}
Also used : CreateEntity(org.activityinfo.shared.command.CreateEntity) AttributeGroupDTO(org.activityinfo.shared.dto.AttributeGroupDTO) CreateResult(org.activityinfo.shared.command.result.CreateResult) HashMap(java.util.HashMap) ActivityDTO(org.activityinfo.shared.dto.ActivityDTO) SchemaDTO(org.activityinfo.shared.dto.SchemaDTO) GetSchema(org.activityinfo.shared.command.GetSchema) Test(org.junit.Test)

Aggregations

AttributeGroupDTO (org.activityinfo.shared.dto.AttributeGroupDTO)16 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)9 IndicatorDTO (org.activityinfo.shared.dto.IndicatorDTO)7 AttributeDTO (org.activityinfo.shared.dto.AttributeDTO)6 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)5 ModelData (com.extjs.gxt.ui.client.data.ModelData)3 GetSchema (org.activityinfo.shared.command.GetSchema)3 UserDatabaseDTO (org.activityinfo.shared.dto.UserDatabaseDTO)3 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 GetAttributeGroupsDimension (org.activityinfo.shared.command.GetAttributeGroupsDimension)2 AttributeGroupResult (org.activityinfo.shared.command.result.AttributeGroupResult)2 CreateResult (org.activityinfo.shared.command.result.CreateResult)2 AdminLevelDTO (org.activityinfo.shared.dto.AdminLevelDTO)2 FieldBinding (com.extjs.gxt.ui.client.binding.FieldBinding)1 TreeGridDragSource (com.extjs.gxt.ui.client.dnd.TreeGridDragSource)1 TreeGridDropTarget (com.extjs.gxt.ui.client.dnd.TreeGridDropTarget)1 BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)1 DNDEvent (com.extjs.gxt.ui.client.event.DNDEvent)1 DNDListener (com.extjs.gxt.ui.client.event.DNDListener)1