cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r504473 - in /incubator/cxf/trunk/tools2: common/src/main/java/org/apache/cxf/tools/common/ common/src/test/java/org/apache/cxf/tools/common/ javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ javato/src/main/java/org/apache/cxf...
Date Wed, 07 Feb 2007 09:18:28 GMT
Author: mmao
Date: Wed Feb  7 01:18:27 2007
New Revision: 504473

URL: http://svn.apache.org/viewvc?view=rev&rev=504473
Log:
java2wsdl minor fixes

* Move WSDLVersion to WSDLConstants 
* Reuse WrapperUtil in DocWrapperMethodProcessor to check if it's has wrapper class

Removed:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLVersion.java
Modified:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLConstants.java
    incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
    incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
Wed Feb  7 01:18:27 2007
@@ -187,11 +187,5 @@
     public static final String FRONTEND_PLUGIN = "frontend";
     public static final String DATABINDING_PLUGIN = "databinding";
     
-    public static final String CFG_WSDL_VERSION = "wsdlversion";
-    
-    public enum WSDLVersion {
-        WSDL11,
-        WSDL20,
-        UNKNOWN
-    };
+    public static final String CFG_WSDL_VERSION = "wsdlversion";    
 }

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLConstants.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLConstants.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/WSDLConstants.java
Wed Feb  7 01:18:27 2007
@@ -107,4 +107,26 @@
     public static final int ERORR_STYLE_USE = -1;
 
     public static final String XML_BINDING_NS = "http://cxf.apache.org/bindings/xformat";
+
+    public static final String WSDL11 = "1.1";
+    public static final String WSDL20 = "2.0";
+
+    public enum WSDLVersion {
+        WSDL11,
+        WSDL20,
+        UNKNOWN
+    };
+
+    private WSDLConstants() {
+    }
+    
+    public static WSDLVersion getVersion(String version) {
+        if (WSDL11.equals(version)) {
+            return WSDLVersion.WSDL11;
+        }
+        if (WSDL20.equals(version)) {
+            return WSDLVersion.WSDL20;
+        }
+        return WSDLVersion.UNKNOWN;
+    }
 }

Modified: incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/common/WSDLVersionTest.java
Wed Feb  7 01:18:27 2007
@@ -24,8 +24,8 @@
 public class WSDLVersionTest extends TestCase {
     
     public void testWSDLVersion() {
-        assertEquals(ToolConstants.WSDLVersion.WSDL11, WSDLVersion.getVersion("1.1"));
-        assertEquals(ToolConstants.WSDLVersion.WSDL20, WSDLVersion.getVersion("2.0"));
-        assertEquals(ToolConstants.WSDLVersion.UNKNOWN, WSDLVersion.getVersion("3.0"));
+        assertEquals(WSDLConstants.WSDLVersion.WSDL11, WSDLConstants.getVersion("1.1"));
+        assertEquals(WSDLConstants.WSDLVersion.WSDL20, WSDLConstants.getVersion("2.0"));
+        assertEquals(WSDLConstants.WSDLVersion.UNKNOWN, WSDLConstants.getVersion("3.0"));
     }
 }

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
Wed Feb  7 01:18:27 2007
@@ -19,12 +19,12 @@
 
 package org.apache.cxf.tools.java2wsdl.generator;
 
-import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.WSDLConstants;
 
 public final class WSDLGeneratorFactory {
     private static WSDLGeneratorFactory instance;
-    private ToolConstants.WSDLVersion wsdlVersion;
+    private WSDLConstants.WSDLVersion wsdlVersion;
     
     private WSDLGeneratorFactory() {
     }
@@ -36,7 +36,7 @@
         return instance;
     }
 
-    public void setWSDLVersion(ToolConstants.WSDLVersion v) {
+    public void setWSDLVersion(WSDLConstants.WSDLVersion v) {
         this.wsdlVersion = v;
     }
 

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
Wed Feb  7 01:18:27 2007
@@ -31,7 +31,7 @@
 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.WSDLVersion;
+import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.java2wsdl.generator.AbstractGenerator;
 import org.apache.cxf.tools.java2wsdl.generator.WSDLGeneratorFactory;
 import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilder;
@@ -91,11 +91,11 @@
                                         getClass().getClassLoader());
     }
 
