cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1165249 - in /cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ systests...
Date Mon, 05 Sep 2011 11:57:28 GMT
Author: ay
Date: Mon Sep  5 11:57:27 2011
New Revision: 1165249

URL: http://svn.apache.org/viewvc?rev=1165249&view=rev
Log:
[CXF-3768] HTTP response code 202 is not set for WS-Addressing ...

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java Mon Sep  5 11:57:27 2011
@@ -67,6 +67,7 @@ public interface Message extends StringM
      */
     String DECOUPLED_CHANNEL_MESSAGE = "decoupled.channel.message";
     String PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response";
+    String EMPTY_PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response.empty";
     String ONE_WAY_REQUEST = "OnewayRequest";
 
     

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java Mon Sep  5 11:57:27
2011
@@ -101,6 +101,17 @@ public final class MessageUtils {
     }
     
     /**
+     * Determines if the current message is an empty partial response, which
+     * is a partial response with an empty content.
+     * 
+     * @param message the current message
+     * @return true if the current messags is a partial empty response
+     */
+    public static boolean isEmptyPartialResponse(Message message) {
+        return Boolean.TRUE.equals(message.get(Message.EMPTY_PARTIAL_RESPONSE_MESSAGE));
+    }
+
+    /**
      * Returns true if a value is either the String "true" (regardless of case)  or Boolean.TRUE.
      * @param value
      * @return true if value is either the String "true" or Boolean.TRUE

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Mon Sep  5 11:57:27 2011
@@ -472,7 +472,7 @@ public abstract class AbstractHTTPDestin
 
         outMessage.put(RESPONSE_HEADERS_COPIED, "true");
         
-        if (oneWay && !MessageUtils.isPartialResponse(outMessage)) {
+        if (hasNoResponseContent(outMessage)) {
             response.setContentLength(0);
             response.flushBuffer();
             response.getOutputStream().close();
@@ -492,13 +492,34 @@ public abstract class AbstractHTTPDestin
         Integer i = (Integer)message.get(Message.RESPONSE_CODE);
         if (i != null) {
             return i.intValue();  
-        } else if (isOneWay(message) && !MessageUtils.isPartialResponse(message))
{
+        } else if (hasNoResponseContent(message)) {
             return HttpURLConnection.HTTP_ACCEPTED;
         } else {
             return HttpURLConnection.HTTP_OK;
         }
     }
 
+    /**
+     * Determines if the current message has no response content.
+     * The message has no response content if either:
+     *  - the request is oneway and the current message is no partial 
+     *    response or an empty partial response.
+     *  - the request is not oneway but the current message is an empty partial 
+     *    response. 
+     * @param message
+     * @return
+     */
+    private boolean hasNoResponseContent(Message message) {
+        final boolean ow = isOneWay(message);
+        final boolean pr = MessageUtils.isPartialResponse(message);
+        final boolean epr = MessageUtils.isEmptyPartialResponse(message);
+
+        //REVISIT may need to provide an option to choose other behavior?
+        // old behavior not suppressing any responses  => ow && !pr
+        // suppress empty responses for oneway calls   => ow && (!pr || epr)
+        // suppress additionally empty responses for decoupled twoway calls =>
+        return (ow && (!pr || epr)) || (!ow && epr);
+    }
     
     private HttpServletResponse getHttpResponseFromMessage(Message message) throws IOException
{
         Object responseObj = message.get(HTTP_RESPONSE);
@@ -592,14 +613,14 @@ public abstract class AbstractHTTPDestin
             OutputStream responseStream = flushHeaders(outMessage);
             if (null != responseStream) {
                 wrappedStream = responseStream;
-            }            
+            }
         }
 
         /**
          * Perform any actions required on stream closure (handle response etc.)
          */
         public void close() throws IOException {
-            if (wrappedStream == null) {
+            if (!written && wrappedStream == null) {
                 OutputStream responseStream = flushHeaders(outMessage, false);
                 if (null != responseStream) {
                     wrappedStream = responseStream;

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Mon
Sep  5 11:57:27 2011
@@ -381,6 +381,7 @@ public final class ContextUtils {
             // message (used to determine relatesTo etc.)
             propogateReceivedMAPs(inMAPs, partialResponse);
             partialResponse.put(Message.PARTIAL_RESPONSE_MESSAGE, Boolean.TRUE);
+            partialResponse.put(Message.EMPTY_PARTIAL_RESPONSE_MESSAGE, Boolean.TRUE);
             Destination target = inMessage.getDestination();
             if (target == null) {
                 return;

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java Mon Sep  5
11:57:27 2011
@@ -160,6 +160,7 @@ public class RMOutInterceptor extends Ab
                 AttributedURIType actionURI = new AttributedURIType();
                 actionURI.setValue(constants.getSequenceAckAction());
                 maps.setAction(actionURI);
+                msg.remove(Message.EMPTY_PARTIAL_RESPONSE_MESSAGE);
             }
         } 
         

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
Mon Sep  5 11:57:27 2011
@@ -160,7 +160,7 @@ public class RMPolicyTest extends Abstra
         } 
 
         MessageRecorder mr = new MessageRecorder(outRecorder, inRecorder);
-        mr.awaitMessages(5, 9, 5000);
+        mr.awaitMessages(5, 4, 5000);
 
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(),
             Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -177,9 +177,10 @@ public class RMPolicyTest extends Abstra
         mf.verifyLastMessage(new boolean[] {false, false, false, false, false}, true);
         mf.verifyAcknowledgements(new boolean[] {false, false, false, true, true}, true);
 
-        mf.verifyMessages(9, false);
-        mf.verifyPartialResponses(5);        
-        mf.purgePartialResponses();
+        mf.verifyMessages(4, false);
+//        mf.verifyMessages(9, false);
+//        mf.verifyPartialResponses(5);        
+//        mf.purgePartialResponses();
 
         expectedActions = new String[] {
             RM10Constants.INSTANCE.getCreateSequenceResponseAction(),

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
Mon Sep  5 11:57:27 2011
@@ -162,7 +162,8 @@ public class RMPolicyWsdlTest extends Ab
         } 
 
         MessageRecorder mr = new MessageRecorder(outRecorder, inRecorder);
-        mr.awaitMessages(5, 9, 5000);
+        mr.awaitMessages(5, 4, 5000);
+//        mr.awaitMessages(5, 9, 5000);
 
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
                                          inRecorder.getInboundMessages(),
@@ -181,9 +182,10 @@ public class RMPolicyWsdlTest extends Ab
         mf.verifyLastMessage(new boolean[] {false, false, false, false, false}, true);
         mf.verifyAcknowledgements(new boolean[] {false, false, false, true, true}, true);
 
-        mf.verifyMessages(9, false);
-        mf.verifyPartialResponses(5);        
-        mf.purgePartialResponses();
+        mf.verifyMessages(4, false);
+//        mf.verifyMessages(9, false);
+//        mf.verifyPartialResponses(5);      
+//        mf.purgePartialResponses();
 
         expectedActions = new String[] {
             RM10Constants.INSTANCE.getCreateSequenceResponseAction(),

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
Mon Sep  5 11:57:27 2011
@@ -247,7 +247,7 @@ public class ClientPersistenceTest exten
         greeter.greetMeOneWay("five");
 
         // force at least two outbound messages, since can't always count on three
-        awaitMessages(1, 3);
+        awaitMessages(1, 2);
         
         MessageFlow mf = new MessageFlow(out.getOutboundMessages(), in.getInboundMessages(),
             Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -260,7 +260,7 @@ public class ClientPersistenceTest exten
         mf.verifyMessageNumbers(new String[] {"5"}, true);
         mf.verifyAcknowledgements(new boolean[1], true);
 
-        mf.verifyMessages(3, false);
+        mf.verifyMessages(2, false);
 
         // we can't reliably predict how the three remaining messages are acknowledged
 //        expectedActions = new String[] {RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION,

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
Mon Sep  5 11:57:27 2011
@@ -199,9 +199,9 @@ public class ManagedEndpointsTest extend
                        new Object[]{sseqId}, new String[]{"java.lang.String"});
         verifyArray("Expected range", o, new Long[]{1L, 1L, 3L, 3L});
 
-        // 7 sec retry interval + 3 sec
-        LOG.info("waiting for 10 secs for the retry to complete ...");
-        Thread.sleep(10000);
+        // 7 sec retry interval + 5 sec
+        LOG.info("waiting for 12 secs for the retry to complete ...");
+        Thread.sleep(12000);
 
         o = mbs.invoke(clientEndpointName, "getQueuedMessageTotalCount", null, null);
         assertTrue("No queued message", o instanceof Integer && 0 == ((Integer)o).intValue());

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
Mon Sep  5 11:57:27 2011
@@ -64,9 +64,11 @@ public class MessageLossSimulator extend
         if (MessageUtils.isPartialResponse(message)) {
             return;
         }
-        appMessageCount++;
-        if (0 != (appMessageCount % 2)) {
-            return;
+        synchronized (this) {
+            appMessageCount++;
+            if (0 != (appMessageCount % 2)) {
+                return;
+            }
         }
         
         InterceptorChain chain = message.getInterceptorChain();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Mon Sep  5 11:57:27 2011
@@ -235,7 +235,7 @@ public class SequenceTest extends Abstra
 
         greeter.greetMeOneWay("thrice");
 
-        awaitMessages(4, 4);
+        awaitMessages(4, 2);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
                 
@@ -249,13 +249,13 @@ public class SequenceTest extends Abstra
         // createSequenceResponse message plus 3 partial responses, only the
         // last one should include a sequence acknowledgment
 
-        mf.verifyMessages(4, false);
+        mf.verifyMessages(2, false);
         expectedActions = 
-            new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, null, null, 
+            new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                           RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION};
         mf.verifyActions(expectedActions, false);
-        mf.verifyMessageNumbers(new String[] {null, null, null, null}, false);
-        mf.verifyAcknowledgements(new boolean[] {false, false, false, true}, false);
+        mf.verifyMessageNumbers(new String[] {null, null}, false);
+        mf.verifyAcknowledgements(new boolean[] {false, true}, false);
     }
     
     @Test
@@ -267,7 +267,7 @@ public class SequenceTest extends Abstra
 
         // CreateSequence plus two greetMeOneWay requests
 
-        awaitMessages(3, 4);
+        awaitMessages(3, 1);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -281,13 +281,10 @@ public class SequenceTest extends Abstra
         // CreateSequenceResponse plus three partial responses, no
         // acknowledgments included
 
-        mf.verifyMessages(4, false);
-        mf.verifyMessageNumbers(new String[4], false);
-        mf.verifyAcknowledgements(new boolean[4], false);
+        mf.verifyMessages(1, false);
+        mf.verifyMessageNumbers(new String[1], false);
+        mf.verifyAcknowledgements(new boolean[1], false);
         
-        mf.verifyPartialResponses(3);        
-        mf.purgePartialResponses();
-  
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION};
         mf.verifyActionsIgnoringPartialResponses(expectedActions);
         mf.purge();
@@ -320,7 +317,7 @@ public class SequenceTest extends Abstra
         // two application messages plus two createSequence plus two
         // terminateSequence
 
-        awaitMessages(6, 6);
+        awaitMessages(6, 4);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -340,16 +337,16 @@ public class SequenceTest extends Abstra
         // createSequenceResponse message plus partial responses to
         // greetMeOneWay and terminateSequence ||: 2
 
-        mf.verifyMessages(6, false);
+        mf.verifyMessages(4, false);
 
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
-                                        RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, null,
+                                        RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, 
                                         RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
-                                        RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION, null};
+                                        RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION};
         mf.verifyActions(expectedActions, false);
