cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r472436 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/ ...
Date Wed, 08 Nov 2006 09:27:37 GMT
Author: ema
Date: Wed Nov  8 01:27:33 2006
New Revision: 472436

URL: http://svn.apache.org/viewvc?view=rev&rev=472436
Log:
Added flag to control generate types, sei, impl and server class only.
Minor fix java2wsdl tool issue

Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaClientServerTest.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
Wed Nov  8 01:27:33 2006
@@ -65,8 +65,15 @@
     public static final String CFG_ANT = "ant";
     public static final String CFG_LIB_REF = "library.references";
     public static final String CFG_ANT_PROP = "ant.prop";
+    
+    //Internal Flag to generate
     public static final String CFG_GEN_CLIENT = "genClient";
     public static final String CFG_GEN_SERVER = "genServer";
+    public static final String CFG_GEN_IMPL = "genImpl";
+    public static final String CFG_GEN_TYPES = "genTypes";
+    public static final String CFG_GEN_SEI = "genSEI";
+    public static final String CFG_GEN_ANT = "genAnt"; 
+    public static final String CFG_GEN_SERVICE = "genService";
     public static final String CFG_GEN_OVERWRITE = "overwrite";
 
     // Java2WSDL Constants

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java
(original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DocWrapperMethodProcessor.java
Wed Nov  8 01:27:33 2006
@@ -103,7 +103,7 @@
             // rule 3.5 suffix -"Response"
             String resName = method.getName() + "Response";
             String resNS = model.getTargetNameSpace();
-            if (!reqWrapper.className().equals("")) {
+            if (!resWrapper.className().equals("")) {
                 resClassName = resWrapper.className();
                 resName = resWrapper.localName().length() > 0 ? resWrapper.localName()
: resName;
                 resNS = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace()
: resNS;

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
Wed Nov  8 01:27:33 2006
@@ -227,13 +227,14 @@
         
     }
 
+    
+    
+    
     public void generate() throws ToolException {
-        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_SERVER))
{
-            return;
-        }
         if (rawJaxbModelGenCode == null) {
             return;
         }
+        
         try {
             String dir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
Wed Nov  8 01:27:33 2006
@@ -83,11 +83,14 @@
         }
     }
 
-    protected boolean isCollision(String packageName, String filename) throws ToolException
{
+    protected boolean isCollision(String packageName, String filename) throws ToolException
{        
         return isCollision(packageName, filename, ".java");
     }
 
     protected boolean isCollision(String packageName, String filename, String ext) throws
ToolException {
+        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
+            return false;
+        }
         FileWriterUtil fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
         return fw.isCollision(packageName, filename + ext);
     }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java
Wed Nov  8 01:27:33 2006
@@ -34,7 +34,8 @@
 
     public boolean passthrough() {
         if (env.optionSet(ToolConstants.CFG_ANT)
-                || env.optionSet(ToolConstants.CFG_ALL)) {
+                || env.optionSet(ToolConstants.CFG_ALL)
+                || env.optionSet(ToolConstants.CFG_GEN_ANT)) {
             return false;
         }
         return true;

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java
Wed Nov  8 01:27:33 2006
@@ -38,12 +38,23 @@
         this.name = ToolConstants.CLT_GENERATOR;
     }
 
-    public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_CLIENT)
-            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_ALL))
{
+    public boolean passthrough() {       
+        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_CLIENT)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
             return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
         }
+        
         return true;
+        
     }
 
     public void generate(ToolContext penv) throws ToolException {

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java
Wed Nov  8 01:27:33 2006
@@ -40,10 +40,19 @@
 
 
     public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT)
-            || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+        if (env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
             return true;
         }
+        
         return false;
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java
Wed Nov  8 01:27:33 2006
@@ -39,12 +39,24 @@
         this.name = ToolConstants.IMPL_GENERATOR;
     }
 
-    public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_IMPL)
-                || env.optionSet(ToolConstants.CFG_ALL)) {
+    public boolean passthrough() {       
+        if (env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_IMPL)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
             return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
         }
+        
         return true;
+        
+        
     }
 
     public void generate(ToolContext penv) throws ToolException {

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java
Wed Nov  8 01:27:33 2006
@@ -36,11 +36,22 @@
         this.name = ToolConstants.SEI_GENERATOR;
     }
 
