INT-652
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -105,6 +105,12 @@ public class XPathMessageSplitter extends AbstractMessageSplitter {
|
||||
payload = xmlPayloadConverter.convertToDocument(payload);
|
||||
result = splitStringPayload(message);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException(
|
||||
"Unsupported payload type [" + payload.getClass().getName()
|
||||
+ "]. The XPathMessageSplitter only accepts [" + Node.class.getName()
|
||||
+ "] or [java.lang.String] typed payloads.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (ParserConfigurationException e) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -95,4 +95,9 @@ public class XPathMessageSplitterTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = MessagingException.class)
|
||||
public void invalidPayloadType() {
|
||||
splitter.handleMessage(new GenericMessage<Integer>(123));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user