Author: ay
Date: Tue Jan 15 10:53:03 2013
New Revision: 1433349
URL: http://svn.apache.org/viewvc?rev=1433349&view=rev
Log:
Merged revisions 1433347 via svn merge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1433347 | ay | 2013-01-15 11:48:50 +0100 (Tue, 15 Jan 2013) | 1 line
an adjustment to the change made with CXF-4511
........
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
Propchange: cxf/branches/2.7.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 15 10:53:03 2013
@@ -1 +1 @@
-/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305
+/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305,1433347
Modified:
cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java?rev=1433349&r1=1433348&r2=1433349&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
(original)
+++
cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
Tue Jan 15 10:53:03 2013
@@ -267,7 +267,7 @@ public class ProtocolVariationsTest exte
}
@Test
- public void testInvalidWRMOnReceive() throws Exception {
+ public void testInvalidWSRMMustUnderstandOnReceive() throws Exception {
init("org/apache/cxf/systest/ws/rm/rminterceptors.xml", false);
// WS-RM 1.0 using the WS-A 1.0 namespace
@@ -288,15 +288,45 @@ public class ProtocolVariationsTest exte
} catch (Exception e) {
assertTrue(e.getCause() instanceof SoapFault);
// verify a partial error text match to exclude an unexpected
exception
- // (see WSRM_REQUIRED_EXC in Messages.properties)
- //because the ws-rm namespace isn't correct, can't detect it's a
ws-rm message
- //so can't understand ws-rm header
+ // because there is a mustUnderstand header that is not understood,
+ // the corresponding error is returned.
final String text = "MustUnderstand headers: "
+ "[{http://cxf.apache.org/invalid}Sequence]
are not understood.";
assertTrue(e.getCause().getMessage() != null
&& e.getCause().getMessage().indexOf(text) >= 0);
}
}
+
+ @Test
+ public void testInvalidWSRMOnReceive() throws Exception {
+ init("org/apache/cxf/systest/ws/rm/rminterceptors.xml", false);
+
+ // WS-RM 1.0 using the WS-A 1.0 namespace
+ Client client = ClientProxy.getClient(greeter);
+ client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY,
RM10Constants.NAMESPACE_URI);
+ client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY,
Names200408.WSA_NAMESPACE_NAME);
+
+ // remove the outgoing message's WS-RM header
+ TransformOutInterceptor trans = new TransformOutInterceptor();
+ Map<String, String> outElements = new HashMap<String, String>();
+ outElements.put("{" + RM10Constants.NAMESPACE_URI + "}Sequence", "");
+ trans.setOutTransformElements(outElements);
+
+ client.getOutInterceptors().add(trans);
+ try {
+ greeter.greetMe("one");
+ fail("invalid wsrm header");
+ } catch (Exception e) {
+ assertTrue(e.getCause() instanceof SoapFault);
+ // verify a partial error text match to exclude an unexpected
exception
+ // (see WSRM_REQUIRED_EXC in Messages.properties)
+ final String text = "WS-ReliableMessaging is required";
+ assertTrue(e.getCause().getMessage() != null
+ && e.getCause().getMessage().indexOf(text) >= 0);
+ }
+ }
+
+
@Test
public void testDefaultDecoupled() throws Exception {