You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2008/03/15 02:29:57 UTC

svn commit: r637327 - in /webservices/axis2/trunk/java/modules/metadata: src/org/apache/axis2/jaxws/description/impl/ test/org/apache/axis2/jaxws/description/addressing/

Author: pradine
Date: Fri Mar 14 18:29:56 2008
New Revision: 637327

URL: http://svn.apache.org/viewvc?rev=637327&view=rev
Log:
Unittest and updates relating to AXIS2-3573.

Added:
    webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/
    webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java   (with props)
Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=637327&r1=637326&r2=637327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Fri Mar 14 18:29:56 2008
@@ -374,9 +374,9 @@
                 faultMessage.setName(faultName);
                 
                 String faultAction = 
-                        WSDL11ActionHelper.getFaultActionFromStringInformation( messageExchangePattern, 
+                        WSDL11ActionHelper.getFaultActionFromStringInformation( targetNS, 
                                         portTypeName, 
-                                        newAxisOperation.getName().getLocalPart(), 
+                                        operationName, 
                                         faultMessage.getName());
                 
                 newAxisOperation.addFaultAction(faultMessage.getName(), faultAction);
@@ -494,9 +494,9 @@
                 faultMessage.setName(faultName);
                 
                 String faultAction = 
-                        WSDL11ActionHelper.getFaultActionFromStringInformation( messageExchangePattern, 
+                        WSDL11ActionHelper.getFaultActionFromStringInformation( targetNS, 
                                         portTypeName, 
-                                        newAxisOperation.getName().getLocalPart(), 
+                                        operationName, 
                                         faultMessage.getName());
                 
                 newAxisOperation.addFaultAction(faultMessage.getName(), faultAction);

Added: webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java?rev=637327&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java Fri Mar 14 18:29:56 2008
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.description.addressing;
+
+import java.util.Iterator;
+
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.jaxws.description.DescriptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.util.Utils;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.soap.Addressing;
+
+import junit.framework.TestCase;
+
+public class ActionTests extends TestCase {
+    
+    private static final String ns = "http://jaxws.axis2.apache.org/metadata/addressing/action";
+    
+    private static final String defaultServicePortName = "DefaultServicePort";
+    private static final String plainServicePortName = "PlainServicePort";
+    
+    public void testNoAnnotation() {
+        ServiceDescription sd  = DescriptionFactory.createServiceDescription(DefaultService.class);
+        EndpointDescription ed = sd.getEndpointDescription(new QName(ns, defaultServicePortName));
+        assertNotNull(ed);
+        
+        AxisService axisService = ed.getAxisService();
+        Iterator iterator = axisService.getOperations();
+        
+        while (iterator.hasNext()) {
+            AxisOperation axisOperation = (AxisOperation) iterator.next();
+            assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteRequest", axisOperation.getInputAction());
+            assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteResponse", axisOperation.getOutputAction());
+            assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuote/Fault/TestException", axisOperation.getFaultAction());
+        }
+    }
+    
+    public void testPlainAnnotation() {
+        ServiceDescription sd  = DescriptionFactory.createServiceDescription(PlainService.class);
+        EndpointDescription ed = sd.getEndpointDescription(new QName(ns, plainServicePortName));
+        assertNotNull(ed);
+        
+        AxisService axisService = ed.getAxisService();
+        Iterator iterator = axisService.getOperations();
+        
+        while (iterator.hasNext()) {
+            AxisOperation axisOperation = (AxisOperation) iterator.next();
+            assertEquals("http://test/input", axisOperation.getInputAction());
+            assertEquals("http://test/output", axisOperation.getOutputAction());
+            assertEquals("http://test/fault", axisOperation.getFaultAction());
+        }
+    }
+    
+    @WebService(name="Service1", targetNamespace=ns, portName=defaultServicePortName)
+    class DefaultService {
+        public double getQuote(String symbol) throws TestException {
+            return 101.01;
+        }
+    }
+    
+    @WebService(name="Service2", targetNamespace=ns, portName=plainServicePortName)
+    class PlainService {
+        
+        @Action(input="http://test/input", output="http://test/output",
+                fault={ @FaultAction(className=TestException.class, value="http://test/fault") })
+        public double getQuote(String symbol) throws TestException {
+            return 101.01;
+        }
+    }
+    
+    @WebFault(name="TestException", targetNamespace=ns)
+    class TestException extends Exception {
+    }
+}

Propchange: webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org