use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyReportsTest method testMonthCompare.
@Test
public void testMonthCompare() throws Exception {
Month feb = new Month(2009, 2);
Month maxMonth = new Month(2009, 2);
Assert.assertEquals(0, maxMonth.compareTo(feb));
}
use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyReportsTest method unauthorized.
@Test(expected = CommandException.class)
public void unauthorized() {
// marlene: viewall, but not editall
setUser(4);
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));
}
use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyReportsTest method testGetReportsWhenEmpty.
@Test
public void testGetReportsWhenEmpty() throws Exception {
GetMonthlyReports cmd = new GetMonthlyReports(7);
cmd.setStartMonth(new Month(2009, 1));
cmd.setEndMonth(new Month(2009, 2));
MonthlyReportResult result = execute(cmd);
Assert.assertEquals(1, result.getData().size());
}
use of org.activityinfo.model.type.time.Month 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));
}
use of org.activityinfo.model.type.time.Month 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));
}
Aggregations