-    public ToolConstants.WSDLVersion getWSDLVersion() {
+    public WSDLConstants.WSDLVersion getWSDLVersion() {
         String version = (String) context.get(ToolConstants.CFG_WSDL_VERSION);
-        ToolConstants.WSDLVersion wsVersion = WSDLVersion.getVersion(version);
-        if (wsVersion == ToolConstants.WSDLVersion.UNKNOWN) {
-            wsVersion = ToolConstants.WSDLVersion.WSDL11;
+        WSDLConstants.WSDLVersion wsVersion = WSDLConstants.getVersion(version);
+        if (wsVersion == WSDLConstants.WSDLVersion.UNKNOWN) {
+            wsVersion = WSDLConstants.WSDLVersion.WSDL11;
         }
         return wsVersion;
     }

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/DocWrapperMethodProcessor.java
Wed Feb  7 01:18:27 2007
@@ -27,7 +27,6 @@
 import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.logging.Logger;
 
 import javax.jws.Oneway;
 import javax.jws.WebParam;
@@ -35,14 +34,10 @@
 import javax.jws.soap.SOAPBinding;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebFault;
 
 import com.sun.xml.bind.api.TypeReference;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaMethod;
@@ -52,13 +47,10 @@
 import org.apache.cxf.tools.common.model.WSDLModel;
 import org.apache.cxf.tools.common.model.WSDLParameter;
 
-import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
-
 import org.apache.cxf.tools.util.AnnotationUtil;
 
 
 public class DocWrapperMethodProcessor {
-    private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class);
     private WSDLModel model;
 
     public DocWrapperMethodProcessor(WSDLModel wmodel) {
@@ -74,60 +66,32 @@
         setMethodUse(javaMethod, method);
 
         // process request
-        RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
-        String reqClassName = "";
-        String reqName = method.getName();
-        String reqNS = model.getTargetNameSpace();
-        if (reqWrapper != null && !StringUtils.isEmpty(reqWrapper.className())) {
-            reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className()
: reqClassName;
-            reqName = reqWrapper.localName().length() > 0 ? reqWrapper.localName() : reqName;
-            reqNS = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace()
: reqNS;
-        } else {      
-            reqClassName = model.getPackageName() + ".jaxws." + AnnotationUtil.capitalize(method.getName());
-        }
-        
-        Class reqClass = null;
-        try {
-            reqClass = AnnotationUtil.loadClass(reqClassName, this.getClass().getClassLoader());
-        } catch (Exception e) {
-            Message msg = new Message("LOAD_REQUEST_WRAPPER_CLASS_ERROR", LOG, reqClassName);
-            throw new ToolException(msg, e);
+        Wrapper requestWrapper = WrapperUtil.getRequestWrapper(method);
+        if (StringUtils.isEmpty(requestWrapper.targetNamespace)) {
+            requestWrapper.targetNamespace = model.getTargetNameSpace();
         }
-        QName reqQN = new QName(reqNS, reqName);
+        Class reqClass = requestWrapper.getWrapperClass();
+        QName reqQN = new QName(requestWrapper.targetNamespace, requestWrapper.localName);
         TypeReference typeRef = new TypeReference(reqQN, reqClass, new Annotation[0]);
-        WSDLParameter request = new WSDLParameter(reqName, typeRef, JavaType.Style.IN);
-        request.setTargetNamespace(reqNS);
+        WSDLParameter request = new WSDLParameter(requestWrapper.localName, typeRef, JavaType.Style.IN);
+        request.setTargetNamespace(requestWrapper.targetNamespace);
         javaMethod.addRequest(request);
 
        
         if (!isOneWayMethod(method)) {
             // process response
-            ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
-            String resClassName = "";
-            // rule 3.5 suffix -"Response"
-            String resName = method.getName() + "Response";
-            String resNS = model.getTargetNameSpace();
-            if (resWrapper != null && !StringUtils.isEmpty(resWrapper.className()))
{
-                resClassName = resWrapper.className();
-                resName = resWrapper.localName().length() > 0 ? resWrapper.localName()
: resName;
-                resNS = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace()
: resNS;
-            } else {
-                resClassName = model.getPackageName() + ".jaxws." 
-                    + AnnotationUtil.capitalize(method.getName())
-                               + "Response";
-            }
-            Class resClass = null;
-            QName resQN = new QName(resNS, resName);
-            try {
-                resClass = AnnotationUtil
-                    .loadClass(resClassName, method.getDeclaringClass().getClassLoader());
-            } catch (Exception e) {
-                Message msg = new Message("LOAD_RESPONSE_WRAPPER_CLASS_ERROR", LOG, resClassName);
-                throw new ToolException(msg, e);
+            Wrapper responseWrapper = WrapperUtil.getResponseWrapper(method);
+            if (StringUtils.isEmpty(responseWrapper.targetNamespace)) {
+                responseWrapper.targetNamespace = model.getTargetNameSpace();
             }
+            
+            Class resClass = responseWrapper.getWrapperClass();
+            QName resQN = new QName(responseWrapper.targetNamespace, responseWrapper.localName);
             typeRef = new TypeReference(resQN, resClass, new Annotation[0]);
-            WSDLParameter response = new WSDLParameter(resName, typeRef, JavaType.Style.OUT);
-            response.setTargetNamespace(resNS);
+            WSDLParameter response = new WSDLParameter(responseWrapper.localName,
+                                                       typeRef,
+                                                       JavaType.Style.OUT);
+            response.setTargetNamespace(responseWrapper.targetNamespace);
             javaMethod.addResponse(response);
             WebResult webResult = method.getAnnotation(WebResult.class);
             JavaParameter returnParameter = getReturnParameter(webResult, method);

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
Wed Feb  7 01:18:27 2007
@@ -1,2 +1,3 @@
-LOAD_WRAPPER_CLASS_FAILED = Can not load wrapper class {0}, please check the @RequestWrapper
or @ResponseWrapper and also check the clas is in your classpath
+LOAD_WRAPPER_CLASS_FAILED = Can not load wrapper class {0}, please check the @RequestWrapper
or @ResponseWrapper and also check the class is in your classpath
+WRAPPER_CLASS_NOT_EXIST = Wrapper class not exist
 SOAPBinding_RPC_ON_METHOD = Method [{0}] processing error : SOAPBinding annotation can not
be placed on method with RPC style 

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
Wed Feb  7 01:18:27 2007
@@ -19,10 +19,20 @@
 
 package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.util.AnnotationUtil;
+
 public class Wrapper {
+    private static final Logger LOG = LogUtils.getL7dLogger(Wrapper.class);
     protected String className;
     protected String localName;
     protected String targetNamespace;
+    protected String wrapperClass;
 
     public Wrapper() {
     }
@@ -31,5 +41,15 @@
         this.className = clz;
         this.localName = name;
         this.targetNamespace = ns;
+    }
+
+    public Class getWrapperClass() {
+        try {
+            return AnnotationUtil.loadClass(className, getClass().getClassLoader());
+        } catch (Exception e) {
+            Message msg = new Message("LOAD_WRAPPER_CLASS_FAILED", LOG, className);
+            LOG.log(Level.WARNING, msg.toString());
+            throw new ToolException(msg);
+        }
     }
 }

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtil.java
Wed Feb  7 01:18:27 2007
@@ -20,20 +20,16 @@
 package org.apache.cxf.tools.java2wsdl.processor.internal.jaxws;
 
 import java.lang.reflect.Method;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
+import javax.jws.Oneway;
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.util.AnnotationUtil;
 
 public final class WrapperUtil {
-
-    private static final Logger LOG = LogUtils.getL7dLogger(WrapperUtil.class);
+    
     private WrapperUtil() {
     }
 
@@ -49,6 +45,7 @@
         } else {
             reqClassName = getPackageName(method) + ".jaxws." + AnnotationUtil.capitalize(method.getName());
         }
+
         return new Wrapper(reqClassName, reqName, reqNS);
     }
 
@@ -73,12 +70,13 @@
     public static boolean isWrapperClassExists(Method method) {
         Wrapper requestWrapper = getRequestWrapper(method);
         Wrapper responseWrapper = getResponseWrapper(method);
+        boolean isOneWay = method.isAnnotationPresent(Oneway.class);
         try {
-            AnnotationUtil.loadClass(requestWrapper.className, WrapperUtil.class.getClassLoader());
-            AnnotationUtil.loadClass(responseWrapper.className, WrapperUtil.class.getClassLoader());
+            requestWrapper.getWrapperClass();
+            if (!isOneWay) {
+                responseWrapper.getWrapperClass();
+            }
         } catch (Exception e) {
-            Message msg = new Message("LOAD_WRAPPER_CLASS_FAILED", LOG);
-            LOG.log(Level.WARNING, msg.toString());
             return false;
         }
         return true;

Modified: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
Wed Feb  7 01:18:27 2007
@@ -20,14 +20,14 @@
 package org.apache.cxf.tools.java2wsdl.generator;
 
 import junit.framework.TestCase;
-import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator;
 
 public class WSDLGeneratorFactoryTest extends TestCase {
     WSDLGeneratorFactory factory = WSDLGeneratorFactory.getInstance();
 
     public void testNewWSDL11Generator() {
-        factory.setWSDLVersion(ToolConstants.WSDLVersion.WSDL11);
+        factory.setWSDLVersion(WSDLConstants.WSDLVersion.WSDL11);
         AbstractGenerator generator = factory.newGenerator();
         assertNotNull(generator);
         assertTrue(generator instanceof WSDL11Generator);

Modified: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Wed Feb  7 01:18:27 2007
@@ -28,6 +28,7 @@
 import org.apache.cxf.helpers.WSDLHelper;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.WSDLConstants;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
     JavaToProcessor processor = new JavaToProcessor();
@@ -38,7 +39,7 @@
     
     public void testGetWSDLVersion() {
         processor.setEnvironment(new ToolContext());
-        assertEquals(ToolConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
+        assertEquals(WSDLConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
     }
 
     public void testSimpleClass() throws Exception {

Modified: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
Wed Feb  7 01:18:27 2007
@@ -294,8 +294,7 @@
         try {        
             j2wProcessor.process();
         } catch (ToolException e) {
-            String expected = "Can not load the request wrapper class " 
-                + "org.apache.cxf.tools.fortest.withannotation.doc.jaxws.SayHi";        
   
+            String expected = "org.apache.cxf.tools.fortest.withannotation.doc.jaxws.SayHi";
             assertTrue(e.getMessage().contains(expected));
         } catch (Exception e) {
             fail("Should not happen other exception " + e.getMessage());

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=504473&r1=504472&r2=504473
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Wed Feb  7 01:18:27 2007
@@ -48,7 +48,7 @@
 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.WSDLVersion;
+import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
@@ -80,9 +80,9 @@
         return set;
     }
 
-    public ToolConstants.WSDLVersion getWSDLVersion() {
+    public WSDLConstants.WSDLVersion getWSDLVersion() {
         String version = (String) context.get(ToolConstants.CFG_WSDL_VERSION);
-        return WSDLVersion.getVersion(version);
+        return WSDLConstants.getVersion(version);
     }
 
     public Bus getBus() {
@@ -116,13 +116,13 @@
                 context.put(DataBindingProfile.class, dataBindingProfile);
             }
             
-            ToolConstants.WSDLVersion version = getWSDLVersion();
+            WSDLConstants.WSDLVersion version = getWSDLVersion();
 
             ServiceInfo service = null;
             String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
             
             // Build the ServiceModel from the WSDLModel
-            if (version == ToolConstants.WSDLVersion.WSDL11) {
+            if (version == WSDLConstants.WSDLVersion.WSDL11) {
                 AbstractWSDLBuilder<Definition> builder =
                     (AbstractWSDLBuilder<Definition>) frontend.getWSDLBuilder();
                 builder.setContext(context);
@@ -364,7 +364,7 @@
         }
         
         if (!context.containsKey(ToolConstants.CFG_WSDL_VERSION)) {
-            context.put(ToolConstants.CFG_WSDL_VERSION, WSDLVersion.WSDL11);
+            context.put(ToolConstants.CFG_WSDL_VERSION, WSDLConstants.WSDL11);
         }
        
         setExcludePackageAndNamespaces(context);



Mime
View raw message