Search in sources :

Example 11 with MockEventIpcManager

use of org.opennms.netmgt.dao.mock.MockEventIpcManager in project opennms by OpenNMS.

the class AMQPEventReceiverBlueprintTest method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    MockEventIpcManager mockEventIpcManager = new MockEventIpcManager();
    services.put(EventIpcManager.class.getName(), asService(mockEventIpcManager, null));
    MockNodeDao mockNodeDao = new MockNodeDao();
    services.put(NodeDao.class.getName(), asService(mockNodeDao, null));
}
Also used : MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) NodeDao(org.opennms.netmgt.dao.api.NodeDao) MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) EventIpcManager(org.opennms.netmgt.events.api.EventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager)

Example 12 with MockEventIpcManager

use of org.opennms.netmgt.dao.mock.MockEventIpcManager in project opennms by OpenNMS.

the class AMQPEventForwarderBlueprintTest method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    MockEventIpcManager mockEventIpcManager = new MockEventIpcManager();
    services.put(EventIpcManager.class.getName(), asService(mockEventIpcManager, null));
    MockNodeDao mockNodeDao = new MockNodeDao();
    services.put(NodeDao.class.getName(), asService(mockNodeDao, null));
}
Also used : MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) NodeDao(org.opennms.netmgt.dao.api.NodeDao) MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) EventIpcManager(org.opennms.netmgt.events.api.EventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager)

Example 13 with MockEventIpcManager

use of org.opennms.netmgt.dao.mock.MockEventIpcManager in project opennms by OpenNMS.

the class EifAdapterBlueprintTest method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    MockEventIpcManager mockEventIpcManager = new MockEventIpcManager();
    MockNodeDao mockNodeDao = new MockNodeDao();
    services.put(EventIpcManager.class.getName(), asService(mockEventIpcManager, null));
    services.put(NodeDao.class.getName(), asService(mockNodeDao, null));
}
Also used : MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) NodeDao(org.opennms.netmgt.dao.api.NodeDao) MockNodeDao(org.opennms.netmgt.dao.mock.MockNodeDao) EventIpcManager(org.opennms.netmgt.events.api.EventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager)

Example 14 with MockEventIpcManager

use of org.opennms.netmgt.dao.mock.MockEventIpcManager in project opennms by OpenNMS.

the class BroadcastEventProcessorTest method testReloadDaemonConfig.

public void testReloadDaemonConfig() {
    MockEventIpcManager eventIpcManager = new MockEventIpcManager();
    BroadcastEventProcessor processor = new BroadcastEventProcessor(eventIpcManager, m_eventConfDao);
    EventBuilder eventBuilder = new EventBuilder(EventConstants.RELOAD_DAEMON_CONFIG_UEI, "dunno");
    eventBuilder.addParam(EventConstants.PARM_DAEMON_NAME, "Eventd");
    // Expect a call to reload the EventConfDao
    m_eventConfDao.reload();
    m_mocks.replayAll();
    processor.onEvent(eventBuilder.getEvent());
    m_mocks.verifyAll();
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager)

Example 15 with MockEventIpcManager

use of org.opennms.netmgt.dao.mock.MockEventIpcManager in project opennms by OpenNMS.

the class BroadcastEventProcessorTest method testInstantiateWithNullEventConfDao.

public void testInstantiateWithNullEventConfDao() {
    ThrowableAnticipator ta = new ThrowableAnticipator();
    ta.anticipate(new IllegalArgumentException("argument eventConfDao must not be null"));
    try {
        new BroadcastEventProcessor(new MockEventIpcManager(), null);
    } catch (Throwable t) {
        ta.throwableReceived(t);
    }
    ta.verifyAnticipated();
}
Also used : MockEventIpcManager(org.opennms.netmgt.dao.mock.MockEventIpcManager) ThrowableAnticipator(org.opennms.test.ThrowableAnticipator)

Aggregations

MockEventIpcManager (org.opennms.netmgt.dao.mock.MockEventIpcManager)26 Before (org.junit.Before)14 NodeDao (org.opennms.netmgt.dao.api.NodeDao)5 MockPollerConfig (org.opennms.netmgt.mock.MockPollerConfig)5 EasyMockUtils (org.opennms.test.mock.EasyMockUtils)5 EventIpcManager (org.opennms.netmgt.events.api.EventIpcManager)4 MockNetwork (org.opennms.netmgt.mock.MockNetwork)4 OutageAnticipator (org.opennms.netmgt.mock.OutageAnticipator)4 File (java.io.File)3 PollOutagesConfigFactory (org.opennms.netmgt.config.PollOutagesConfigFactory)3 MockNodeDao (org.opennms.netmgt.dao.mock.MockNodeDao)3 FilterDao (org.opennms.netmgt.filter.api.FilterDao)3 LocationAwarePingClient (org.opennms.netmgt.icmp.proxy.LocationAwarePingClient)3 MockPersisterFactory (org.opennms.netmgt.mock.MockPersisterFactory)3 NetworkBuilder (org.opennms.netmgt.model.NetworkBuilder)3 OnmsServiceType (org.opennms.netmgt.model.OnmsServiceType)3 PollableNetwork (org.opennms.netmgt.poller.pollables.PollableNetwork)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 Date (java.util.Date)2