cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1210618 - in /cxf/branches/2.4.x-fixes: ./ rt/javascript/src/main/java/org/apache/cxf/javascript/service/ tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/ tools/wsdlto/frontend/javascript/src/test/reso...
Date Mon, 05 Dec 2011 20:55:04 GMT
Author: dkulp
Date: Mon Dec  5 20:55:03 2011
New Revision: 1210618

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

........
  r1210614 | dkulp | 2011-12-05 15:44:31 -0500 (Mon, 05 Dec 2011) | 2 lines
  
  [CXF-3891] wsdl2js NPE's with element references to an element with an
  anonymous type
........

Added:
    cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/tools/wsdlto/javascript/hello_world_ref.wsdl
      - copied unchanged from r1210614, cxf/trunk/tools/wsdlto/frontend/javascript/src/test/resources/org/apache/cxf/tools/wsdlto/javascript/hello_world_ref.wsdl
Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
    cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java

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

Modified: cxf/branches/2.4.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java?rev=1210618&r1=1210617&r2=1210618&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
Mon Dec  5 20:55:03 2011
@@ -740,7 +740,8 @@ public class ServiceJavascriptBuilder ex
                         if (element.getSchemaTypeName() != null) {
                             element.setSchemaType(xmlSchemaCollection
                                                   .getTypeByQName(element.getSchemaTypeName()));
-                        } else if (element.getRef().getTargetQName() != null) {
+                        } else if (element.getRef().getTargetQName() != null
+                            && element.getRef().getTarget().getSchemaTypeName() !=
null) {
                             element = element.getRef().getTarget();
                             element.setSchemaType(xmlSchemaCollection
                                                   .getTypeByQName(element.getSchemaTypeName()));

Modified: cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java?rev=1210618&r1=1210617&r2=1210618&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
(original)
+++ cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/javascript/src/test/java/org/apache/cxf/tools/wsdlto/javascript/WSDLToJavaScriptTest.java
Mon Dec  5 20:55:03 2011
@@ -53,6 +53,25 @@ public class WSDLToJavaScriptTest extend
         String javascript = IOUtils.readStringFromStream(fis);
         assertTrue(javascript.contains("xmlns:murble='http://apache.org/hello_world_soap_http'"));
     }
-    
+   
+    @Test
+    public void testCXF3891() throws Exception {
+        JavaScriptContainer container = new JavaScriptContainer(null);
+
+        ToolContext context = new ToolContext();
+        context.put(ToolConstants.CFG_WSDLURL, getLocation("hello_world_ref.wsdl"));
+        context.put(ToolConstants.CFG_OUTPUTDIR, output.toString()); 
+        String[] prefixes = new String[1];
+        prefixes[0] = "http://apache.org/hello_world_soap_http=murble";
+        context.put(ToolConstants.CFG_JSPACKAGEPREFIX, prefixes);
+        container.setContext(context); 
+        container.execute();
+        // now we really want to check some results.
+        File resultFile = new File(output, "SOAPService.js");
+        assertTrue(resultFile.canRead());
+        FileInputStream fis = new FileInputStream(resultFile);
+        String javascript = IOUtils.readStringFromStream(fis);
+        assertTrue(javascript.contains("xmlns:murble='http://apache.org/hello_world_soap_http'"));
+    }
    
 }



Mime
View raw message