use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class PollerWithErrorChannelTests method testWithErrorChannel.
@Test
public void testWithErrorChannel() throws Exception {
ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("PollerWithErrorChannel-context.xml", this.getClass());
SourcePollingChannelAdapter adapter = ac.getBean("withErrorChannel", SourcePollingChannelAdapter.class);
adapter.start();
PollableChannel errorChannel = ac.getBean("eChannel", PollableChannel.class);
assertNotNull(errorChannel.receive(10000));
adapter.stop();
ac.close();
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class GatewayParserTests method testAsyncDisabledGateway.
@Test
public void testAsyncDisabledGateway() throws Exception {
PollableChannel requestChannel = (PollableChannel) context.getBean("requestChannel");
MessageChannel replyChannel = (MessageChannel) context.getBean("replyChannel");
this.startResponder(requestChannel, replyChannel);
TestService service = context.getBean("asyncOff", TestService.class);
Future<Message<?>> result = service.async("futureSync");
Message<?> reply = result.get(10, TimeUnit.SECONDS);
assertEquals("futureSync", reply.getPayload());
Object serviceBean = context.getBean("&asyncOff");
assertNull(TestUtils.getPropertyValue(serviceBean, "asyncExecutor"));
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class GatewayParserTests method testRequestReply.
@Test
public void testRequestReply() {
PollableChannel requestChannel = (PollableChannel) context.getBean("requestChannel");
MessageChannel replyChannel = (MessageChannel) context.getBean("replyChannel");
this.startResponder(requestChannel, replyChannel);
TestService service = (TestService) context.getBean("requestReply");
String result = service.requestReply("foo");
assertEquals("foo", result);
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class GatewayParserTests method testMonoGateway.
@Test
public void testMonoGateway() throws Exception {
PollableChannel requestChannel = context.getBean("requestChannel", PollableChannel.class);
MessageChannel replyChannel = context.getBean("replyChannel", MessageChannel.class);
this.startResponder(requestChannel, replyChannel);
TestService service = context.getBean("promise", TestService.class);
Mono<Message<?>> result = service.promise("foo");
Message<?> reply = result.block(Duration.ofSeconds(1));
assertEquals("foo", reply.getPayload());
assertNotNull(TestUtils.getPropertyValue(context.getBean("&promise"), "asyncExecutor"));
}
use of org.springframework.messaging.PollableChannel in project spring-integration by spring-projects.
the class GatewayParserTests method testSolicitResponse.
@Test
public void testSolicitResponse() {
PollableChannel channel = (PollableChannel) context.getBean("replyChannel");
channel.send(new GenericMessage<String>("foo"));
TestService service = (TestService) context.getBean("solicitResponse");
String result = service.solicitResponse();
assertEquals("foo", result);
}
Aggregations