cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1399381 - in /cxf/branches/2.5.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
Date Wed, 17 Oct 2012 18:40:16 GMT
Author: ay
Date: Wed Oct 17 18:40:15 2012
New Revision: 1399381

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

........
  r1399374 | ay | 2012-10-17 20:30:43 +0200 (Wed, 17 Oct 2012) | 9 lines
  
  Merged revisions 1399345 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1399345 | ay | 2012-10-17 18:59:26 +0200 (Wed, 17 Oct 2012) | 1 line
    
    [CXF-4579] Exchange's out message not set for recovered outbound WS-RM messages
  ........
  
........

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/RMManager.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.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/RMManager.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?rev=1399381&r1=1399380&r2=1399381&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Wed
Oct 17 18:40:15 2012
@@ -559,6 +559,7 @@ public class RMManager {
                 Message message = new MessageImpl();
                 Exchange exchange = new ExchangeImpl();
                 message.setExchange(exchange);
+                exchange.setOutMessage(message);
                 if (null != conduit) {
                     exchange.setConduit(conduit);
                     message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
@@ -709,4 +710,4 @@ public class RMManager {
         endpointMaps.put(ProtocolVariation.RM11WSA200508, new HashMap<Endpoint, RMEndpoint>());
         this.endpointMaps = endpointMaps;
     }
-}
\ No newline at end of file
+}

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?rev=1399381&r1=1399380&r2=1399381&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
Wed Oct 17 18:40:15 2012
@@ -61,6 +61,7 @@ import org.apache.cxf.ws.rm.persistence.
 import org.apache.cxf.ws.rm.v200702.CreateSequenceResponseType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rmp.v200502.RMAssertion;
+import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
 import org.junit.Assert;
@@ -519,7 +520,7 @@ public class RMManagerTest extends Asser
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
         setUpEndpointForRecovery(endpoint, ei, si, bi, ii);          
         Conduit conduit = control.createMock(Conduit.class);        
-        setUpRecoverReliableEndpoint(endpoint, conduit, null, null, null);
+        setUpRecoverReliableEndpoint(endpoint, conduit, null, null, null, null);
         control.replay();
         manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
         control.verify();
@@ -528,7 +529,7 @@ public class RMManagerTest extends Asser
         setUpEndpointForRecovery(endpoint, ei, si, bi, ii);
         SourceSequence ss = control.createMock(SourceSequence.class);
         DestinationSequence ds = control.createMock(DestinationSequence.class);
-        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, null);
+        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, null, null);
         control.replay();
         manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
         control.verify();
@@ -536,10 +537,16 @@ public class RMManagerTest extends Asser
         control.reset();
         setUpEndpointForRecovery(endpoint, ei, si, bi, ii);  
         RMMessage m = control.createMock(RMMessage.class);
-        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m);        
+        Capture<Message> mc = new Capture<Message>();
+        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m, mc);        
         control.replay();
         manager.recoverReliableEndpoint(endpoint, conduit, ProtocolVariation.RM10WSA200408);
-        control.verify();        
+        control.verify();
+        
+        Message msg = mc.getValue();
+        assertNotNull(msg);
+        assertNotNull(msg.getExchange());
+        assertSame(msg, msg.getExchange().getOutMessage());
     }
     
     Endpoint setUpEndpointForRecovery(Endpoint endpoint, 
@@ -558,7 +565,7 @@ public class RMManagerTest extends Asser
     void setUpRecoverReliableEndpoint(Endpoint endpoint,
                                       Conduit conduit, 
                                       SourceSequence ss, 
-                                      DestinationSequence ds, RMMessage m)  {           
    
+                                      DestinationSequence ds, RMMessage m, Capture<Message>
mc)  {                
         RMStore store = control.createMock(RMStore.class);
         RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
         manager.setStore(store);
@@ -628,10 +635,14 @@ public class RMManagerTest extends Asser
         }
         EasyMock.expect(m.getCachedOutputStream()).andReturn(cos);
 
-        queue.addUnacknowledged(EasyMock.isA(Message.class));
+        if (mc != null) {
+            queue.addUnacknowledged(EasyMock.capture(mc));
+        } else {
+            queue.addUnacknowledged(EasyMock.isA(Message.class));
+        }
         EasyMock.expectLastCall();
         queue.start();
-        EasyMock.expectLastCall(); 
+        EasyMock.expectLastCall();
     }
     
     @Test



Mime
View raw message