Search in sources :

Example 1 with AdapterCloseEvent

use of com.adaptris.core.event.AdapterCloseEvent in project interlok by adaptris.

the class AdapterTest method testAdapterLogsEventSendException.

// Probably a redundant test, but you get a nice warm feeling from have 100%
// code coverage don't you
@Test
public void testAdapterLogsEventSendException() throws Exception {
    Adapter a = createAdapter("testAdapterLogsEventSendException", new StubEventHandler() {

        @Override
        public void send(Event evt) throws CoreException {
            if (evt instanceof AdapterCloseEvent) {
                throw new CoreException();
            } else if (evt instanceof AdapterStopEvent) {
                throw new CoreException();
            }
        }
    });
    a.requestStart();
    a.requestClose();
}
Also used : AdapterCloseEvent(com.adaptris.core.event.AdapterCloseEvent) StubEventHandler(com.adaptris.core.stubs.StubEventHandler) AdapterCloseEvent(com.adaptris.core.event.AdapterCloseEvent) StubAdapterStartUpEvent(com.adaptris.core.stubs.StubAdapterStartUpEvent) AdapterStopEvent(com.adaptris.core.event.AdapterStopEvent) AdapterInitEvent(com.adaptris.core.event.AdapterInitEvent) AdapterStartEvent(com.adaptris.core.event.AdapterStartEvent) AdapterStopEvent(com.adaptris.core.event.AdapterStopEvent) Test(org.junit.Test)

Aggregations

AdapterCloseEvent (com.adaptris.core.event.AdapterCloseEvent)1 AdapterInitEvent (com.adaptris.core.event.AdapterInitEvent)1 AdapterStartEvent (com.adaptris.core.event.AdapterStartEvent)1 AdapterStopEvent (com.adaptris.core.event.AdapterStopEvent)1 StubAdapterStartUpEvent (com.adaptris.core.stubs.StubAdapterStartUpEvent)1 StubEventHandler (com.adaptris.core.stubs.StubEventHandler)1 Test (org.junit.Test)1