Search in sources :

Example 16 with DateRange

use of org.activityinfo.shared.report.model.DateRange in project activityinfo by bedatadriven.

the class DateUtilCalendarImplTest method lastCompleteMonth.

@Test
public void lastCompleteMonth() {
    Calendar fifth = Calendar.getInstance();
    fifth.set(2011, Calendar.MAY, 5);
    DateRange range = util.lastCompleteMonthRange(fifth.getTime());
    assertThat(range.getMinDate().getDate(), equalTo(1));
    assertThat(range.getMaxDate().getDate(), equalTo(30));
}
Also used : DateRange(org.activityinfo.shared.report.model.DateRange) Calendar(java.util.Calendar) Test(org.junit.Test)

Example 17 with DateRange

use of org.activityinfo.shared.report.model.DateRange in project activityinfo by bedatadriven.

the class PivotSitesHandlerTest method testTargetPivot.

@Test
@OnDataSet("/dbunit/sites-simple-target.db.xml")
public void testTargetPivot() {
    withIndicatorAsDimension();
    dimensions.add(new DateDimension(DateUnit.YEAR));
    dimensions.add(new Dimension(DimensionType.Target));
    filter.addRestriction(DimensionType.Indicator, 1);
    filter.setDateRange(new DateRange(new LocalDate(2008, 1, 1), new LocalDate(2008, 12, 31)));
    execute();
    assertThat().thereAre(2).buckets();
}
Also used : DateRange(org.activityinfo.shared.report.model.DateRange) Dimension(org.activityinfo.shared.report.model.Dimension) AttributeGroupDimension(org.activityinfo.shared.report.model.AttributeGroupDimension) AdminDimension(org.activityinfo.shared.report.model.AdminDimension) DateDimension(org.activityinfo.shared.report.model.DateDimension) DateDimension(org.activityinfo.shared.report.model.DateDimension) LocalDate(com.bedatadriven.rebar.time.calendar.LocalDate) OnDataSet(org.activityinfo.server.database.OnDataSet) Test(org.junit.Test)

Aggregations

DateRange (org.activityinfo.shared.report.model.DateRange)17 Test (org.junit.Test)5 DateWrapper (com.extjs.gxt.ui.client.util.DateWrapper)4 Filter (org.activityinfo.shared.command.Filter)4 IOException (java.io.IOException)3 Calendar (java.util.Calendar)3 Dimension (org.activityinfo.shared.report.model.Dimension)3 LocalDate (com.bedatadriven.rebar.time.calendar.LocalDate)2 Date (java.util.Date)2 OnDataSet (org.activityinfo.server.database.OnDataSet)2 User (org.activityinfo.server.database.hibernate.entity.User)2 Renderer (org.activityinfo.server.report.renderer.Renderer)2 CommandException (org.activityinfo.shared.exception.CommandException)2 AdminDimension (org.activityinfo.shared.report.model.AdminDimension)2 AttributeGroupDimension (org.activityinfo.shared.report.model.AttributeGroupDimension)2 DateDimension (org.activityinfo.shared.report.model.DateDimension)2 Report (org.activityinfo.shared.report.model.Report)2 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1