Search in sources :

Example 1 with DateUtil

use of org.activityinfo.shared.util.date.DateUtil in project activityinfo by bedatadriven.

the class ReportGeneratorTest method testFileName.

@Test
public void testFileName() {
    // Input user
    User user = new User();
    user.setLocale("en");
    // Input test data: report model + parameter
    Report report = new Report();
    report.setFileName("Report ${DATE_RANGE} of Activities");
    // Input test data: parameter values
    DateUtil dateUtil = new DateUtilCalendarImpl();
    DateRange dateRange = dateUtil.monthRange(2009, 1);
    // class under test
    ReportGenerator generator = new ReportGenerator(null, null, null, null, null);
    generator.generate(user, report, null, dateRange);
    // VERIFY correct file name
    Assert.assertEquals("Report Jan 2009 of Activities", report.getContent().getFileName());
}
Also used : DateRange(org.activityinfo.shared.report.model.DateRange) User(org.activityinfo.server.database.hibernate.entity.User) Report(org.activityinfo.shared.report.model.Report) DateUtil(org.activityinfo.shared.util.date.DateUtil) DateUtilCalendarImpl(org.activityinfo.server.util.date.DateUtilCalendarImpl) Test(org.junit.Test)

Aggregations

User (org.activityinfo.server.database.hibernate.entity.User)1 DateUtilCalendarImpl (org.activityinfo.server.util.date.DateUtilCalendarImpl)1 DateRange (org.activityinfo.shared.report.model.DateRange)1 Report (org.activityinfo.shared.report.model.Report)1 DateUtil (org.activityinfo.shared.util.date.DateUtil)1 Test (org.junit.Test)1