cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r598884 - in /incubator/cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ systests/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/ systests/src/test/java/org/apache/cxf/systest/ws/policy/ systests/src/test/java/org/ap...
Date Wed, 28 Nov 2007 07:12:29 GMT
Author: mmao
Date: Tue Nov 27 23:12:27 2007
New Revision: 598884

URL: http://svn.apache.org/viewvc?rev=598884&view=rev
Log:
CXF-1191 
 As per the WS-A Wsdl binding spec, the default action url should be generated as well, 
	Fix the tests under the rm/policy


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/addr_fromwsdl/WSAFromWSDLTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.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?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- 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
Tue Nov 27 23:12:27 2007
@@ -369,19 +369,22 @@
      */
     private AddressingPropertiesImpl assembleGeneric(Message message) {
         AddressingPropertiesImpl maps = getMAPs(message, true, true);
-        // MessageID        
+        // MessageID
         if (maps.getMessageID() == null) {
             String messageID = ContextUtils.generateUUID();
             maps.setMessageID(ContextUtils.getAttributedURI(messageID));
         }
+
         // Action
         if (ContextUtils.hasEmptyAction(maps)) {
             maps.setAction(ContextUtils.getAction(message));
+
+            if (ContextUtils.hasEmptyAction(maps)
+                && ContextUtils.isOutbound(message)) {
+                maps.setAction(ContextUtils.getAttributedURI(getActionUri(message)));
+            }
         }
 
-//         if (ContextUtils.isOutbound(message)) {
-//             maps.setAction(ContextUtils.getAttributedURI(getActionUri(message)));
-//         }
         return maps;
     }
 
@@ -408,11 +411,20 @@
         return actionUri;
     }
 
