cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6690] Splitting complex XJC parameters
Date Mon, 23 Nov 2015 12:36:36 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 71d70edf5 -> c9a4511bb


[CXF-6690] Splitting complex XJC parameters


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c9a4511b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c9a4511b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c9a4511b

Branch: refs/heads/3.0.x-fixes
Commit: c9a4511bbedb65f5b8be015962946a8642f9295b
Parents: 71d70ed
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Nov 23 12:34:17 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Nov 23 12:36:20 2015 +0000

----------------------------------------------------------------------
 .../cxf/tools/wadlto/jaxb/CustomizationParser.java  | 16 ++++++++++++++--
 .../cxf/tools/wadlto/jaxrs/WADLToJavaTest.java      |  2 ++
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c9a4511b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
index 1f2164e..e03dbfa 100644
--- a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
+++ b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
@@ -22,7 +22,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -30,6 +30,7 @@ import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.w3c.dom.Element;
+
 import org.xml.sax.InputSource;
 
 import org.apache.cxf.Bus;
@@ -90,9 +91,20 @@ public final class CustomizationParser {
         //pass additional JAXB compiler arguments
         Object jaxbCompilerArgs = env.get(WadlToolConstants.CFG_XJC_ARGS);
         if (jaxbCompilerArgs != null) {
+            
             String[] jaxbArgs = jaxbCompilerArgs instanceof String
                     ? new String[]{(String)jaxbCompilerArgs} : (String[])jaxbCompilerArgs;
-            compilerArgs.addAll(Arrays.asList(jaxbArgs));
+            List<String> jaxbArgsList = new LinkedList<String>();
+            for (String jaxbArg : jaxbArgs) {        
+                String[] allArgs = jaxbArg.split(" ");
+                for (String arg : allArgs) {
+                    String s = arg.trim();
+                    if (!StringUtils.isEmpty(s)) {
+                        jaxbArgsList.add(s);
+                    }
+                }
+            }
+            compilerArgs.addAll(jaxbArgsList);
         }
         
         // Schema Namespace to Package customizations

http://git-wip-us.apache.org/repos/asf/cxf/blob/c9a4511b/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
b/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
index 81a6ebc..393474a 100644
--- a/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
+++ b/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
@@ -74,6 +74,7 @@ public class WADLToJavaTest extends ProcessorTestBase {
                 "custom.service",
                 "-async getName,delete",
                 "-compile",
+                "-xjc-episode " + output.getAbsolutePath() + "/test.episode",
                 "-xjc-XtoString",
                 getLocation("/wadl/bookstore.xml"),
             };
@@ -84,6 +85,7 @@ public class WADLToJavaTest extends ProcessorTestBase {
 
             verifyFiles("java", true, false, "superbooks", "custom.service");
             verifyFiles("class", true, false, "superbooks", "custom.service");
+            assertTrue(new File(output.getAbsolutePath() + "/test.episode").exists());
 
             List<Class<?>> schemaClassFiles = getSchemaClassFiles();
             assertEquals(4, schemaClassFiles.size());


Mime
View raw message