Search in sources :

Example 6 with UpdateMonthlyReports

use of org.activityinfo.legacy.shared.command.UpdateMonthlyReports in project activityinfo by bedatadriven.

the class MonthlyReportsTest method authorizedByEditAll.

@Test
public void authorizedByEditAll() {
    // bavon: viewall AND editall
    setUser(2);
    ArrayList<UpdateMonthlyReports.Change> changes = new ArrayList<UpdateMonthlyReports.Change>();
    changes.add(new UpdateMonthlyReports.Change(6, new Month(2009, 1), 45.0));
    changes.add(new UpdateMonthlyReports.Change(6, new Month(2009, 3), 22.0));
    execute(new UpdateMonthlyReports(6, changes));
}
Also used : Month(org.activityinfo.model.type.time.Month) UpdateMonthlyReports(org.activityinfo.legacy.shared.command.UpdateMonthlyReports) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 7 with UpdateMonthlyReports

use of org.activityinfo.legacy.shared.command.UpdateMonthlyReports in project activityinfo by bedatadriven.

the class MonthlyReportsTest method authorizedByEdit.

@Test
public void authorizedByEdit() {
    // pacifique, only edit
    setUser(21);
    ArrayList<UpdateMonthlyReports.Change> changes = new ArrayList<UpdateMonthlyReports.Change>();
    changes.add(new UpdateMonthlyReports.Change(6, new Month(2009, 1), 45.0));
    execute(new UpdateMonthlyReports(6, changes));
}
Also used : Month(org.activityinfo.model.type.time.Month) UpdateMonthlyReports(org.activityinfo.legacy.shared.command.UpdateMonthlyReports) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

UpdateMonthlyReports (org.activityinfo.legacy.shared.command.UpdateMonthlyReports)7 ArrayList (java.util.ArrayList)6 Month (org.activityinfo.model.type.time.Month)5 Test (org.junit.Test)4 VoidResult (org.activityinfo.legacy.shared.command.result.VoidResult)2 Promise (org.activityinfo.promise.Promise)2 Record (com.extjs.gxt.ui.client.store.Record)1 Calendar (java.util.Calendar)1 GetMonthlyReports (org.activityinfo.legacy.shared.command.GetMonthlyReports)1 MonthlyReportResult (org.activityinfo.legacy.shared.command.result.MonthlyReportResult)1 CommandException (org.activityinfo.legacy.shared.exception.CommandException)1 IllegalAccessCommandException (org.activityinfo.legacy.shared.exception.IllegalAccessCommandException)1 KeyGenerator (org.activityinfo.model.legacy.KeyGenerator)1 MaskingAsyncMonitor (org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor)1