INT-1998 refactored AmqpInboundGateway to be compatible with latest parser changes

This commit is contained in:
Mark Fisher
2011-07-22 18:52:58 -04:00
parent d4955fe914
commit 30af8e6fd4
4 changed files with 17 additions and 23 deletions

View File

@@ -5,7 +5,7 @@
xmlns:console="http://www.springframework.org/schema/integration/stream"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

View File

@@ -20,8 +20,8 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.util.ReflectionTestUtils;
/**
@@ -31,18 +31,18 @@ import org.springframework.test.util.ReflectionTestUtils;
*/
public class OutboundGatewayTests {
private XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(getClass().getSimpleName()+"-context.xml", getClass()));
private ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());
@Test
public void testVanillaConfiguration() throws Exception {
assertTrue(beanFactory.containsBeanDefinition("vanilla"));
beanFactory.getBean("vanilla");
assertTrue(context.getBeanFactory().containsBeanDefinition("vanilla"));
context.getBean("vanilla");
}
@Test
public void testExpressionBasedConfiguration() throws Exception {
assertTrue(beanFactory.containsBeanDefinition("expression"));
Object target = beanFactory.getBean("expression");
assertTrue(context.getBeanFactory().containsBeanDefinition("expression"));
Object target = context.getBean("expression");
assertNotNull(ReflectionTestUtils.getField(ReflectionTestUtils.getField(target, "handler"), "routingKeyGenerator"));
}