-    public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_SERVER))
{
+    public boolean passthrough() {      
+        if (env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
             return true;
         }
+        
         return false;
+        
     }
 
     private boolean hasHandlerConfig(JavaInterface intf) {

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java
Wed Nov  8 01:27:33 2006
@@ -39,10 +39,18 @@
     }
 
     public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_SERVER)
-                || env.optionSet(ToolConstants.CFG_GEN_SERVER)
-                || env.optionSet(ToolConstants.CFG_ALL)) {
+        if (env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_SERVER)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
             return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
         }
         return true;
     }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java
Wed Nov  8 01:27:33 2006
@@ -42,7 +42,16 @@
     }
 
     public boolean passthrough() {
-        if (env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+        if (env.optionSet(ToolConstants.CFG_GEN_SERVICE)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
             return true;
         }
         return false;

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
Wed Nov  8 01:27:33 2006
@@ -152,9 +152,26 @@
 
         generators =  profileObj.getPlugins();
     }
-
+   
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        
+        return false;
+    }
+    
     private void generateTypes() throws ToolException {
-        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_SERVER))
{
+        if (passthrough()) {
             return;
         }
         if (bindingGenerator == null) {

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
Wed Nov  8 01:27:33 2006
@@ -26,6 +26,7 @@
 import javax.wsdl.Message;
 import javax.wsdl.Part;
 
+import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaException;
@@ -59,6 +60,9 @@
     }
 
     private boolean isNameCollision(String packageName, String className) {  
+        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
+            return false;
+        }
         boolean collision = collector.containTypesClass(packageName, className)
             || collector.containSeiClass(packageName, className);
         return collision;

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
Wed Nov  8 01:27:33 2006
@@ -120,6 +120,9 @@
     }
 
     private boolean isNameCollision(String packageName, String className) {
+        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
+            return false;
+        }
         return collector.containTypesClass(packageName, className)
                || collector.containSeiClass(packageName, className)
                || collector.containExceptionClass(packageName, className);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaClientServerTest.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaClientServerTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaClientServerTest.java
Wed Nov  8 01:27:33 2006
@@ -63,12 +63,12 @@
 
             }
         });
-        assertTrue("Should generate 3 files", files != null && files.length == 3);
+        assertTrue("Should generate 1 files", files != null && files.length == 1);
 
     }
 
     public void testGenServerOnly() throws Exception {
-
+ 
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
         env.put(ToolConstants.CFG_GEN_SERVER, ToolConstants.CFG_GEN_SERVER);
         processor.setEnvironment(env);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java?view=diff&rev=472436&r1=472435&r2=472436
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
Wed Nov  8 01:27:33 2006
@@ -1113,6 +1113,38 @@
         Method method = clz.getMethod("headerMethod", new Class[] {headerData, header});
      
         assertNotNull("method should be generated", method);
     }
+     
+    public void testFlagForGenStandAlone() throws Exception {
+        env.put(ToolConstants.CFG_GEN_TYPES, ToolConstants.CFG_GEN_TYPES);
+        env.put(ToolConstants.CFG_GEN_SEI, ToolConstants.CFG_GEN_SEI);
+        env.put(ToolConstants.CFG_GEN_IMPL, ToolConstants.CFG_GEN_IMPL);
+        env.put(ToolConstants.CFG_GEN_SERVICE, ToolConstants.CFG_GEN_SERVICE);
+        env.put(ToolConstants.CFG_GEN_SERVER, ToolConstants.CFG_GEN_SERVER);
+        env.put(ToolConstants.CFG_GEN_ANT, ToolConstants.CFG_GEN_ANT);
+        
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
     
+        processor.setEnvironment(env);
+        processor.process();
+        
+        Class greeterServer = classLoader.loadClass("org.apache.hello_world_soap_http.GreeterServer");
+        assertNotNull("Server should be generated", greeterServer);
+        
+      
+    }
+    
+    public void testFlagForGenAdditional() throws Exception {
+        env.put(ToolConstants.CFG_IMPL, ToolConstants.CFG_IMPL);
+        env.put(ToolConstants.CFG_SERVER, ToolConstants.CFG_SERVER);
+               
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
     
+        processor.setEnvironment(env);
+        processor.process();
+            
+        Class greeterServer = classLoader.loadClass("org.apache.hello_world_soap_http.GreeterServer");
+        assertNotNull("Server should be generated", greeterServer);
+    }
+    
+    
     
     private String getLocation(String wsdlFile) {
         return WSDLToJavaProcessorTest.class.getResource(wsdlFile).getFile();



Mime
View raw message