-        mf.verifyMessageNumbers(new String[] {null, null, null, null, null, null}, false);
-        mf.verifyLastMessage(new boolean[] {false, false, false, false, false, false}, false);
-        mf.verifyAcknowledgements(new boolean[] {false, true, false, false, true, false},
false);
+        mf.verifyMessageNumbers(new String[] {null, null, null, null}, false);
+        mf.verifyLastMessage(new boolean[] {false, false, false, false}, false);
+        mf.verifyAcknowledgements(new boolean[] {false, true, false, true}, false);
     }
    
     @Test
@@ -372,7 +369,7 @@ public class SequenceTest extends Abstra
 
         // three application messages plus createSequence
         
-        awaitMessages(4, 4, 2000);
+        awaitMessages(4, 1, 2000);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -389,9 +386,7 @@ public class SequenceTest extends Abstra
         // createSequenceResponse plus 3 partial responses, none of which
         // contain an acknowledgment
 
-        mf.verifyMessages(4, false);
-        mf.verifyPartialResponses(3, new boolean[3]);
-        mf.purgePartialResponses();
+        mf.verifyMessages(1, false);
         
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION};
         mf.verifyActions(expectedActions, false);
@@ -465,7 +460,7 @@ public class SequenceTest extends Abstra
         // CreateSequence and three greetMe messages
         // TODO there should be partial responses to the decoupled responses!
 
