You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/10/30 15:35:15 UTC

svn commit: r590086 - in /incubator/cxf/branches/2.0.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/ tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ tools/wsdlto/test/sr...

Author: dkulp
Date: Tue Oct 30 07:35:10 2007
New Revision: 590086

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

........
  r590003 | ema | 2007-10-30 05:28:11 -0400 (Tue, 30 Oct 2007) | 1 line
  
  Fixed issue CXF-1152
........

Added:
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/
      - copied from r590003, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml
      - copied unchanged from r590003, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml
      - copied unchanged from r590003, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml

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

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=590086&r1=590085&r2=590086&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Tue Oct 30 07:35:10 2007
@@ -22,7 +22,6 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
@@ -117,11 +116,14 @@
 
         for (Element element : jaxwsBindingsMap.keySet()) {
             nodeSelector.addNamespaces(element);
-            Element targetNode = jaxwsBindingsMap.get(element);
+            Element oldTargetNode = jaxwsBindingsMap.get(element);
+            Element targetNode = oldTargetNode;
             internalizeBinding(element, targetNode, "");
             String uri = element.getAttribute("wsdlLocation");
             customizedElements.put(uri, targetNode);
+            updateJaxwsBindingMapValue(targetNode);  
         }
+        
         buildHandlerChains();
     }
 
@@ -142,6 +144,7 @@
         
         try {
             doc = DOMUtils.readXml(ins);
+            doc.setDocumentURI(uri);
         } catch (Exception e) {
             Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {uri});
             throw new ToolException(msg, e);
@@ -153,6 +156,16 @@
         return null;
     }
 
+    private void updateJaxwsBindingMapValue(Element value) {
+        String baseURI = value.getBaseURI();        
+        for (Element ele : jaxwsBindingsMap.keySet()) {
+            String uri = jaxwsBindingsMap.get(ele).getBaseURI();
+            if (uri != null && uri.equals(baseURI)) {
+                jaxwsBindingsMap.put(ele, value);
+            }
+        }      
+    }
+    
     private void buildHandlerChains() {
 
         for (Element jaxwsBinding : jaxwsBindingsMap.keySet()) {
@@ -269,6 +282,8 @@
                     copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext());
                 }
             }
+            
+           
         }
 
         Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS);

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=590086&r1=590085&r2=590086&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Tue Oct 30 07:35:10 2007
@@ -536,7 +536,7 @@
     }
 
     @Test
-    //Test for CXF-765
+    // Test for CXF-765
     public void testClientServer() throws Exception {
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/bug765/hello_world_ports.wsdl"));
         env.remove(ToolConstants.CFG_COMPILE);
@@ -570,7 +570,7 @@
     public void testCXF804() throws Exception {
         env.put(ToolConstants.CFG_WSDLURL, 
                 getLocation("/wsdl2java_wsdl/cxf804/hello_world_contains_import.wsdl"));
-        //env.put(ToolConstants.CFG_SERVICENAME, "SOAPService");
+        // env.put(ToolConstants.CFG_SERVICENAME, "SOAPService");
         processor.setContext(env);
         processor.execute();
         
@@ -633,7 +633,8 @@
         try {
             env.put(ToolConstants.CFG_WSDLURL,
                     getLocation("/wsdl2java_wsdl/cxf939/bug.wsdl"));
-            //            env.put(ToolConstants.CFG_VALIDATE_WSDL, ToolConstants.CFG_VALIDATE_WSDL);
+            // env.put(ToolConstants.CFG_VALIDATE_WSDL,
+            // ToolConstants.CFG_VALIDATE_WSDL);
             processor.setContext(env);
             processor.execute();
         } catch (Exception e) {
@@ -695,7 +696,7 @@
 
     @Test
     public void testAsyncImplAndClient() throws Exception {
-        //CXF994
+        // CXF994
         env.put(ToolConstants.CFG_COMPILE, "compile");
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
@@ -858,12 +859,21 @@
         assertEquals(13, file.list().length);
         
     }
-
-
-    
-    
-    
-    
-    
     
+    @Test
+    public void testTwoJaxwsBindingFile() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+        env.put(ToolConstants.CFG_BINDING, new String[] {getLocation("/wsdl2java_wsdl/cxf1152/jaxws1.xml"),
+                                                         getLocation("/wsdl2java_wsdl/cxf1152/jaxws2.xml")});
+        processor.setContext(env);
+        processor.execute();
+        File file = new File(output, "org/mypkg");
+        assertEquals(23, file.listFiles().length);
+        Class clz = classLoader.loadClass("org.mypkg.MyService");
+        assertNotNull("Customized service class is not found", clz);
+        clz = classLoader.loadClass("org.mypkg.MyGreeter");
+        assertNotNull("Customized SEI class is not found", clz);
+        Method customizedMethod = clz.getMethod("myGreetMe", new Class[] {String.class});
+        assertNotNull("Customized method 'myGreetMe' in MyGreeter.class is not found", customizedMethod);
+    }  
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml?rev=590086&r1=590085&r2=590086&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml Tue Oct 30 07:35:10 2007
@@ -1,3 +1,21 @@
+<!--
+  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.
+-->
 <jxb:bindings version="1.0"
               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
               xmlns:xs="http://www.w3.org/2001/XMLSchema">

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml?rev=590086&r1=590085&r2=590086&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml Tue Oct 30 07:35:10 2007
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  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.
+-->
 <bindings wsdlLocation="../InvoiceServer.wsdl" xmlns="http://java.sun.com/xml/ns/jaxws">    
     <bindings node="ns1:definitions" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/">
         <package name="org.mytest"/>