+
+    private String getDelimiter(String uri) {
+        if (uri.startsWith("urn")) {
+            return ".";
+        }
+        return "/";
+    }
+
     private String addPath(String uri, String path) {
         StringBuffer buffer = new StringBuffer();
         buffer.append(uri);
-        if (!uri.endsWith("/") && !path.startsWith("/")) {
-            buffer.append("/");
+        String delimiter = getDelimiter(uri);
+        if (!uri.endsWith(delimiter) && !path.startsWith(delimiter)) {
+            buffer.append(delimiter);
         }
         buffer.append(path);
         return buffer.toString();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/WSAFromWSDLTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/WSAFromWSDLTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/WSAFromWSDLTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/WSAFromWSDLTest.java
Tue Nov 27 23:12:27 2007
@@ -71,7 +71,6 @@
     }
 
     @Test
-    @org.junit.Ignore
     public void testAddNumbers() throws Exception {
         ByteArrayOutputStream input = setupInLogging();
         ByteArrayOutputStream output = setupOutLogging();
@@ -88,7 +87,6 @@
     }
 
     @Test
-    @org.junit.Ignore
     public void testAddNumbers2() throws Exception {
         ByteArrayOutputStream input = setupInLogging();
         ByteArrayOutputStream output = setupOutLogging();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
Tue Nov 27 23:12:27 2007
@@ -39,7 +39,6 @@
 import org.apache.cxf.systest.ws.util.OutMessageRecorder;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.rm.RMConstants;
 
 import org.junit.BeforeClass;
@@ -53,12 +52,15 @@
 public class RMPolicyTest extends AbstractBusClientServerTestBase {
 
     private static final Logger LOG = LogUtils.getLogger(RMPolicyTest.class);
-    private static final String GREETMEONEWAY_ACTION = null;
-    private static final String GREETME_ACTION = null;
-    private static final String GREETME_RESPONSE_ACTION = null;
-    private static final String PINGME_ACTION = null;
-    private static final String PINGME_RESPONSE_ACTION = 
-        Names.WSA_DEFAULT_FAULT_ACTION;
+    private static final String GREETMEONEWAY_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
+    private static final String GREETME_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeRequest";
+    private static final String GREETME_RESPONSE_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeResponse";
+    private static final String PINGME_ACTION = "http://cxf.apache.org/greeter_control/Greeter/pingMeRequest";
+    private static final String PINGME_RESPONSE_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/pingMeResponse";
 
     public static class Server extends AbstractBusTestServerBase {
     
@@ -160,7 +162,7 @@
         expectedActions = new String[] {
             RMConstants.getCreateSequenceResponseAction(),
             GREETME_RESPONSE_ACTION,
-            GREETME_RESPONSE_ACTION,
+            PINGME_RESPONSE_ACTION,
             PINGME_RESPONSE_ACTION
         };
         mf.verifyActions(expectedActions, false);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
Tue Nov 27 23:12:27 2007
@@ -39,7 +39,6 @@
 import org.apache.cxf.systest.ws.util.OutMessageRecorder;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.rm.RMConstants;
 
@@ -54,12 +53,15 @@
 public class RMPolicyWsdlTest extends AbstractBusClientServerTestBase {
 
     private static final Logger LOG = LogUtils.getLogger(RMPolicyWsdlTest.class);
-    private static final String GREETMEONEWAY_ACTION = null;
-    private static final String GREETME_ACTION = null;
-    private static final String GREETME_RESPONSE_ACTION = null;
-    private static final String PINGME_ACTION = null;
-    private static final String PINGME_RESPONSE_ACTION = 
-        Names.WSA_DEFAULT_FAULT_ACTION;
+    private static final String GREETMEONEWAY_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
+    private static final String GREETME_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeRequest";
+    private static final String GREETME_RESPONSE_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeResponse";
+    private static final String PINGME_ACTION = "http://cxf.apache.org/greeter_control/Greeter/pingMeRequest";
+    private static final String PINGME_RESPONSE_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/pingMeResponse";
 
 
     public static class Server extends AbstractBusTestServerBase {
@@ -166,7 +168,7 @@
         expectedActions = new String[] {
             RMConstants.getCreateSequenceResponseAction(),
             GREETME_RESPONSE_ACTION,
-            GREETME_RESPONSE_ACTION,
+            PINGME_RESPONSE_ACTION,
             PINGME_RESPONSE_ACTION
         };
         mf.verifyActions(expectedActions, false);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
Tue Nov 27 23:12:27 2007
@@ -60,8 +60,10 @@
  */
 public class ClientPersistenceTest extends AbstractBusClientServerTestBase {
 
-    public static final String GREETMEONEWAY_ACTION = null;
-    public static final String GREETME_ACTION = null;
+    public static final String GREETMEONEWAY_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
+    public static final String GREETME_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeRequest";
     private static final Logger LOG = LogUtils.getLogger(ClientPersistenceTest.class);
     
     private Greeter greeter;

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Tue Nov 27 23:12:27 2007
@@ -74,16 +74,12 @@
 public class SequenceTest extends AbstractBusClientServerTestBase {
 
     private static final Logger LOG = LogUtils.getLogger(SequenceTest.class);
-    // private static final String APP_NAMESPACE ="http://celtix.objectweb.org/greeter_control";
-    // private static final String GREETMEONEWAY_ACTION = APP_NAMESPACE +
-    //     "/types/Greeter/greetMeOneWay";
-    // private static final String GREETME_ACTION = APP_NAMESPACE +
-    //     "/types/Greeter/greetMe";
-    // private static final String GREETME_RESPONSE_ACTION = GREETME_ACTION +
-    //     "Response";
-    private static final String GREETMEONEWAY_ACTION = null;
-    private static final String GREETME_ACTION = null;
-    private static final String GREETME_RESPONSE_ACTION = null;
+    private static final String GREETMEONEWAY_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
+    private static final String GREETME_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeRequest";
+    private static final String GREETME_RESPONSE_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeResponse";
 
     private static int decoupledEndpointPort = 10000;
     private static String decoupledEndpoint;
@@ -706,7 +702,8 @@
         
         mf.verifyMessages(3, false);
         expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
-                                        null, null};
+                                        GREETME_RESPONSE_ACTION, 
+                                        null};
         mf.verifyActions(expectedActions, false);
         mf.verifyMessageNumbers(new String[] {null, "1", null}, false);
         mf.verifyAcknowledgements(new boolean[3] , false);
@@ -804,7 +801,8 @@
         
         mf.verifyMessages(3, false);
         expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
-                                        null, null};
+                                        GREETME_RESPONSE_ACTION,
+                                        null};
         mf.verifyActions(expectedActions, false);
         mf.verifyMessageNumbers(new String[] {null, "1", null}, false);
         mf.verifyAcknowledgements(new boolean[] {false, true, false} , false);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=598884&r1=598883&r2=598884&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
Tue Nov 27 23:12:27 2007
@@ -55,8 +55,10 @@
  */
 public class ServerPersistenceTest extends AbstractBusClientServerTestBase {
 
-    public static final String GREETMEONEWAY_ACTION = null;
-    public static final String GREETME_ACTION = null;
+    public static final String GREETMEONEWAY_ACTION 
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
+    public static final String GREETME_ACTION
+        = "http://cxf.apache.org/greeter_control/Greeter/greetMeRequest";
     private static final Logger LOG = LogUtils.getLogger(ServerPersistenceTest.class);
     private static final String CFG = "/org/apache/cxf/systest/ws/rm/persistent.xml";
     private static final String SERVER_LOSS_CFG 



Mime
View raw message