cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r610314 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/javascript/src/test/resources/ tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/ tools/javato/ws/src/test/java/org/apache/...
Date Wed, 09 Jan 2008 09:28:03 GMT
Author: mmao
Date: Wed Jan  9 01:28:02 2008
New Revision: 610314

URL: http://svn.apache.org/viewvc?rev=610314&view=rev
Log:
CXF-1360 
  * Java2Ws generate all the quolified operations 
       include all the Declared methods in the implclass


Added:
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/A.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/B.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.java
Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=610314&r1=610313&r2=610314&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Wed Jan  9 01:28:02 2008
@@ -128,10 +128,7 @@
         }
     }
 
-    @Override
-    public Boolean isOperation(Method method) {
-        Method origMethod = method;
-        method = getDeclaredMethod(method);
+    public Boolean isWebMethod(final Method method) {
         if (method == null
             || method.getReturnType().equals(Future.class)
             || method.getReturnType().equals(Response.class)) {
@@ -148,22 +145,32 @@
                 }
             } else {
                 if (method.getDeclaringClass().isInterface()) {
-                    return hasWebServiceAnnotation(method) 
-                        ||  hasWebServiceAnnotation(origMethod);
+                    return hasWebServiceAnnotation(method);
                 }
                 return hasWebServiceAnnotation(method);              
             }
         }
         return Boolean.FALSE;
     }
+
+    @Override
+    public Boolean isOperation(final Method method) {
+        Class implClz = implInfo.getImplementorClass();
+        if (isWebMethod(getDeclaredMethod(implClz, method))) {
+            return true;
+        }
+        return isWebMethod(getDeclaredMethod(method));
+    }
     
     private boolean hasWebServiceAnnotation(Method method) {
         return method.getDeclaringClass().getAnnotation(WebService.class) != null; 
     }
 
     Method getDeclaredMethod(Method method) {
-        Class<?> endpointClass = implInfo.getEndpointClass();
+        return getDeclaredMethod(implInfo.getEndpointClass(), method);
+    }
 
+    private Method getDeclaredMethod(Class<?> endpointClass, Method method) {
         if (!method.getDeclaringClass().equals(endpointClass)) {
             try {
                 method = endpointClass.getMethod(method.getName(), (Class[])method.getParameterTypes());

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties?rev=610314&r1=610313&r2=610314&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties Wed Jan  9 01:28:02
2008
@@ -20,8 +20,8 @@
 #
 # logging for the javascript tests
 handlers= java.util.logging.ConsoleHandler
-.level= INFO
-java.util.logging.ConsoleHandler.level = FINEST
+.level= SEVERE
+java.util.logging.ConsoleHandler.level = SEVERE
 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
 #org.apache.cxf.javascript.JavascriptTestUtilities.level=FINE
 

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/A.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/A.java?rev=610314&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/A.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/A.java
Wed Jan  9 01:28:02 2008
@@ -0,0 +1,49 @@
+/**
+ * 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.cxf.tools.fortest.inherit;
+
+import javax.jws.WebService;
+
+@WebService(
+    portName = "J2WDLSharedEndpointPort",
+    serviceName = "J2WDLSharedService",
+    targetNamespace = "http://doclitservice.org/wsdl",
+    endpointInterface = "org.apache.cxf.tools.fortest.inherit.B"
+)
+public class A implements B {
+
+    public String helloWorld()  {
+        return "hello world";
+    }
+
+    public String helloWorld(String hello)  {
+        return hello;
+    }
+
+    public void oneWayOperation()  {
+    }
+
+    public String hello(String hello) {
+        return hello;
+    }
+
+    public String bye(String bye) {
+        return bye;
+    }
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/B.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/B.java?rev=610314&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/B.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/B.java
Wed Jan  9 01:28:02 2008
@@ -0,0 +1,56 @@
+/**
+ * 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.cxf.tools.fortest.inherit;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(
+    name = "MYJ2WDLSharedEndpoint",
+    targetNamespace = "http://doclitservice.org/wsdl"
+)
+
+@SOAPBinding(
+    style = javax.jws.soap.SOAPBinding.Style.DOCUMENT,
+    use = javax.jws.soap.SOAPBinding.Use.LITERAL,
+    parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED
+)
+interface B extends C {
+    // An overloaded method helloWorld
+    String helloWorld();
+    
+    // Annotation to disambiguate name of overloaded method helloWorld
+    // and to disambiguate name of Wrappers from HelloWorld - > HelloWorld2
+    @javax.jws.WebMethod(operationName = "helloWorld2")
+    @javax.xml.ws.RequestWrapper(
+        localName = "helloWorld2",
+        targetNamespace = "http://doclitservice.org/wsdl",
+        className = "com.sun.ts.tests.jaxws.mapping.j2wmapping.document.literal.wrapped.HelloWorld2"
+    )
+    @javax.xml.ws.ResponseWrapper(
+        localName = "helloWorld2Response",
+        targetNamespace = "http://doclitservice.org/wsdl",
+        className = "com.sun.ts.tests.jaxws.mapping.j2wmapping.document.literal.wrapped.HelloWorld2Response"
+    )
+    java.lang.String helloWorld(String hello);
+
+    @javax.jws.WebMethod
+    @javax.jws.Oneway
+    void oneWayOperation();
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.java?rev=610314&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.java
Wed Jan  9 01:28:02 2008
@@ -0,0 +1,24 @@
+/**
+ * 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.cxf.tools.fortest.inherit;
+
+public interface C {
+    String hello(String hello);
+    String bye(String bye);
+}
\ No newline at end of file

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=610314&r1=610313&r2=610314&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Wed Jan  9 01:28:02 2008
@@ -485,10 +485,6 @@
         } catch (Exception e) {
             e.printStackTrace();
         }
-        //File wsdlFile = new File(output, "add_numbers.wsdl");
-        //assertTrue("Generate Wsdl Fail", wsdlFile.exists());
-        //String expectedFile = getClass().getResource("expected/add_numbers_expected.wsdl").getFile();
-        //assertWsdlEquals(new File(expectedFile), wsdlFile);
 
         String pkgBase = "org/apache/cxf/tools/fortest/addr/jaxws";
         File requestWrapperClass = new File(output, pkgBase + "/AddNumbers.java");
@@ -502,20 +498,24 @@
         assertTrue(getStringFromFile(responseWrapperClass).indexOf("Holder") == -1);
     }
 
-//     @Test
-//     public void testInherit() throws Exception {
-//         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/inherit.wsdl");
-//         env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.inherit.A");
-//         env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-//         env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN);
-//         //env.put(ToolConstants.CFG_CREATE_XSD_IMPORTS, ToolConstants.CFG_CREATE_XSD_IMPORTS);
-//         try {
-//             processor.setEnvironment(env);
-//             processor.process();
-//         } catch (Exception e) {
-//             e.printStackTrace();
-//         }
-//     }
+    @Test
+    public void testInherit() throws Exception {
+        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/inherit.wsdl");
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.inherit.A");
+        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+        env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN);
+        env.put(ToolConstants.CFG_CREATE_XSD_IMPORTS, ToolConstants.CFG_CREATE_XSD_IMPORTS);
+        try {
+            processor.setEnvironment(env);
+            processor.process();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        File wsdlFile = new File(output, "inherit.wsdl");
+        assertTrue(wsdlFile.exists());
+        assertTrue(getStringFromFile(wsdlFile).indexOf("name=\"bye\"") != -1);
+    }
 
 //     @Test
 //     public void testWSARefParam() throws Exception {



Mime
View raw message