use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class SimpleWebServiceOutboundGatewayTests method testWsOutboundGatewayInsideChain.
// INT-1029
@Test
public void testWsOutboundGatewayInsideChain() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("WebServiceOutboundGatewayInsideChainTests-context.xml", this.getClass());
MessageChannel channel = context.getBean("wsOutboundGatewayInsideChain", MessageChannel.class);
channel.send(MessageBuilder.withPayload("<test>foo</test>").build());
PollableChannel replyChannel = context.getBean("replyChannel", PollableChannel.class);
Message<?> replyMessage = replyChannel.receive();
assertThat(replyMessage.getPayload().toString(), Matchers.endsWith(response));
context.close();
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class RecipientListRouterParserTests method noSelectorMatchRouter.
@Test
public void noSelectorMatchRouter() {
context.start();
Message<?> message = new GenericMessage<Integer>(1);
noSelectorMatchInput.send(message);
PollableChannel chanel1 = (PollableChannel) context.getBean("channel1");
PollableChannel chanel2 = (PollableChannel) context.getBean("channel2");
Message<?> output = chanel1.receive(0);
assertNotNull(output);
assertTrue(output.getPayload().equals(1));
assertNull(chanel2.receive(0));
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class RecipientListRouterParserTests method simpleDynamicRouter.
@Test
public void simpleDynamicRouter() {
context.start();
Message<?> message = new GenericMessage<Integer>(1);
simpleDynamicInput.send(message);
PollableChannel chanel1 = (PollableChannel) context.getBean("channel1");
PollableChannel chanel2 = (PollableChannel) context.getBean("channel2");
assertTrue(chanel1.receive(0).getPayload().equals(1));
assertNull(chanel2.receive(0));
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class SplitterAggregatorTests method testSplitterAndAggregator.
@Test
public void testSplitterAndAggregator() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("splitterAggregatorTests.xml", this.getClass());
MessageChannel inputChannel = (MessageChannel) context.getBean("numbers");
PollableChannel outputChannel = (PollableChannel) context.getBean("results");
inputChannel.send(new GenericMessage<Numbers>(this.nextTen()));
Message<?> result1 = outputChannel.receive(1000);
assertNotNull(result1);
assertEquals(Integer.class, result1.getPayload().getClass());
assertEquals(55, result1.getPayload());
inputChannel.send(new GenericMessage<Numbers>(this.nextTen()));
Message<?> result2 = outputChannel.receive(1000);
assertNotNull(result2);
assertEquals(Integer.class, result2.getPayload().getClass());
assertEquals(155, result2.getPayload());
context.close();
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class JdbcPollingChannelAdapterParserTests method setupMessagingTemplate.
protected void setupMessagingTemplate() {
PollableChannel pollableChannel = this.appCtx.getBean("target", PollableChannel.class);
this.messagingTemplate = new MessagingTemplate();
this.messagingTemplate.setDefaultDestination(pollableChannel);
this.messagingTemplate.setReceiveTimeout(10000);
}
Aggregations