use of org.opennms.api.reporting.parameter.ReportParameters in project opennms by OpenNMS.
the class DefaultSchedulerServiceIT method setUp.
@BeforeClass
public static void setUp() {
MockLogAppender.setupLogging();
m_criteria = new ReportParameters();
m_criteria.setReportId(REPORT_ID);
}
use of org.opennms.api.reporting.parameter.ReportParameters in project opennms by OpenNMS.
the class DefaultParameterConversionServiceTest method testDefaultDateConversion.
@Test
public void testDefaultDateConversion() {
ReportParameters parameters = m_conversionService.convert(m_dao.getParameters(ID));
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
System.out.println("test date " + cal.getTime().toString());
cal.add(Calendar.DATE, -1);
Date configDate = parameters.getDateParms().get(0).getDate();
assertEquals(0, configDate.compareTo(cal.getTime()));
}
use of org.opennms.api.reporting.parameter.ReportParameters in project opennms by OpenNMS.
the class DefaultParameterConversionServiceTest method testModifiedDateConversion.
@Test
public void testModifiedDateConversion() {
ReportParameters parameters = m_conversionService.convert(m_dao.getParameters(ID));
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
ReportDateParm dateParm = parameters.getDateParms().get(0);
dateParm.setCount(1);
dateParm.setInterval("month");
dateParm.setHours(0);
dateParm.setMinutes(0);
Map<String, Object> parmMap = parameters.getReportParms(ReportMode.SCHEDULED);
Date storedDate = (Date) parmMap.get("endDate");
assertEquals(0, storedDate.compareTo(cal.getTime()));
}
use of org.opennms.api.reporting.parameter.ReportParameters in project opennms by OpenNMS.
the class JasperReportServiceGetParametersTest method readPropertiesOfPropertyTestReportTest.
@Test
public void readPropertiesOfPropertyTestReportTest() throws ReportException {
String id = "parameter-test";
assertNotNull(service.getParameters(id));
ReportParameters params = service.getParameters(id);
assertEquals(7, params.getReportParms().size());
}
use of org.opennms.api.reporting.parameter.ReportParameters in project opennms by OpenNMS.
the class JasperReportServiceGetParametersTest method readPropertiesOfPropertyTestReportFromRESTRepoTest.
@Test
public void readPropertiesOfPropertyTestReportFromRESTRepoTest() throws ReportException {
String id = "REMOTE_parameterTestJasperReport";
assertNotNull(service.getParameters(id));
ReportParameters params = service.getParameters(id);
assertEquals(7, params.getReportParms().size());
}
Aggregations