### Question:
JMXDataCollectionConfigDao extends AbstractJaxbConfigDao<JmxDatacollectionConfig,JmxDatacollectionConfig> { public JmxDatacollectionConfig getConfig() { return getContainer().getObject(); } JMXDataCollectionConfigDao(); JmxDatacollectionConfig getConfig();  }### Answer:
@Test public void testAfterPropertiesSetWithGoodConfigFile() throws Exception { JMXDataCollectionConfigDao dao = new JMXDataCollectionConfigDao(); File jmxCollectionConfig= new File("src/test/resources/org/opennms/netmgt/config/jmx-datacollection-testdata.xml"); assertTrue("JMX configuration file is readable", jmxCollectionConfig.canRead()); InputStream in = new FileInputStream(jmxCollectionConfig); dao.setConfigResource(new InputStreamResource(in)); dao.afterPropertiesSet(); Assert.assertNotNull("JMX data collection should not be null", dao.getConfig()); }
@Test public void testAfterPropertiesSetWithNestedFiles() throws Exception { System.setProperty("opennms.home", "src/test/resources"); JMXDataCollectionConfigDao dao = new JMXDataCollectionConfigDao(); File jmxCollectionConfig= new File("src/test/resources/etc/jmx-datacollection-split.xml"); assertTrue("JMX configuration file is not readable", jmxCollectionConfig.canRead()); InputStream in = new FileInputStream(jmxCollectionConfig); dao.setConfigResource(new InputStreamResource(in)); dao.afterPropertiesSet(); JmxDatacollectionConfig config = dao.getConfig(); Assert.assertNotNull("JMX data collection should not be null", config); Assert.assertEquals(8, config.getJmxCollection(0).getMbeans().getMbeanCount()); Assert.assertEquals(4, config.getJmxCollection(1).getMbeans().getMbeanCount()); }