OPEN - issue INT-309: XPath Message Selector

http://jira.springframework.org/browse/INT-309
Throw messaging exception if XPathSingleChannelNameResolver evaluation returns empty string
This commit is contained in:
Jonas Partner
2008-09-30 09:36:10 +00:00
parent ed96dcc58f
commit 1b4598568c
2 changed files with 20 additions and 3 deletions

View File

@@ -65,4 +65,12 @@ public class XPathSingleChannelNameResolverTests {
.getElementsByTagName("two").item(0)));
assertEquals("bob", channelNames[0]);
}
@Test(expected=MessagingException.class)
public void testEvaluationReturnsEmptyString() throws Exception {
XPathSingleChannelNameResolver resolver = new XPathSingleChannelNameResolver("/yellow");
Document testDocument = XmlTestUtil.getDocumentForString("<one><two><three>bob</three></two></one>");
resolver.resolveChannelNames(new GenericMessage<Node>(testDocument));
}
}