INT-2218 - Chain Parser Validation Improvements
Components within Chain: Add parser validation For reference see: https://jira.springsource.org/browse/INT-2218 INT-2218 - Code review changes INT-2218 - Fix HttpOutboundGatewayParserTests INT-2218 - Remove input-channel validation Was already covered by PR #592
This commit is contained in:
committed by
Gary Russell
parent
c9f73a8a49
commit
7055845424
@@ -20,8 +20,10 @@ import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.config.PropertiesFactoryBean;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@@ -208,6 +210,23 @@ public class ChainElementsFailureTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void chainResequencerPoller() throws Exception {
|
||||
|
||||
try {
|
||||
this.bootStrap("resequencer-poller");
|
||||
fail("Expected a XmlBeanDefinitionStoreException to be thrown.");
|
||||
}
|
||||
catch (BeanDefinitionParsingException e) {
|
||||
final String expectedMessage = "Configuration problem: " +
|
||||
"'int:resequencer' must not define a 'poller' sub-element " +
|
||||
"when used within a chain.";
|
||||
final String actualMessage = e.getMessage();
|
||||
assertTrue("Error message did not start with '" + expectedMessage +
|
||||
"' but instead returned: '" + actualMessage + "'", actualMessage.startsWith(expectedMessage));
|
||||
}
|
||||
}
|
||||
|
||||
private ApplicationContext bootStrap(String configProperty) throws Exception {
|
||||
PropertiesFactoryBean pfb = new PropertiesFactoryBean();
|
||||
pfb.setLocation(new ClassPathResource("org/springframework/integration/config/xml/chain-elements-config.properties"));
|
||||
|
||||
@@ -75,3 +75,10 @@ resequencer=\
|
||||
<int:chain input-channel="input"> \
|
||||
<int:resequencer input-channel="fail"/> \
|
||||
</int:chain>
|
||||
|
||||
resequencer-poller=\
|
||||
<int:chain input-channel="input"> \
|
||||
<int:resequencer> \
|
||||
<int:poller fixed-rate="5000" max-messages-per-poll="10" />\
|
||||
</int:resequencer> \
|
||||
</int:chain>
|
||||
Reference in New Issue
Block a user