-        awaitMessages(4, 8);
+        awaitMessages(4, 4);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -485,10 +480,7 @@ public class SequenceTest extends Abstra
         // one partial response for each of the four messages
         // the first partial response should no include an acknowledgement, the other three
should
 
-        mf.verifyMessages(8, false);
-        mf.verifyPartialResponses(4, new boolean[4]);
-
-        mf.purgePartialResponses();
+        mf.verifyMessages(4, false);
 
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                                         GREETME_RESPONSE_ACTION, 
@@ -514,7 +506,7 @@ public class SequenceTest extends Abstra
         // CreateSequence and three greetMe messages
         // TODO there should be partial responses to the decoupled responses!
 
-        awaitMessages(4, 8);
+        awaitMessages(4, 4);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -534,10 +526,7 @@ public class SequenceTest extends Abstra
         // one partial response for each of the four messages
         // the first partial response should no include an acknowledgement, the other three
should
 
-        mf.verifyMessages(8, false);
-        mf.verifyPartialResponses(4, new boolean[4]);
-
-        mf.purgePartialResponses();
+        mf.verifyMessages(4, false);
 
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                                         GREETME_RESPONSE_ACTION, 
@@ -559,7 +548,7 @@ public class SequenceTest extends Abstra
         // CreateSequence and three greetMe messages, no acknowledgments
         // included
 
