use of org.opennms.netmgt.jasper.measurement.local.LocalMeasurementDataSourceWrapper 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