You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2012/12/12 17:41:36 UTC

svn commit: r1420818 - in /cxf/branches/2.5.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/

Author: ay
Date: Wed Dec 12 16:41:33 2012
New Revision: 1420818

URL: http://svn.apache.org/viewvc?rev=1420818&view=rev
Log:
Merged revisions 1420719 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1420719 | ay | 2012-12-12 15:55:44 +0100 (Wed, 12 Dec 2012) | 9 lines
  
  Merged revisions 1420627 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1420627 | ay | 2012-12-12 12:48:38 +0100 (Wed, 12 Dec 2012) | 1 line
    
    [CXF-4694] WS-RM is not returing a correct soap fault message to the client
  ........
  
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java?rev=1420818&r1=1420817&r2=1420818&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Wed Dec 12 16:41:33 2012
@@ -24,6 +24,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.ws.addressing.AddressingProperties;
@@ -58,6 +59,16 @@ public class RMInInterceptor extends Abs
             } catch (RMException e) {
                 LOG.log(Level.WARNING, "Failed to revert the delivering status");
             }
+        } else if (!ContextUtils.isRequestor(message)) {
+            // force the fault to be returned.
+            Exchange exchange = message.getExchange();
+            exchange.setOneWay(false);
+
+            final AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, false, true);
+            if (maps != null && !ContextUtils.isGenericAddress(maps.getFaultTo())) {
+                //TODO look at how we can refactor all these decoupled faultTo stuff
+                exchange.setDestination(ContextUtils.createDecoupledDestination(exchange, maps.getFaultTo()));
+            }
         }
     }
 

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java?rev=1420818&r1=1420817&r2=1420818&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java Wed Dec 12 16:41:33 2012
@@ -71,12 +71,12 @@ public class SoapFaultFactory implements
     Fault createSoap11Fault(SequenceFault sf) {
         SoapFault fault = new SoapFault(sf.getReason(),
             sf.isSender() ? version.getSender() : version.getReceiver());
-        fault.setSubCode(sf.getFaultCode());
         return fault;
     }
     
     Fault createSoap12Fault(SequenceFault sf, Message msg) {
         SoapFault fault = (SoapFault)createSoap11Fault(sf);
+        fault.setSubCode(sf.getFaultCode());
         Object detail = sf.getDetail();
         if (null == detail) {
             return fault;

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java?rev=1420818&r1=1420817&r2=1420818&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java Wed Dec 12 16:41:33 2012
@@ -82,7 +82,7 @@ public class AbstractRMInterceptorTest e
         SequenceFault sf = control.createMock(SequenceFault.class);
         interceptor.setSequenceFault(sf);
         Exchange ex = control.createMock(Exchange.class);
-        EasyMock.expect(message.getExchange()).andReturn(ex);
+        EasyMock.expect(message.getExchange()).andReturn(ex).anyTimes();
         Endpoint e = control.createMock(Endpoint.class);
         EasyMock.expect(ex.get(Endpoint.class)).andReturn(e);
         EasyMock.expect(e.getBinding()).andReturn(null);
@@ -102,7 +102,7 @@ public class AbstractRMInterceptorTest e
         SequenceFault sf = control.createMock(SequenceFault.class);
         interceptor.setSequenceFault(sf);
         Exchange ex = control.createMock(Exchange.class);
-        EasyMock.expect(message.getExchange()).andReturn(ex);
+        EasyMock.expect(message.getExchange()).andReturn(ex).anyTimes();
         Endpoint e = control.createMock(Endpoint.class);
         EasyMock.expect(ex.get(Endpoint.class)).andReturn(e);
         Binding b = control.createMock(Binding.class);

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java?rev=1420818&r1=1420817&r2=1420818&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java Wed Dec 12 16:41:33 2012
@@ -329,7 +329,6 @@ public class RMInInterceptorTest extends
             interceptor.handle(message);
             fail("must reject the invalid rm message");
         } catch (Exception e) {
-            System.out.println(e);
             assertTrue(e instanceof RMException);
             // verify a partial error text match to exclude an unexpected exception
             // (see WSRM_REQUIRED_EXC in Messages.properties)
@@ -346,6 +345,8 @@ public class RMInInterceptorTest extends
         Message message = control.createMock(Message.class);
         Exchange exchange = control.createMock(Exchange.class);
         EasyMock.expect(message.getExchange()).andReturn(exchange).anyTimes();
+        exchange.setOneWay(false);
+        EasyMock.expectLastCall();
         control.replay();
         
         try {

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java?rev=1420818&r1=1420817&r2=1420818&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java Wed Dec 12 16:41:33 2012
@@ -62,7 +62,7 @@ public class SoapFaultFactoryTest extend
         sf = control.createMock(SequenceFault.class);
         EasyMock.expect(sf.getReason()).andReturn("reason");
         EasyMock.expect(sf.isSender()).andReturn(isSender);
-        EasyMock.expect(sf.getFaultCode()).andReturn(code);
+        EasyMock.expect(sf.getFaultCode()).andReturn(code).anyTimes();
         if (null != detail) {
             EasyMock.expect(sf.getDetail()).andReturn(detail);
             SequenceFaultType sft = new SequenceFaultType();
@@ -81,7 +81,7 @@ public class SoapFaultFactoryTest extend
         SoapFault fault = (SoapFault)factory.createFault(sf, createInboundMessage());
         assertEquals("reason", fault.getReason());
         assertEquals(Soap11.getInstance().getReceiver(), fault.getFaultCode());
-        assertEquals(RM10Constants.SEQUENCE_TERMINATED_FAULT_QNAME, fault.getSubCode());
+        assertNull(fault.getSubCode());
         assertNull(fault.getDetail());
         assertSame(sf, fault.getCause());
         control.verify();