Search in sources :

Example 1 with DefaultStatisticsDaemonConfigDao

use of org.opennms.netmgt.dao.jaxb.DefaultStatisticsDaemonConfigDao in project opennms by OpenNMS.

the class DefaultStatisticsDaemonConfigDaoTest method testAfterPropertiesSetWithGoodConfigFile.

public void testAfterPropertiesSetWithGoodConfigFile() throws Exception {
    DefaultStatisticsDaemonConfigDao dao = new DefaultStatisticsDaemonConfigDao();
    InputStream in = ConfigurationTestUtils.getInputStreamForConfigFile("statsd-configuration.xml");
    dao.setConfigResource(new InputStreamResource(in));
    dao.afterPropertiesSet();
}
Also used : InputStream(java.io.InputStream) DefaultStatisticsDaemonConfigDao(org.opennms.netmgt.dao.jaxb.DefaultStatisticsDaemonConfigDao) InputStreamResource(org.springframework.core.io.InputStreamResource)

Example 2 with DefaultStatisticsDaemonConfigDao

use of org.opennms.netmgt.dao.jaxb.DefaultStatisticsDaemonConfigDao in project opennms by OpenNMS.

the class DefaultStatisticsDaemonConfigDaoTest method testGetReports.

public void testGetReports() throws Exception {
    DefaultStatisticsDaemonConfigDao dao = new DefaultStatisticsDaemonConfigDao();
    InputStream in = ConfigurationTestUtils.getInputStreamForConfigFile("statsd-configuration.xml");
    dao.setConfigResource(new InputStreamResource(in));
    dao.afterPropertiesSet();
    List<Report> reports = dao.getReports();
    assertNotNull("reports list should not be null", reports);
    assertTrue("at least two reports should be present but found " + reports.size(), reports.size() > 1);
    assertNotNull("first report should non-null", reports.get(0));
}
Also used : Report(org.opennms.netmgt.config.statsd.model.Report) InputStream(java.io.InputStream) DefaultStatisticsDaemonConfigDao(org.opennms.netmgt.dao.jaxb.DefaultStatisticsDaemonConfigDao) InputStreamResource(org.springframework.core.io.InputStreamResource)

Aggregations

InputStream (java.io.InputStream)2 DefaultStatisticsDaemonConfigDao (org.opennms.netmgt.dao.jaxb.DefaultStatisticsDaemonConfigDao)2 InputStreamResource (org.springframework.core.io.InputStreamResource)2 Report (org.opennms.netmgt.config.statsd.model.Report)1