Search in sources :

Example 6 with TargetDTO

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

the class TargetTest method updateTargetNameTest.

@Test
public void updateTargetNameTest() throws Throwable {
    Map<String, Object> changes1 = new HashMap<String, Object>();
    changes1.put("name", "newNameOfTarget");
    execute(new BatchCommand(new UpdateEntity("Target", 1, changes1)));
    List<TargetDTO> targets = execute(new GetTargets(db.getId())).getData();
    TargetDTO dto = getTargetById(targets, 1);
    Assert.assertEquals("newNameOfTarget", dto.getName());
}
Also used : GetTargets(org.activityinfo.shared.command.GetTargets) UpdateEntity(org.activityinfo.shared.command.UpdateEntity) HashMap(java.util.HashMap) BatchCommand(org.activityinfo.shared.command.BatchCommand) TargetDTO(org.activityinfo.shared.dto.TargetDTO) Test(org.junit.Test)

Example 7 with TargetDTO

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

the class TargetTest method createTarget.

private TargetDTO createTarget() {
    Date date1 = new Date();
    Date date2 = new Date();
    /*
         * Create a new Target
         */
    TargetDTO target = new TargetDTO();
    target.setName("Target0071");
    target.setDate1(date1);
    target.setDate2(date2);
    return target;
}
Also used : TargetDTO(org.activityinfo.shared.dto.TargetDTO) Date(java.util.Date)

Aggregations

TargetDTO (org.activityinfo.shared.dto.TargetDTO)7 AddTarget (org.activityinfo.shared.command.AddTarget)4 CreateResult (org.activityinfo.shared.command.result.CreateResult)4 GetTargets (org.activityinfo.shared.command.GetTargets)3 Test (org.junit.Test)3 Date (java.util.Date)2 ListStore (com.extjs.gxt.ui.client.store.ListStore)1 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 HashMap (java.util.HashMap)1 FormDialogCallback (org.activityinfo.client.page.common.dialog.FormDialogCallback)1 FormDialogTether (org.activityinfo.client.page.common.dialog.FormDialogTether)1 AdminEntity (org.activityinfo.server.database.hibernate.entity.AdminEntity)1 Partner (org.activityinfo.server.database.hibernate.entity.Partner)1 Project (org.activityinfo.server.database.hibernate.entity.Project)1 Target (org.activityinfo.server.database.hibernate.entity.Target)1 UserDatabase (org.activityinfo.server.database.hibernate.entity.UserDatabase)1 BatchCommand (org.activityinfo.shared.command.BatchCommand)1 Delete (org.activityinfo.shared.command.Delete)1