INT-3426: Add <r-h-a-c> for all outbound-c-a
JIRA: https://jira.spring.io/browse/INT-3426 Provide other fixes for XSD. E.g. not all adapter have had `<poller>`
This commit is contained in:
@@ -1133,6 +1133,7 @@
|
||||
<xsd:all>
|
||||
<xsd:element name="poller" type="basePollerType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element ref="beans:bean" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="request-handler-advice-chain" type="handlerAdviceChainType" minOccurs="0" maxOccurs="1" />
|
||||
</xsd:all>
|
||||
<xsd:attributeGroup ref="channelAdapterAttributes" />
|
||||
<xsd:attribute name="order">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
|
||||
|
||||
<channel id="channel"/>
|
||||
|
||||
|
||||
<channel id="channelB">
|
||||
<queue capacity="2"/>
|
||||
</channel>
|
||||
@@ -22,10 +22,13 @@
|
||||
|
||||
<outbound-channel-adapter id="adapterB" channel="channelB" method="out" order="99" auto-startup="false">
|
||||
<beans:bean class="org.springframework.integration.config.xml.DefaultOutboundChannelAdapterParserTests$TestBean"/>
|
||||
<poller task-executor="executor" max-messages-per-poll="5" fixed-delay="20" />
|
||||
<poller task-executor="executor" max-messages-per-poll="5" fixed-delay="20" />
|
||||
<request-handler-advice-chain>
|
||||
<retry-advice/>
|
||||
</request-handler-advice-chain>
|
||||
</outbound-channel-adapter>
|
||||
|
||||
<task:executor id="executor" pool-size="5" />
|
||||
<task:executor id="executor" pool-size="5" />
|
||||
|
||||
<outbound-channel-adapter id="adapterC" channel="channelC" order="99">
|
||||
<beans:bean class="org.springframework.integration.config.TestConsumer"/>
|
||||
|
||||
@@ -16,15 +16,19 @@
|
||||
|
||||
package org.springframework.integration.config.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.config.TestConsumer;
|
||||
import org.springframework.integration.handler.MethodInvokingMessageHandler;
|
||||
import org.springframework.integration.handler.advice.RequestHandlerRetryAdvice;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@@ -59,14 +63,15 @@ public class DefaultOutboundChannelAdapterParserTests {
|
||||
assertEquals(MethodInvokingMessageHandler.class, handler.getClass());
|
||||
assertEquals(99, TestUtils.getPropertyValue(handler, "order"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void checkConfigWithInnerBeanAndPoller() {
|
||||
Object adapter = context.getBean("adapterB");
|
||||
assertEquals(Boolean.FALSE, TestUtils.getPropertyValue(adapter, "autoStartup"));
|
||||
Object handler = TestUtils.getPropertyValue(adapter, "handler");
|
||||
assertEquals(MethodInvokingMessageHandler.class, handler.getClass());
|
||||
assertEquals(99, TestUtils.getPropertyValue(handler, "order"));
|
||||
assertTrue(AopUtils.isAopProxy(handler));
|
||||
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors.first.item.advice"),
|
||||
Matchers.instanceOf(RequestHandlerRetryAdvice.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user