Merge pull request #638 from artembilan/INT-2770

This commit is contained in:
Gary Russell
2012-10-09 16:23:56 -04:00
4 changed files with 11 additions and 6 deletions

View File

@@ -249,7 +249,7 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa
protected abstract Object handleRequestMessage(Message<?> requestMessage);
private interface RequestHandler {
public interface RequestHandler {
Object handleRequestMessage(Message<?> requestMessage);

View File

@@ -59,7 +59,7 @@ public abstract class AbstractJpaOutboundGatewayParser extends AbstractConsumerE
BeanDefinition txAdviceDefinition = IntegrationNamespaceUtils.configureTransactionAttributes(transactionalElement);
ManagedList<BeanDefinition> adviceChain = new ManagedList<BeanDefinition>();
adviceChain.add(txAdviceDefinition);
jpaOutboundGatewayBuilder.addPropertyValue("adviceChain", adviceChain);
jpaOutboundGatewayBuilder.addPropertyValue("txAdviceChain", adviceChain);
}
return jpaOutboundGatewayBuilder;

View File

@@ -18,10 +18,12 @@ import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.channel.AbstractMessageChannel;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
import org.springframework.integration.jpa.core.JpaExecutor;
@@ -36,6 +38,7 @@ import org.springframework.integration.test.util.TestUtils;
* @author Gunnar Hillert
* @author Amol Nayak
* @author Gary Russell
* @author Artem Bilan
* @since 2.2
*
*/
@@ -134,10 +137,11 @@ public class JpaOutboundGatewayParserTests {
@Test
public void advised() throws Exception {
setUp("JpaOutboundGatewayParserTests.xml", getClass(), "updatingJpaOutboundGateway");
setUp("JpaOutboundGatewayParserTests.xml", getClass(), "advised");
MessageHandler jpaOutboundGateway = context.getBean("advised.handler", MessageHandler.class);
assertTrue(AopUtils.isAopProxy(jpaOutboundGateway));
EventDrivenConsumer consumer = this.context.getBean("advised", EventDrivenConsumer.class);
final JpaOutboundGateway jpaOutboundGateway = TestUtils.getPropertyValue(consumer, "handler", JpaOutboundGateway.class);
jpaOutboundGateway.handleMessage(new GenericMessage<String>("foo"));
assertEquals(1, adviceCalled);
}

View File

@@ -46,8 +46,9 @@
request-channel="in"
reply-channel="out"
reply-timeout="100">
<int-jpa:transactional/>
<int-jpa:request-handler-advice-chain>
<bean class="org.springframework.integration.jpa.config.xml.JpaOutboundGatewayParserTests$FooAdvice" />
<bean class="org.springframework.integration.jpa.config.xml.JpaOutboundGatewayParserTests$FooAdvice"/>
</int-jpa:request-handler-advice-chain>
</int-jpa:updating-outbound-gateway>