cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1293064 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/ wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/
Date Fri, 24 Feb 2012 03:05:56 GMT
Author: ema
Date: Fri Feb 24 03:05:55 2012
New Revision: 1293064

URL: http://svn.apache.org/viewvc?rev=1293064&view=rev
Log:
[CXF-4135]:Allow xsd shema file as a jaxb binding file to pass into JAXB schmeCompiler

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?rev=1293064&r1=1293063&r2=1293064&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java Fri
Feb 24 03:05:55 2012
@@ -167,6 +167,7 @@ public final class ToolConstants {
     public static final String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb";
     public static final QName  JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings");
     public static final QName  JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings");
+    public static final QName SCHEMA = new QName(SCHEMA_URI, "schema");
     public static final String JAXWS_BINDINGS_WSDL_LOCATION = "wsdlLocation";
     public static final String JAXWS_BINDING_NODE = "node";
     public static final String JAXWS_BINDING_VERSION = "version";

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=1293064&r1=1293063&r2=1293064&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Fri Feb 24 03:05:55 2012
@@ -571,8 +571,8 @@ public final class CustomizationParser {
     }
 
     private boolean isValidJaxbBindingFile(XMLStreamReader reader) {
-        if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())) {
-
+        if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())
+            || ToolConstants.SCHEMA.equals(reader.getName())) {
             return true;
         }
         return false;

Modified: cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=1293064&r1=1293063&r2=1293064&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Fri Feb 24 03:05:55 2012
@@ -1625,4 +1625,18 @@ public class CodeGenTest extends Abstrac
 
     }
 
+    
+    @Test
+    // CXF-4135
+    public void testPassShemaFileAsJAXBBinding() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+        env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/Invoice.xsd"));
+        processor.setContext(env);
+        processor.execute();
+        File generateFromBindingFile = new File(output, "org/apache/invoice/Invoice.java");
+        assertTrue(generateFromBindingFile.exists());
+        File seiFile = new File(output, "org/apache/cxf/w2j/hello_world_soap_http/Greeter.java");
+        assertTrue(seiFile.exists());
+    }
+    
 }



Mime
View raw message