use of org.opennms.protocols.xml.collector.XmlCollector in project opennms by OpenNMS.
the class AbstractVTDXmlCollectorTest method executeCollectorTest.
/**
* Executes collector test.
*
* @param parameters the parameters
* @param expectedFiles the expected amount of JRB files
* @throws Exception the exception
*/
public void executeCollectorTest(Map<String, Object> parameters, int expectedFiles) throws Exception {
XmlCollector collector = new XmlCollector();
collector.setXmlCollectionDao(m_xmlCollectionDao);
CollectionSet collectionSet = XmlCollectorTestUtils.doCollect(collector, m_collectionAgent, parameters);
Assert.assertEquals(CollectionStatus.SUCCEEDED, collectionSet.getStatus());
ServiceParameters serviceParams = new ServiceParameters(new HashMap<String, Object>());
CollectionSetVisitor persister = m_persisterFactory.createGroupPersister(serviceParams, createRrdRepository((String) parameters.get("collection")), false, false);
collectionSet.visit(persister);
Assert.assertEquals(expectedFiles, FileUtils.listFiles(getSnmpRoot(), new String[] { "jrb" }, true).size());
}
Aggregations