@Test public void testDoServiceWithEventHandler_Null() throws Exception { MockMessageProducer producer = new MockMessageProducer(); AdvancedMessageSplitterService service = createServiceImpl(new SimpleRegexpMessageSplitter("\\|"), producer); AdaptrisMessage msg = createMessage(REGEXP_DATA); service.registerEventHandler(null); ExampleServiceCase.execute(service, msg); assertEquals("Number of messages", 4, producer.getMessages().size()); assertEquals("splitCount metadata", 4, Integer.parseInt(msg.getMetadataValue(MessageSplitterServiceImp.KEY_SPLIT_MESSAGE_COUNT))); int count = 0; for (AdaptrisMessage m : producer.getMessages()) { count ++; assertEquals(count, Integer.parseInt(m.getMetadataValue(KEY_CURRENT_SPLIT_MESSAGE_COUNT))); } }
@Override public void registerEventHandler(EventHandler eh) { eventHandler = eh; }
AdvancedMessageSplitterService extends MessageSplitterServiceImp implements EventHandlerAware, ServiceWrapper { @Override public void registerEventHandler(EventHandler eh) { eventHandler = eh; } }
AdvancedMessageSplitterService extends MessageSplitterServiceImp implements EventHandlerAware, ServiceWrapper { @Override public void registerEventHandler(EventHandler eh) { eventHandler = eh; } AdvancedMessageSplitterService(); }
AdvancedMessageSplitterService extends MessageSplitterServiceImp implements EventHandlerAware, ServiceWrapper { @Override public void registerEventHandler(EventHandler eh) { eventHandler = eh; } AdvancedMessageSplitterService(); @Override void start(); @Override void stop(); Service getService(); void setService(Service sc); Boolean getSendEvents(); boolean sendEvents(); void setSendEvents(Boolean b); @Override void registerEventHandler(EventHandler eh); @Override void prepare(); @Override Service[] wrappedServices(); }
AdvancedMessageSplitterService extends MessageSplitterServiceImp implements EventHandlerAware, ServiceWrapper { @Override public void registerEventHandler(EventHandler eh) { eventHandler = eh; } AdvancedMessageSplitterService(); @Override void start(); @Override void stop(); Service getService(); void setService(Service sc); Boolean getSendEvents(); boolean sendEvents(); void setSendEvents(Boolean b); @Override void registerEventHandler(EventHandler eh); @Override void prepare(); @Override Service[] wrappedServices();  }