cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r572893 - in /incubator/cxf/trunk/tools/javato/ws: ./ src/test/generated/ src/test/java/org/apache/cxf/tools/fortest/ src/test/java/org/apache/cxf/tools/java2ws/fortest/ src/test/java/org/apache/cxf/tools/java2wsdl/ src/test/java/org/apache...
Date Wed, 05 Sep 2007 07:27:32 GMT
Author: ema
Date: Wed Sep  5 00:27:20 2007
New Revision: 572893

URL: http://svn.apache.org/viewvc?rev=572893&view=rev
Log:
[CXF-969]Porting java2wsdl tests from javato/test module to javato/ws module

Added:
    incubator/cxf/trunk/tools/javato/ws/src/test/generated/
      - copied from r572581, incubator/cxf/trunk/tools/javato/test/src/test/generated/
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/
      - copied from r572581, incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/AddException.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/Calculator.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/
      - copied from r572581, incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSFlagTest.java
Removed:
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLTest.java
Modified:
    incubator/cxf/trunk/tools/javato/ws/pom.xml
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGeneratorTest.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/tools/javato/ws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/pom.xml?rev=572893&r1=572892&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/pom.xml (original)
+++ incubator/cxf/trunk/tools/javato/ws/pom.xml Wed Sep  5 00:27:20 2007
@@ -139,6 +139,14 @@
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>        
+        
 
     </dependencies>
     <build>

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/AddException.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/AddException.java?rev=572893&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/AddException.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/AddException.java
Wed Sep  5 00:27:20 2007
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.java2ws.fortest;
+
+/**
+ * 
+ */
+public class AddException extends Exception {
+    public AddException(String message) {
+        super(message);
+    }
+}

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/Calculator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/Calculator.java?rev=572893&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/Calculator.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/fortest/Calculator.java
Wed Sep  5 00:27:20 2007
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.tools.java2ws.fortest;
+
+public class Calculator {
+    public int add(int a, int b) throws AddException {
+        if (a < 0 || b < 0) {
+            throw new AddException("No negetive please");
+        }
+        return a + b;
+    }
+}

