Search in sources :

Example 1 with EventHandlerAwareProducer

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

the class StandardWorkflowTest method testInitialiseWithEventAware.

@Test
public void testInitialiseWithEventAware() throws Exception {
    EventHandlerAwareProducer prod = new EventHandlerAwareProducer();
    EventHandlerAwareConsumer cons = new EventHandlerAwareConsumer();
    EventHandlerAwareService service = new EventHandlerAwareService();
    MockChannel channel = createChannel(prod, Arrays.asList(new Service[] { service }));
    ((WorkflowImp) channel.getWorkflowList().get(0)).setConsumer(cons);
    log.error("------------{}---------------", getName());
    channel.requestInit();
    EventHandler eh = channel.obtainEventHandler();
    log.error("Obtained [{}]", eh);
    log.error("------------{}---------------", getName());
    assertEquals(eh, prod.retrieveEventHandler());
    assertEquals(eh, cons.retrieveEventHandler());
    assertEquals(eh, service.retrieveEventHandler());
}
Also used : EventHandlerAwareConsumer(com.adaptris.core.stubs.EventHandlerAwareConsumer) MockChannel(com.adaptris.core.stubs.MockChannel) EventHandlerAwareProducer(com.adaptris.core.stubs.EventHandlerAwareProducer) PayloadFromTemplateService(com.adaptris.core.services.metadata.PayloadFromTemplateService) EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) MockSkipProducerService(com.adaptris.core.stubs.MockSkipProducerService) ThrowExceptionService(com.adaptris.core.services.exception.ThrowExceptionService) AddMetadataService(com.adaptris.core.services.metadata.AddMetadataService) EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) Test(org.junit.Test)

Aggregations

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 EventHandlerAwareService (com.adaptris.core.stubs.EventHandlerAwareService)1 MockChannel (com.adaptris.core.stubs.MockChannel)1 MockSkipProducerService (com.adaptris.core.stubs.MockSkipProducerService)1 Test (org.junit.Test)1