-        awaitMessages(3, 6);
+        awaitMessages(3, 3);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -576,12 +565,10 @@ public class SequenceTest extends Abstra
         // one partial response for each of the three messages no acknowledgments
         // included
 
-        mf.verifyMessages(6, false);
-        mf.verifyLastMessage(new boolean[6], false);
-        mf.verifyAcknowledgements(new boolean[6], false);
+        mf.verifyMessages(3, false);
+        mf.verifyLastMessage(new boolean[3], false);
+        mf.verifyAcknowledgements(new boolean[3], false);
         
-        mf.verifyPartialResponses(3);
-        mf.purgePartialResponses();
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                                         GREETME_RESPONSE_ACTION, 
                                         GREETME_RESPONSE_ACTION};
@@ -621,7 +608,7 @@ public class SequenceTest extends Abstra
         greeter.greetMe("two");
         greeter.greetMe("three");
 
-        awaitMessages(7, 13, 5000);
+        awaitMessages(7, 6, 5000);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -642,11 +629,7 @@ public class SequenceTest extends Abstra
         // plus 3 full responses to greetMe requests plus server originiated
         // TerminateSequence request
 
-        mf.verifyMessages(13, false);
-
-        mf.verifyPartialResponses(7);
-
-        mf.purgePartialResponses();
+        mf.verifyMessages(6, false);
 
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION,
                                         GREETME_RESPONSE_ACTION,