Added: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSFlagTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSFlagTest.java?rev=572893&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSFlagTest.java
(added)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/JavaToWSFlagTest.java
Wed Sep  5 00:27:20 2007
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.java2wsdl;
+
+import org.apache.cxf.tools.common.ToolTestBase;
+import org.apache.cxf.tools.java2ws.JavaToWS;
+import org.junit.After;
+import org.junit.Test;
+
+public class JavaToWSFlagTest extends ToolTestBase {
+
+    @After
+    public void tearDown() {
+        super.tearDown();
+    }
+
+    @Test
+    public void testVersionOutput() throws Exception {
+        String[] args = new String[] {"-v"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+    }
+
+    @Test
+    public void testHelpOutput() {
+        String[] args = new String[] {"-help"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+    }
+
+    @Test
+    public void testNormalArgs() throws Exception {
+        System.err.println(getLocation("test.wsdl"));
+        String[] args = new String[] {"-o",
+                                      getLocation("normal.wsdl"),
+                                      "org.apache.hello_world_soap_http.Greeter"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+    }
+
+    @Test
+    public void testBadUsage() {
+        String[] args = new String[] {"-ttt", "a.ww"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+
+    }
+
+    @Test
+    public void testValidArgs() {
+        String[] args = new String[] {"a.ww"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+
+    }
+
+    @Test
+    public void testNoOutPutFile() throws Exception {
+        String[] args = new String[] {"-o",
+                                      getLocation("nooutput.wsdl"),
+                                      "org.apache.hello_world_soap_http.Greeter"};
+        JavaToWS.main(args);
+        assertNotNull(getStdOut());
+    }
+
+    @Test
+    public void testNoArg() {
+        String[] args = new String[] {};
+        JavaToWS.main(args);
+        assertEquals(-1, getStdOut().indexOf("Caused by:"));
+    }
+}

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java?rev=572893&r1=572581&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
Wed Sep  5 00:27:20 2007
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.tools.java2wsdl.generator;
 
+import org.apache.cxf.tools.java2wsdl.generator.AbstractGenerator;
+import org.apache.cxf.tools.java2wsdl.generator.WSDLGeneratorFactory;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator;
 import org.apache.cxf.wsdl.WSDLConstants;
 import org.junit.Assert;

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGeneratorTest.java?rev=572893&r1=572581&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGeneratorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGeneratorTest.java
Wed Sep  5 00:27:20 2007
@@ -29,14 +29,14 @@
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.fortest.date.EchoCalendar;
 import org.apache.cxf.tools.fortest.date.EchoDate;
-import org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor;
+import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class DateTypeCustomGeneratorTest extends ProcessorTestBase {
     DateTypeCustomGenerator gen = new DateTypeCustomGenerator();
-    JavaToProcessor processor = new JavaToProcessor();
+    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
 
     @Before
     public void setUp() throws Exception {

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java?rev=572893&r1=572581&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
Wed Sep  5 00:27:20 2007
@@ -27,13 +27,14 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
-import org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor;
+import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class FaultBeanGeneratorTest extends ProcessorTestBase {
-    JavaToProcessor processor = new JavaToProcessor();
+    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
+    
     String classPath = "";
     @Before
     public void setUp() throws Exception {

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java?rev=572893&r1=572581&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
Wed Sep  5 00:27:20 2007
@@ -26,13 +26,13 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
-import org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor;
+import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class WrapperBeanGeneratorTest extends ProcessorTestBase {
-    JavaToProcessor processor = new JavaToProcessor();
+    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
     String classPath = "";
 
     @Before

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=572893&r1=572581&r2=572893&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Wed Sep  5 00:27:20 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.tools.java2wsdl.processor;
 
 import java.io.File;
+
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
@@ -29,7 +30,7 @@
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
-import org.apache.cxf.tools.java2wsdl.JavaToWSDL;
+import org.apache.cxf.tools.java2ws.JavaToWS;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
 import org.apache.cxf.tools.wsdlto.core.PluginLoader;
@@ -40,12 +41,13 @@
 import org.junit.Test;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
-    JavaToProcessor processor = new JavaToProcessor();
+    JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
     String classPath = "";
     private WSDLHelper wsdlHelper = new WSDLHelper();
     @Before
     public void startUp() throws Exception {
         env = new ToolContext();
+        env.put(ToolConstants.CFG_WSDL, ToolConstants.CFG_WSDL);
         classPath = System.getProperty("java.class.path");
         System.setProperty("java.class.path", getClassPath());
     }
@@ -160,8 +162,9 @@
                                       "-soap12",
                                       "-d",
                                       output.getPath(),
+                                      "-wsdl",
                                       "org.apache.cxf.classpath.Greeter"};
-        JavaToWSDL.main(args);
+        JavaToWS.main(args);
         File wsdlFile = new File(output, "java2wsdl.wsdl");
         assertTrue("Generate Wsdl Fail", wsdlFile.exists());
         Definition def = wsdlHelper.getDefinition(wsdlFile);
@@ -214,6 +217,7 @@
                 "org.apache.cxf.tools.fortest.classnoanno.docwrapped.Calculator");
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/my_calculator.wsdl");
 
+        env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN);
         processor.setEnvironment(env);
         processor.process();
 
@@ -245,6 +249,7 @@
                 "org.apache.cxf.tools.fortest.classnoanno.docwrapped.Calculator");
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/my_stock.wsdl");
         env.put(ToolConstants.CFG_SOURCEDIR, output.getPath() + "/beans");
+        env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN);
 
         processor.setEnvironment(env);
         processor.process();
@@ -274,6 +279,7 @@
     public void testHelloNoPackage() throws Exception {
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/hello-no-package.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "HelloNoPackage");
+        env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN);
         processor.setEnvironment(env);
         processor.process();
 
@@ -402,7 +408,7 @@
         env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
         try {
             processor.setEnvironment(env);
-            processor.process();
+            processor.process();                  
         } catch (Exception e) {
             e.printStackTrace();
         }



Mime
View raw message