cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r450900 - in /incubator/cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ systests/src/test/java/org/apache/cxf/systest/ws/addressing/
Date Thu, 28 Sep 2006 15:41:16 GMT
Author: eglynn
Date: Thu Sep 28 08:41:14 2006
New Revision: 450900

URL: http://svn.apache.org/viewvc?view=rev&rev=450900
Log:
fixed MAPTest to actually test piggy-backing on partial responses and multi-version WS-A

Modified:
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPVerifier.java

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?view=diff&rev=450900&r1=450899&r2=450900
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
Thu Sep 28 08:41:14 2006
@@ -184,7 +184,7 @@
                     ContextUtils.rebaseResponse(maps.getReplyTo(),
                                                 maps,
                                                 message);
-                }            
+                }          
             } else {
                 // validation failure => dispatch is aborted, response MAPs 
                 // must be aggregated
@@ -264,7 +264,7 @@
                                                   : null;
                 maps.setTo(reference != null 
                            ? reference.getAddress()
-                           : ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS));
+                           : ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS));    
           
             }
 
             // ReplyTo, set if null in MAPs or if set to a generic address
@@ -298,7 +298,7 @@
             AddressingPropertiesImpl inMAPs = getMAPs(message, false, false);
             maps.exposeAs(inMAPs.getNamespaceURI());
             // To taken from ReplyTo in incoming MAPs
-            if (inMAPs.getReplyTo() != null) {
+            if (maps.getTo() == null && inMAPs.getReplyTo() != null) {
                 maps.setTo(inMAPs.getReplyTo().getAddress());
             }
             // RelatesTo taken from MessageID in incoming MAPs

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java?view=diff&rev=450900&r1=450899&r2=450900
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
Thu Sep 28 08:41:14 2006
@@ -66,28 +66,29 @@
     }
 
     public void handleMessage(SoapMessage message) {
-        addPartialResponseHeader(message);
-        verify(message);
+        boolean outgoingPartialResponse = isOutgoingPartialResponse(message);
+        if (outgoingPartialResponse) {
+            addPartialResponseHeader(message);
+        }
+        verify(message, outgoingPartialResponse);
     }
 
     public void handleFault(SoapMessage message) {
-        verify(message);
+        verify(message, isOutgoingPartialResponse(message));
     }
 
     private void addPartialResponseHeader(SoapMessage message) {
         try {
             // add piggybacked wsa:From header to partial response
-            if (isOutgoingPartialResponse(message)) {
-                Element header = message.getHeaders(Element.class);
-                marshallFrom("urn:piggyback_responder", header, getMarshaller());
-            }
+            Element header = message.getHeaders(Element.class);
+            marshallFrom("urn:piggyback_responder", header, getMarshaller());
         } catch (Exception e) {
             verificationCache.put("SOAP header addition failed: " + e);
             e.printStackTrace();
         }
     }
 
-    private void verify(SoapMessage message) {
+    private void verify(SoapMessage message, boolean outgoingPartialResponse) {
         try {
             List<String> wsaHeaders = new ArrayList<String>();
             Element headers = message.getHeaders(Element.class);
@@ -100,7 +101,7 @@
                                  VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
             }
             boolean partialResponse = isIncomingPartialResponse(message)
-                                      || isOutgoingPartialResponse(message);
+                                      || outgoingPartialResponse;
             verificationCache.put(MAPTest.verifyHeaders(wsaHeaders, 
                                                         partialResponse));
         } catch (SOAPException se) {
@@ -126,7 +127,7 @@
         AddressingProperties maps = 
             (AddressingProperties)message.get(SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
         return ContextUtils.isOutbound(message)
-               && ContextUtils.isRequestor(message)
+               && !ContextUtils.isRequestor(message)
                && maps != null
                && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue());
     }
@@ -137,6 +138,7 @@
             (AddressingProperties)message.get(CLIENT_ADDRESSING_PROPERTIES_INBOUND);
         return !ContextUtils.isOutbound(message)
                && ContextUtils.isRequestor(message)
+               && maps != null
                && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue());
     }
     

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPVerifier.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPVerifier.java?view=diff&rev=450900&r1=450899&r2=450900
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPVerifier.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPVerifier.java
Thu Sep 28 08:41:14 2006
@@ -53,7 +53,7 @@
     }
     
     public void handleMessage(Message message) {
-        //verify(message);
+        verify(message);
     }
 
     public void handleFault(Message message) {



Mime
View raw message