@Test @SuppressWarnings("deprecation") public void testWorkflow_ReplyProducerFailure() throws Exception { Channel channel = new MockChannel(); RequestReplyWorkflow workflow = new RequestReplyWorkflow(); workflow.setConsumer(new MockMessageConsumer()); MockMessageProducer errorProducer = new MockMessageProducer(); workflow.setMessageErrorHandler(new StandardProcessingExceptionHandler(new StandaloneProducer(errorProducer))); AdaptrisMessage reply = AdaptrisMessageFactory.getDefaultInstance().newMessage(); AdaptrisMessageProducer replier = mock(AdaptrisMessageProducer.class); doThrow(new ProduceException()).when(replier).produce(any(AdaptrisMessage.class)); doThrow(new ProduceException()).when(replier).produce(any(AdaptrisMessage.class), any(ProduceDestination.class)); when(replier.createName()).thenReturn("mock"); when(replier.createQualifier()).thenReturn("mock"); when(replier.isTrackingEndpoint()).thenReturn(false); AdaptrisMessageProducer requestor = mock(AdaptrisMessageProducer.class); when(requestor.request(any(AdaptrisMessage.class))).thenReturn(reply); when(requestor.request(any(AdaptrisMessage.class), any(ProduceDestination.class))).thenReturn(reply); when(requestor.request(any(AdaptrisMessage.class), any(ProduceDestination.class), anyLong())).thenReturn(reply); when(requestor.request(any(AdaptrisMessage.class), anyLong())).thenReturn(reply); when(requestor.createName()).thenReturn("mock"); when(requestor.createQualifier()).thenReturn("mock"); when(requestor.isTrackingEndpoint()).thenReturn(false); workflow.setProducer(requestor); workflow.setReplyProducer(replier); channel.getWorkflowList().add(workflow); try { start(channel); submitMessages(workflow, 1); assertEquals(1, errorProducer.getMessages().size()); } finally { stop(channel); } }
public void setReplyProducer(AdaptrisMessageProducer producer) { replyProducer = Args.notNull(producer, "replyProducer"); }
RequestReplyWorkflow extends StandardWorkflow { public void setReplyProducer(AdaptrisMessageProducer producer) { replyProducer = Args.notNull(producer, "replyProducer"); } }
RequestReplyWorkflow extends StandardWorkflow { public void setReplyProducer(AdaptrisMessageProducer producer) { replyProducer = Args.notNull(producer, "replyProducer"); } RequestReplyWorkflow(); }
RequestReplyWorkflow extends StandardWorkflow { public void setReplyProducer(AdaptrisMessageProducer producer) { replyProducer = Args.notNull(producer, "replyProducer"); } RequestReplyWorkflow(); @Override void doProduce(AdaptrisMessage msg); @Override void registerChannel(Channel c); void setReplyServiceCollection(ServiceCollection services); ServiceCollection getReplyServiceCollection(); void setReplyProducer(AdaptrisMessageProducer producer); AdaptrisMessageProducer getReplyProducer(); TimeInterval getReplyTimeout(); void setReplyTimeout(TimeInterval replyTimeout); void setRetainUniqueId(Boolean b); Boolean getRetainUniqueId(); }
RequestReplyWorkflow extends StandardWorkflow { public void setReplyProducer(AdaptrisMessageProducer producer) { replyProducer = Args.notNull(producer, "replyProducer"); } RequestReplyWorkflow(); @Override void doProduce(AdaptrisMessage msg); @Override void registerChannel(Channel c); void setReplyServiceCollection(ServiceCollection services); ServiceCollection getReplyServiceCollection(); void setReplyProducer(AdaptrisMessageProducer producer); AdaptrisMessageProducer getReplyProducer(); TimeInterval getReplyTimeout(); void setReplyTimeout(TimeInterval replyTimeout); void setRetainUniqueId(Boolean b); Boolean getRetainUniqueId();  }