Add ReplyRequiredException

This commit is contained in:
Mark Fisher
2011-09-21 13:27:47 -04:00
parent f9952da461
commit 0439909b8a
5 changed files with 52 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,10 +24,10 @@ import static org.junit.Assert.assertNull;
import org.junit.Test;
import org.springframework.integration.Message;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.MessagingException;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.channel.TestChannelResolver;
import org.springframework.integration.handler.ReplyRequiredException;
import org.springframework.integration.handler.ServiceActivatingHandler;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.support.MessageBuilder;
@@ -154,7 +154,7 @@ public class ServiceActivatorEndpointTests {
assertNull(channel.receive(0));
}
@Test(expected = MessageHandlingException.class)
@Test(expected = ReplyRequiredException.class)
public void noReplyMessageWithRequiresReply() {
QueueChannel channel = new QueueChannel(1);
ServiceActivatingHandler endpoint = new ServiceActivatingHandler(

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.handler.ReplyRequiredException;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -47,7 +47,7 @@ public class GatewayRequiresReplyTests {
assertEquals("bar", result);
}
@Test(expected = MessageHandlingException.class)
@Test(expected = ReplyRequiredException.class)
public void noReplyReceived() {
TestService gateway = (TestService) applicationContext.getBean("gateway");
gateway.test("bad");
@@ -65,7 +65,7 @@ public class GatewayRequiresReplyTests {
public String test(String s);
}
public static class LongRunningService{
public static class LongRunningService {
public String echo(String value) throws Exception{
Thread.sleep(5000);
return value;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +17,13 @@
package org.springframework.integration.router.config;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.handler.ReplyRequiredException;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.support.MessageBuilder;
@@ -94,7 +95,7 @@ public class SplitterParserTests {
assertNull(output.receive(0));
}
@Test(expected=MessageHandlingException.class)
@Test(expected = ReplyRequiredException.class)
public void splitterParserTestWithRequiresReply() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"splitterParserTests.xml", this.getClass());