use of org.opennms.netmgt.jasper.helper.SpringHelper in project opennms by OpenNMS.
the class DefaultSpringConfiguration method createSpringHelper.
@Bean(name = "springHelper")
public SpringHelper createSpringHelper() {
SpringHelper helper = new SpringHelper();
helper.setApplicationContext(context);
return helper;
}
use of org.opennms.netmgt.jasper.helper.SpringHelper in project opennms by OpenNMS.
the class LocalMeasurementDataSourceWrapperTest method verifyContainsResultEvenIfResourceOrAttributeDoNotExist.
// See NMS-8337
@Test
public void verifyContainsResultEvenIfResourceOrAttributeDoNotExist() throws JRException {
SpringHelper springHelper = MeasurementsHelper.getSpringHelper();
MeasurementDataSource dataSource = (MeasurementDataSource) new LocalMeasurementDataSourceWrapper(springHelper.getMeasurementFetchStrategy(), springHelper.getExpressionEngine(), springHelper.getFilterEngine()).createDataSource(getQuery());
Assert.assertEquals(2, dataSource.getRowCount());
double[] data = new double[] { 13, 17 };
while (dataSource.next()) {
Assert.assertEquals(data[dataSource.getCurrentRow()], dataSource.getFieldValue("ifInErrors", dataSource.getCurrentRow()));
Assert.assertEquals(Double.NaN, dataSource.getFieldValue("ifOutDiscards", dataSource.getCurrentRow()));
Assert.assertEquals(Double.NaN, dataSource.getFieldValue("ifOutErrors", dataSource.getCurrentRow()));
}
}
Aggregations