@@ -922,7 +905,7 @@ public class SequenceTest extends Abstra
         greeter.greetMe("three");
         greeter.greetMe("four");
         
-        awaitMessages(7, 10, 10000);
+        awaitMessages(7, 5, 10000);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -952,9 +935,6 @@ public class SequenceTest extends Abstra
         // + 5 partial responses (to CSR & each of the initial greetMe messages)
         // + at least 2 further partial response (for each of the resends)
         
-        mf.verifyPartialResponses(5);
-        mf.purgePartialResponses();
-        
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION,
                                         GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION,
                                         GREETME_RESPONSE_ACTION, GREETME_RESPONSE_ACTION};
@@ -974,7 +954,7 @@ public class SequenceTest extends Abstra
         // Outbound expected:
         // CreateSequence + greetMe + CreateSequenceResponse = 3 messages
   
-        awaitMessages(3, 6);
+        awaitMessages(3, 3);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -987,9 +967,6 @@ public class SequenceTest extends Abstra
         mf.verifyLastMessage(new boolean[] {false, false, false}, true);
         mf.verifyAcknowledgements(new boolean[] {false, false, false}, true);
 
-        mf.verifyPartialResponses(3, new boolean[3]);
-        mf.purgePartialResponses();
-
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION,
                                         RM10Constants.CREATE_SEQUENCE_ACTION, 
                                         GREETME_RESPONSE_ACTION};
@@ -1010,7 +987,7 @@ public class SequenceTest extends Abstra
         // CreateSequence and five greetMe messages
         // full and partial responses to each
 
-        awaitMessages(max + 1, (max * 2) + 1, 7500);
+        awaitMessages(max + 1, 1, 7500);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -1144,7 +1121,7 @@ public class SequenceTest extends Abstra
 
                 // three application messages plus createSequence
 
-                awaitMessages(4, 8);
+                awaitMessages(5, 4);
             }
         }
         
@@ -1166,24 +1143,21 @@ public class SequenceTest extends Abstra
                     clients[i].inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME,
                     RM10Constants.NAMESPACE_URI);
                                 
-                mf.verifyMessages(4, true);
+                mf.verifyMessages(5, true);
                 String[] expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_ACTION,

                                                          GREETME_ACTION,
                                                          GREETME_ACTION, 
-                                                         GREETME_ACTION};
+                                                         GREETME_ACTION,
+                                                         RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION};
                 mf.verifyActions(expectedActions, true);
-                mf.verifyMessageNumbers(new String[] {null, "1", "2", "3"}, true);
-                mf.verifyLastMessage(new boolean[] {false, false, false, false}, true);
-                mf.verifyAcknowledgements(new boolean[] {false, false, true, true}, true);
+                mf.verifyMessageNumbers(new String[] {null, "1", "2", "3", null}, true);
+                mf.verifyLastMessage(new boolean[] {false, false, false, false, false}, true);
+                mf.verifyAcknowledgements(new boolean[] {false, false, true, true, true},
true);
 
                 // createSequenceResponse plus 3 greetMeResponse messages plus
-                // one partial response for each of the four messages
-                // the first partial response should no include an acknowledgement, the other
three should
-
-                mf.verifyMessages(8, false);
-                mf.verifyPartialResponses(4, new boolean[4]);
+                // one sequence ack response.
 
-                mf.purgePartialResponses();
+                mf.verifyMessages(4, false);
 
                 expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION,

                                                 GREETME_RESPONSE_ACTION, 
@@ -1226,7 +1200,7 @@ public class SequenceTest extends Abstra
 
         // outbound: CreateSequence and two greetMe messages 
 
-        awaitMessages(3, 6);
+        awaitMessages(3, 3);
         
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -1245,10 +1219,7 @@ public class SequenceTest extends Abstra
         // one partial response for each of the four messages
         // the first partial response should no include an acknowledgement, the other three
should
 
