Search in sources :

Example 6 with EventHandlerAwareService

use of com.adaptris.core.stubs.EventHandlerAwareService in project interlok by adaptris.

the class StandardProcessingExceptionHandlerTest method testAdapter_HasEventHandler.

@Test
public void testAdapter_HasEventHandler() throws Exception {
    EventHandlerAwareService srv = new EventHandlerAwareService();
    StandardProcessingExceptionHandler meh = new StandardProcessingExceptionHandler(srv);
    DefaultEventHandler eventHandler = new DefaultEventHandler();
    Adapter a = AdapterTest.createAdapter(getName(), eventHandler);
    a.setMessageErrorHandler(meh);
    try {
        LifecycleHelper.init(a);
        assertEquals(eventHandler, srv.retrieveEventHandler());
    } finally {
        LifecycleHelper.close(a);
    }
}
Also used : EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) Test(org.junit.Test)

Example 7 with EventHandlerAwareService

use of com.adaptris.core.stubs.EventHandlerAwareService in project interlok by adaptris.

the class StandardProcessingExceptionHandlerTest method testWorkflow_HasEventHandler.

@Test
public void testWorkflow_HasEventHandler() throws Exception {
    EventHandlerAwareService srv = new EventHandlerAwareService();
    StandardProcessingExceptionHandler meh = new StandardProcessingExceptionHandler(srv);
    DefaultEventHandler eventHandler = new DefaultEventHandler();
    Adapter a = AdapterTest.createAdapter(getName(), eventHandler);
    Channel c = new Channel();
    StandardWorkflow wf = new StandardWorkflow();
    wf.setMessageErrorHandler(meh);
    c.getWorkflowList().add(wf);
    a.getChannelList().add(c);
    try {
        LifecycleHelper.init(a);
        assertEquals(eventHandler, srv.retrieveEventHandler());
    } finally {
        LifecycleHelper.close(a);
    }
}
Also used : EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) Test(org.junit.Test)

Example 8 with EventHandlerAwareService

use of com.adaptris.core.stubs.EventHandlerAwareService in project interlok by adaptris.

the class RetryMessageErrorHandlerTest method testAdapter_HasEventHandler.

@Test
public void testAdapter_HasEventHandler() throws Exception {
    EventHandlerAwareService srv = new EventHandlerAwareService();
    RetryMessageErrorHandler meh = new RetryMessageErrorHandler(srv);
    DefaultEventHandler eventHandler = new DefaultEventHandler();
    Adapter a = AdapterTest.createAdapter(getName(), eventHandler);
    a.setMessageErrorHandler(meh);
    try {
        LifecycleHelper.init(a);
        assertEquals(eventHandler, srv.retrieveEventHandler());
    } finally {
        LifecycleHelper.close(a);
    }
}
Also used : EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) Test(org.junit.Test)

Example 9 with EventHandlerAwareService

use of com.adaptris.core.stubs.EventHandlerAwareService in project interlok by adaptris.

the class RetryMessageErrorHandlerTest method testWorkflow_HasEventHandler.

@Test
public void testWorkflow_HasEventHandler() throws Exception {
    EventHandlerAwareService srv = new EventHandlerAwareService();
    RetryMessageErrorHandler meh = new RetryMessageErrorHandler(srv);
    DefaultEventHandler eventHandler = new DefaultEventHandler();
    Adapter a = AdapterTest.createAdapter(getName(), eventHandler);
    Channel c = new Channel();
    StandardWorkflow wf = new StandardWorkflow();
    wf.setMessageErrorHandler(meh);
    c.getWorkflowList().add(wf);
    a.getChannelList().add(c);
    try {
        LifecycleHelper.init(a);
        assertEquals(eventHandler, srv.retrieveEventHandler());
    } finally {
        LifecycleHelper.close(a);
    }
}
Also used : MockChannel(com.adaptris.core.stubs.MockChannel) EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) Test(org.junit.Test)

Aggregations

EventHandlerAwareService (com.adaptris.core.stubs.EventHandlerAwareService)9 Test (org.junit.Test)8 MockChannel (com.adaptris.core.stubs.MockChannel)3 DefaultEventHandler (com.adaptris.core.DefaultEventHandler)1 NullService (com.adaptris.core.NullService)1 ServiceCollectionImp (com.adaptris.core.ServiceCollectionImp)1 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)1 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)1 PayloadFromTemplateService (com.adaptris.core.services.metadata.PayloadFromTemplateService)1 EventHandlerAwareConsumer (com.adaptris.core.stubs.EventHandlerAwareConsumer)1 EventHandlerAwareProducer (com.adaptris.core.stubs.EventHandlerAwareProducer)1 MockSkipProducerService (com.adaptris.core.stubs.MockSkipProducerService)1