Search in sources :

Example 1 with XmlCollector

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());
}
Also used : XmlCollector(org.opennms.protocols.xml.collector.XmlCollector) CollectionSetVisitor(org.opennms.netmgt.collection.api.CollectionSetVisitor) ServiceParameters(org.opennms.netmgt.collection.api.ServiceParameters) CollectionSet(org.opennms.netmgt.collection.api.CollectionSet)

Aggregations

CollectionSet (org.opennms.netmgt.collection.api.CollectionSet)1 CollectionSetVisitor (org.opennms.netmgt.collection.api.CollectionSetVisitor)1 ServiceParameters (org.opennms.netmgt.collection.api.ServiceParameters)1 XmlCollector (org.opennms.protocols.xml.collector.XmlCollector)1