cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [2/3] cxf git commit: [CXF-6519] add a systest case using RM11 CloseSequence
Date Fri, 07 Aug 2015 13:49:30 GMT
[CXF-6519] add a systest case using RM11 CloseSequence


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c7e8637f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c7e8637f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c7e8637f

Branch: refs/heads/2.7.x-fixes
Commit: c7e8637f2a9bf8d187f51b7dda4af26b157f3f3f
Parents: 5c9d8f9
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Thu Aug 6 22:31:35 2015 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Fri Aug 7 12:04:15 2015 +0200

----------------------------------------------------------------------
 .../org/apache/cxf/ws/rm/SourceSequence.java    |  3 ++
 .../systest/ws/rm/ProtocolVariationsTest.java   | 53 +++++++++++---------
 2 files changed, 32 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c7e8637f/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
index b6431e3..668f3e6 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
@@ -153,6 +153,9 @@ public class SourceSequence extends AbstractSequence {
                 RMEndpoint rme = source.getReliableEndpoint();
                 Proxy proxy = rme.getProxy();
                 // REVIST for rm 1.1, provide an option to how the close and terminate messages
are sent
+                if (ProtocolVariation.RM11WSA200508 == getProtocol()) {
+                    proxy.lastMessage(this);
+                }
                 proxy.terminate(this);
                 source.removeSequence(this);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c7e8637f/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
index 034ff1a..b18c6ed 100644
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
@@ -414,40 +414,45 @@ public class ProtocolVariationsTest extends AbstractBusClientServerTestBase
{
     
 
     private void verifyTerminateSequence(String wsaUri, RMConstants consts) throws Exception
{
-        if (RM11Constants.NAMESPACE_URI.equals(consts.getWSRMNamespace())) {
-            awaitMessages(3, 3);
-        } else {
-            awaitMessages(3, 2);
-        }
-        
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
-            inRecorder.getInboundMessages(), wsaUri, consts.getWSRMNamespace());
-        
-        mf.verifyMessages(3, true);
-        String[] expectedActions = new String[] {consts.getCreateSequenceAction(), 
-                                                 GREETME_ONEWAY_ACTION,
-                                                 consts.getTerminateSequenceAction()};
-        mf.verifyActions(expectedActions, true);
-        mf.verifyMessageNumbers(new String[] {null, "1", null}, true);
+                                         inRecorder.getInboundMessages(), wsaUri, consts.getWSRMNamespace());
         if (RM11Constants.NAMESPACE_URI.equals(consts.getWSRMNamespace())) {
+            awaitMessages(4, 4);
+            
+            mf.verifyMessages(4, true);
+            String[] expectedActions = new String[] {consts.getCreateSequenceAction(), 
+                                                     GREETME_ONEWAY_ACTION,
+                                                     consts.getCloseSequenceAction(),
+                                                     consts.getTerminateSequenceAction()};
+            mf.verifyActions(expectedActions, true);
+            mf.verifyMessageNumbers(new String[] {null, "1", null, null}, true);
+
             // no LastMessage
-            mf.verifyLastMessage(new boolean[] {false, false, false}, true);
-        } else {
-            // uses LastMessage
-            mf.verifyLastMessage(new boolean[] {false, true, false}, true);
-        }
+            mf.verifyLastMessage(new boolean[] {false, false, false, false}, true);
 
-        if (RM11Constants.NAMESPACE_URI.equals(consts.getWSRMNamespace())) {
-            // CSR, ACK, TSR
-            mf.verifyMessages(3, false);
+            // CrSR, ACK, ClSR, TSR
+            mf.verifyMessages(4, false);
             expectedActions = new String[] {consts.getCreateSequenceResponseAction(), 
                                             consts.getSequenceAckAction(),
+                                            RM11Constants.INSTANCE.getCloseSequenceResponseAction(),
                                             RM11Constants.INSTANCE.getTerminateSequenceResponseAction()};
             mf.verifyActions(expectedActions, false);
-            mf.verifyAcknowledgements(new boolean[] {false, true, false}, false);
+            mf.verifyAcknowledgements(new boolean[] {false, true, false, false}, false);
 
         } else {
-            // CSR, ACK, PR
+            awaitMessages(3, 2);
+            
+            mf.verifyMessages(3, true);
+            String[] expectedActions = new String[] {consts.getCreateSequenceAction(), 
+                                                     GREETME_ONEWAY_ACTION,
+                                                     consts.getTerminateSequenceAction()};
+            mf.verifyActions(expectedActions, true);
+            mf.verifyMessageNumbers(new String[] {null, "1", null}, true);
+
+            // uses LastMessage
+            mf.verifyLastMessage(new boolean[] {false, true, false}, true);
+
+            // CrSR, ACK, PR
             mf.verifyMessages(2, false);
             expectedActions = new String[] {consts.getCreateSequenceResponseAction(), 
                                             consts.getSequenceAckAction()};


Mime
View raw message