Search in sources :

Example 1 with XmlDataCollectionConfigDaoJaxb

use of org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb in project opennms by OpenNMS.

the class AbstractVTDXmlCollectorTest method setUp.

/**
 * Sets the up.
 *
 * @throws Exception the exception
 */
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging();
    m_rrdStrategy = new JRobinRrdStrategy();
    m_resourceStorageDao = new FilesystemResourceStorageDao();
    m_resourceStorageDao.setRrdDirectory(m_temporaryFolder.getRoot());
    m_temporaryFolder.newFolder("snmp");
    m_persisterFactory = new RrdPersisterFactory();
    m_persisterFactory.setResourceStorageDao(m_resourceStorageDao);
    m_persisterFactory.setRrdStrategy(m_rrdStrategy);
    m_collectionAgent = new MockCollectionAgent(1, "mynode.local", InetAddrUtils.addr("127.0.0.1"));
    m_eventProxy = EasyMock.createMock(EventProxy.class);
    m_xmlCollectionDao = new XmlDataCollectionConfigDaoJaxb();
    Resource resource = new FileSystemResource(getXmlConfigFileName());
    m_xmlCollectionDao.setConfigResource(resource);
    m_xmlCollectionDao.afterPropertiesSet();
    MockDocumentBuilder.setXmlFileName(getXmlSampleFileName());
    EasyMock.replay(m_eventProxy);
}
Also used : FilesystemResourceStorageDao(org.opennms.netmgt.dao.support.FilesystemResourceStorageDao) Resource(org.springframework.core.io.Resource) FileSystemResource(org.springframework.core.io.FileSystemResource) RrdPersisterFactory(org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory) MockCollectionAgent(org.opennms.core.collection.test.MockCollectionAgent) FileSystemResource(org.springframework.core.io.FileSystemResource) JRobinRrdStrategy(org.opennms.netmgt.rrd.jrobin.JRobinRrdStrategy) XmlDataCollectionConfigDaoJaxb(org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb) EventProxy(org.opennms.netmgt.events.api.EventProxy) Before(org.junit.Before)

Example 2 with XmlDataCollectionConfigDaoJaxb

use of org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb in project opennms by OpenNMS.

the class NodeLevelDataOnMultipleNodesTest method setUp.

/**
 * Sets the up.
 *
 * @throws Exception the exception
 */
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging();
    m_rrdStrategy = getRrdStrategy();
    m_resourceStorageDao = new FilesystemResourceStorageDao();
    m_resourceStorageDao.setRrdDirectory(m_temporaryFolder.getRoot());
    m_temporaryFolder.newFolder("snmp");
    m_persisterFactory = new RrdPersisterFactory();
    m_persisterFactory.setResourceStorageDao(m_resourceStorageDao);
    m_persisterFactory.setRrdStrategy(m_rrdStrategy);
    m_eventProxy = EasyMock.createMock(EventProxy.class);
    m_xmlCollectionDao = new XmlDataCollectionConfigDaoJaxb();
    Resource resource = new FileSystemResource(getXmlConfigFileName());
    m_xmlCollectionDao.setConfigResource(resource);
    m_xmlCollectionDao.afterPropertiesSet();
    m_collector = new XmlCollector();
    m_collector.setXmlCollectionDao(m_xmlCollectionDao);
    EasyMock.replay(m_eventProxy);
}
Also used : FilesystemResourceStorageDao(org.opennms.netmgt.dao.support.FilesystemResourceStorageDao) Resource(org.springframework.core.io.Resource) FileSystemResource(org.springframework.core.io.FileSystemResource) RrdPersisterFactory(org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory) FileSystemResource(org.springframework.core.io.FileSystemResource) XmlDataCollectionConfigDaoJaxb(org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb) EventProxy(org.opennms.netmgt.events.api.EventProxy) Before(org.junit.Before)

Example 3 with XmlDataCollectionConfigDaoJaxb

use of org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb in project opennms by OpenNMS.

the class XmlCollectorITCase method setUp.

/**
 * Sets the up.
 *
 * @throws Exception the exception
 */
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging();
    initializeRrdStrategy();
    initializeDocumentBuilder();
    m_collectionAgent = new MockCollectionAgent(1, "mynode.local", InetAddrUtils.addr("127.0.0.1"));
    m_eventProxy = EasyMock.createMock(EventProxy.class);
    m_xmlCollectionDao = new XmlDataCollectionConfigDaoJaxb();
    Resource resource = new FileSystemResource(getConfigFileName());
    m_xmlCollectionDao.setConfigResource(resource);
    m_xmlCollectionDao.afterPropertiesSet();
    EasyMock.replay(m_eventProxy);
}
Also used : Resource(org.springframework.core.io.Resource) FileSystemResource(org.springframework.core.io.FileSystemResource) MockCollectionAgent(org.opennms.core.collection.test.MockCollectionAgent) FileSystemResource(org.springframework.core.io.FileSystemResource) XmlDataCollectionConfigDaoJaxb(org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb) EventProxy(org.opennms.netmgt.events.api.EventProxy) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)3 EventProxy (org.opennms.netmgt.events.api.EventProxy)3 XmlDataCollectionConfigDaoJaxb (org.opennms.protocols.xml.dao.jaxb.XmlDataCollectionConfigDaoJaxb)3 FileSystemResource (org.springframework.core.io.FileSystemResource)3 Resource (org.springframework.core.io.Resource)3 MockCollectionAgent (org.opennms.core.collection.test.MockCollectionAgent)2 RrdPersisterFactory (org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory)2 FilesystemResourceStorageDao (org.opennms.netmgt.dao.support.FilesystemResourceStorageDao)2 JRobinRrdStrategy (org.opennms.netmgt.rrd.jrobin.JRobinRrdStrategy)1