cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1067066 - in /cxf/branches/2.3.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/ tool...
Date Fri, 04 Feb 2011 02:37:46 GMT
Author: dkulp
Date: Fri Feb  4 02:37:45 2011
New Revision: 1067066

URL: http://svn.apache.org/viewvc?rev=1067066&view=rev
Log:
Merged revisions 1067065 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1067065 | dkulp | 2011-02-03 21:31:01 -0500 (Thu, 03 Feb 2011) | 2 lines
  
  [CXF-3290] Fix problem of generating code with Service and SEI haveing
  the same name, but different packages.
........

Added:
    cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/
      - copied from r1067065, cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/
    cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/bug.wsdl
      - copied unchanged from r1067065, cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/bug.wsdl
    cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/bug2.wsdl
      - copied unchanged from r1067065, cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-3290/bug2.wsdl
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
    cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
    cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=1067066&r1=1067065&r2=1067066&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
Fri Feb  4 02:37:45 2011
@@ -109,7 +109,8 @@ public class ServiceGenerator extends Ab
                 }
     
                 for (JavaPort port : js.getPorts()) {
-                    if (!port.getPackageName().equals(js.getPackageName())) {
+                    if (!port.getPackageName().equals(js.getPackageName())
+                        && !port.getInterfaceClass().equals(js.getName())) {
                         js.addImport(port.getFullClassName());
                     }
                 }

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm?rev=1067066&r1=1067065&r2=1067066&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
Fri Feb  4 02:37:45 2011
@@ -144,6 +144,10 @@ public class ${service.Name} extends ${s
 #end
 
 #foreach ($port in $service.Ports)
+#set($portClassName = ${port.InterfaceClass})
+#if ($portClassName == ${service.Name}) 
+#set($portClassName = ${port.fullClassName})
+#end
     /**
      * 
      * @return
@@ -153,8 +157,8 @@ public class ${service.Name} extends ${s
 #if ($mark-generated == "true")
     @Generated(value = "org.apache.cxf.tools.wsdlto.WSDLToJava", date = "$currentdate")
 #end
-    public ${port.InterfaceClass} get${port.Name}() {
-        return super.getPort($port.Name, ${port.InterfaceClass}.class);
+    public ${portClassName} get${port.Name}() {
+        return super.getPort($port.Name, ${portClassName}.class);
     }
 
     /**
@@ -168,8 +172,8 @@ public class ${service.Name} extends ${s
 #if ($mark-generated == "true")
     @Generated(value = "org.apache.cxf.tools.wsdlto.WSDLToJava", date = "$currentdate")
 #end
-    public ${port.InterfaceClass} get${port.Name}(WebServiceFeature... features) {
-        return super.getPort($port.Name, ${port.InterfaceClass}.class, features);
+    public ${portClassName} get${port.Name}(WebServiceFeature... features) {
+        return super.getPort($port.Name, ${portClassName}.class, features);
     }
 #end
 

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=1067066&r1=1067065&r2=1067066&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Fri Feb  4 02:37:45 2011
@@ -1163,4 +1163,18 @@ public class CodeGenBugTest extends Abst
         File f = new File(output, "org/apache/cxf/w2j/hello_world_soap_http/SayHi.java");
         assertTrue(f.exists());
     }
+    @Test
+    public void testCXF3290() throws Exception {
+        env.put(ToolConstants.CFG_COMPILE, "compile");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+        env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf-3290/bug.wsdl"));
+        processor.setContext(env);
+        processor.execute();
+        
+        Class<?> cls = classLoader.loadClass("org.apache.cxf.bugs3290.services.bug1.MyBugService");
+        Method m = cls.getMethod("getMyBug1");
+        assertEquals(classLoader.loadClass("org.apache.cxf.bugs3290.services.bug2.MyBugService"),
+                     m.getReturnType());
+    }
 }



Mime
View raw message