-        mf.verifyMessages(6, false);
-        mf.verifyPartialResponses(3, new boolean[3]);
-
-        mf.purgePartialResponses();
+        mf.verifyMessages(3, false);
 
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                                         GREETME_RESPONSE_ACTION, 
@@ -1275,8 +1246,8 @@ public class SequenceTest extends Abstra
         // let the first sequence expire
         Thread.sleep(8000);
         
-        // expecting 3 outbounds and 5 or 6 inbounds
-        awaitMessages(3, 5, 5000);
+        // expecting 3 outbounds and 2 inbounds
+        awaitMessages(3, 2, 5000);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(),
             Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -1299,8 +1270,8 @@ public class SequenceTest extends Abstra
 
         greeter.greetMeOneWay("three");
 
-        // expecting 2 outbounds and 4 inbounds
-        awaitMessages(2, 4, 5000);
+        // expecting 2 outbounds and 2 inbounds
+        awaitMessages(2, 2, 5000);
         
         mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(),
             Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
@@ -1315,8 +1286,7 @@ public class SequenceTest extends Abstra
         mf.verifyMessageNumbers(new String[] {null, "1"}, true);
 
         // PR, CSR, PR, ACK
-        mf.verifyMessages(4, false);
-        mf.purgePartialResponses();
+        mf.verifyMessages(2, false);
         
         expectedActions = new String[] {RM10Constants.INSTANCE.getCreateSequenceResponseAction(),
                                         RM10Constants.INSTANCE.getSequenceAckAction()};
@@ -1336,7 +1306,7 @@ public class SequenceTest extends Abstra
         greeter.greetMeOneWay("eosinophil");
         stopGreeterButNotCloseConduit();
 
-        awaitMessages(6, 8);
+        awaitMessages(6, 2);
         MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(),
             inRecorder.getInboundMessages(), Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
         
@@ -1353,12 +1323,8 @@ public class SequenceTest extends Abstra
         // inbound: CreateSequenceResponse, out-of-band SequenceAcknowledgement
         // plus 6 partial responses
         
-        mf.verifyMessages(8, false);
-        mf.verifyMessageNumbers(new String[8], false);
-        
-        mf.verifyPartialResponses(6);
-        mf.purgePartialResponses();
-        
+        mf.verifyMessages(2, false);
+        mf.verifyMessageNumbers(new String[2], false);
         
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION, 
                                         RM10Constants.SEQUENCE_ACKNOWLEDGMENT_ACTION};

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=1165249&r1=1165248&r2=1165249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
Mon Sep  5 11:57:27 2011
@@ -170,7 +170,8 @@ public class ServerPersistenceTest exten
     }
     
     void verifyMissingResponse(Response<GreetMeResponse> responses[]) throws Exception
{
-        awaitMessages(5, 8, 10000);
+        awaitMessages(5, 3, 20000);
+//        awaitMessages(5, 8, 10000);
 
         int nDone = 0;
         for (int i = 0; i < 3; i++) {
@@ -192,8 +193,8 @@ public class ServerPersistenceTest exten
         // mf.verifyMessageNumbers(new String[] {null, "1", "2", "3"}, true);
         // mf.verifyAcknowledgements(new boolean[] {false, false, true, false}, true);
         
-        mf.verifyPartialResponses(5);
-        mf.purgePartialResponses();
+//        mf.verifyPartialResponses(5);
+//        mf.purgePartialResponses();
         expectedActions = new String[] {RM10Constants.CREATE_SEQUENCE_RESPONSE_ACTION,
                                         GREETME_RESPONSE_ACTION,
                                         GREETME_RESPONSE_ACTION};
@@ -242,7 +243,7 @@ public class ServerPersistenceTest exten
   
     
     void verifyRetransmissionQueue() throws Exception {
-        awaitMessages(2, 5, 60000);
+        awaitMessages(2, 3, 60000);
         
         Thread.sleep(5000);
         boolean empty = greeterBus.getExtension(RMManager.class).getRetransmissionQueue().isEmpty();



Mime
View raw message