Author: ema
Date: Wed Sep 12 01:20:41 2007
New Revision: 574835

URL: http://svn.apache.org/viewvc?rev=574835&view=rev
Log:
Added default output dir for java2ws
Added class for test

Added:
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloBase.java
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloRMI.java
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloReq.java
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloWithNoAnno.java
Modified:
    incubator/cxf/trunk/tools/javato/ws/pom.xml
    
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
    
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java
    
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.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=574835&r1=574834&r2=574835&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/pom.xml (original)
+++ incubator/cxf/trunk/tools/javato/ws/pom.xml Wed Sep 12 01:20:41 2007
@@ -73,6 +73,11 @@
              <artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
              <version>${project.version}</version>
         </dependency>
+        
+         <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+        </dependency>       
 
 
         <dependency>

Modified: 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java?rev=574835&r1=574834&r2=574835&view=diff
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
 (original)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
 Wed Sep 12 01:20:41 2007
@@ -54,6 +54,9 @@
             if (!hasInfoOption()) {
                 ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(new HashSet()));
+                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
+                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
+                }
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }

Modified: 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml?rev=574835&r1=574834&r2=574835&view=diff
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
 (original)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
 Wed Sep 12 01:20:41 2007
@@ -26,50 +26,53 @@
        xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification";>
 
        <annotation>
-               Examples :
-
-               java2ws org.apache.hello_world_soap_http.Greeter java2ws -cp
-               ./tmp org.apache.hello_world_soap_http.Greeter java2ws -o
-               hello.wsdl org.apache.hello_world_soap_http.Greeter java2ws -o
-               hello.wsdl -t http://cxf.apache.org
-               org.apache.hello_world_soap_http.Greeter
+ Examples :
+   java2ws -wsdl org.apache.hello_world_soap_http.Greeter 
+   java2ws -cp ./tmp org.apache.hello_world_soap_http.Greeter -wsdl 
+   java2ws -o hello.wsdl -wsdl org.apache.hello_world_soap_http.Greeter 
+   java2ws -client -server org.apache.hello_world_soap_http.Greeter
+   java2ws -wrapperbean org.apache.hello_world_soap_http.Greeter
        </annotation>
        <usage>
-
                <optionGroup id="options">
                        <option id="frontend" maxOccurs="1">
-                               <annotation>specify which frontend should be 
use, support jaxws and simple frontend.</annotation>
+                               <annotation>
+                                       specify which frontend should be use, 
support jaxws and simple frontend.
+                               </annotation>
                                <switch>frontend</switch>
                                <associatedArgument placement="afterSpace">
                                        <annotation>jaxws-or-simple</annotation>
                                </associatedArgument>
                        </option>
+
+                       <option id="wsdl" maxOccurs="1">
+                               <annotation>
+                                       Specify generating wsdl
+                               </annotation>
+                               <switch>wsdl</switch>
+                       </option>
                        
                        <option id="wrapperbean" maxOccurs="1">
-                               <annotation>Specify to genearte wrapper and 
fault bean</annotation>
+                               <annotation>
+                                       Specify to genearte wrapper and fault 
bean
+                               </annotation>
                                <switch>wrapperbean</switch>
                        </option>
                        
                        <option id="client" maxOccurs="1">
-                               <annotation>Specify to genearte client side 
code</annotation>
+                               <annotation>
+                                       Specify to genearte client side code
+                               </annotation>
                                <switch>client</switch>
                        </option>
                                
                        <option id="server" maxOccurs="1">
-                               <annotation>Specify to genearte server side 
code</annotation>
+                               <annotation>
+                                       Specify to genearte server side code
+                               </annotation>
                                <switch>server</switch>
                        </option>
-                       
-                       <option id="impl" maxOccurs="1">
-                               <annotation>Specify to generate impl class when 
"-server" flag is specified</annotation>
-                               <switch>impl</switch>
-                       </option>                       
-                                               
-                       <option id="wsdl" maxOccurs="1">
-                               <annotation>Specify generating wsdl</annotation>
-                               <switch>wsdl</switch>
-                       </option>
-
+                                                               
                        <option id="outputfile" maxOccurs="1">
                                <annotation>
                                        Specify the output wsdl file name
@@ -189,22 +192,26 @@
                        </option>
 
                        <option id="verbose">
-                               <annotation>Verbose mode</annotation>
+                               <annotation>
+                                       Verbose mode
+                               </annotation>
                                <switch>verbose</switch>
                                <switch>V</switch>
                        </option>
 
                        <option id="quiet">
-                               <annotation>Quiet mode</annotation>
+                               <annotation>
+                                       Quiet mode
+                               </annotation>
                                <switch>quiet</switch>
                                <switch>q</switch>
                        </option>
-
-
                </optionGroup>
 
-               <argument id="classname" minOccurs="1" maxOccurs="1">
-                       <annotation>SEI class name</annotation>
-               </argument>
+                  <argument id="classname" minOccurs="1" maxOccurs="1">
+                          <annotation>
+                               SEI class name
+                          </annotation>
+                  </argument>
        </usage>
 </toolspec>

Modified: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java?rev=574835&r1=574834&r2=574835&view=diff
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java
 (original)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java
 Wed Sep 12 01:20:41 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.tools.fortest;
 
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
 public interface Hello {
     String sayHi(String arg);
 }

Added: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloBase.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloBase.java?rev=574835&view=auto
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloBase.java
 (added)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloBase.java
 Wed Sep 12 01:20:41 2007
@@ -0,0 +1,24 @@
+/**
+ * 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.fortest;
+
+public class HelloBase implements java.rmi.Remote {
+
+}

Added: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloRMI.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloRMI.java?rev=574835&view=auto
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloRMI.java
 (added)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloRMI.java
 Wed Sep 12 01:20:41 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.fortest;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
+public class HelloRMI {
+    public String echo(HelloReq arg) {
+        return "";
+    }
+}

Added: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloReq.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloReq.java?rev=574835&view=auto
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloReq.java
 (added)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloReq.java
 Wed Sep 12 01:20:41 2007
@@ -0,0 +1,27 @@
+/**
+ * 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.fortest;
+
+/**
+ * 
+ */
+public class HelloReq extends HelloBase {
+
+}

Added: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloWithNoAnno.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloWithNoAnno.java?rev=574835&view=auto
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloWithNoAnno.java
 (added)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloWithNoAnno.java
 Wed Sep 12 01:20:41 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.fortest;
+
+public interface HelloWithNoAnno {
+    String sayHi(String arg);
+}

Modified: 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=574835&r1=574834&r2=574835&view=diff
==============================================================================
--- 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
 (original)
+++ 
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
 Wed Sep 12 01:20:41 2007
@@ -67,7 +67,7 @@
         File wsdlFile = new File(output.getPath() + "/tmp.wsdl");
         assertTrue("wsdl is not generated", wsdlFile.exists());
     }
-    
+
     @Test
     public void testSimple() throws Exception {
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + 
"/tmp.wsdl", "-verbose",
@@ -79,23 +79,22 @@
         File wsdlFile = new File(output.getPath() + "/tmp.wsdl");
         assertTrue("wsdl is not generated", wsdlFile.exists());
     }
-    
-    //org.apache.cxf.tools.fortest
-    
+
+
     @Test
     public void testClassNoWebServiceAnno() throws Exception {
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + 
"/tmp.wsdl", "-verbose",
                                       "-d", output.getPath(),
                                       "-frontend", "jaxws",
                                       "-client", "-server",
-                                      "org.apache.cxf.tools.fortest.Hello"};
+                                      
"org.apache.cxf.tools.fortest.HelloWithNoAnno"};
         JavaToWS.main(args);
         File wsdlFile = new File(output.getPath() + "/tmp.wsdl");
         assertTrue("wsdl is not generated", wsdlFile.exists());
         assertTrue("Class does not carry WebService error should be detected"
                    , getStdErr().indexOf("does not carry a WebService 
annotation") > -1);
     }
-    
+
     @Test
     public void testClassWithRMI() throws Exception {
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + 
"/tmp.wsdl", "-verbose",
@@ -106,12 +105,10 @@
         JavaToWS.main(args);
         File wsdlFile = new File(output.getPath() + "/tmp.wsdl");
         assertTrue("wsdl is not generated", wsdlFile.exists());
-        assertTrue("Parameter or return type implemented java.rmi.Remote 
interface error should be detected", 
+        assertTrue("Parameter or return type implemented java.rmi.Remote 
interface error should be detected",
                    getStdErr().indexOf("implemented the java.rmi.Remote 
interface") > -1);
     }
-    
-    
-    
+
     @Test
     public void testGenServerAndClient() throws Exception {
         String[] args = new String[] {"-d", output.getPath(), "-client", 
"-server",
@@ -126,35 +123,35 @@
                                + 
"/org/apache/hello_world_soap12_http/GreeterServer.java");
         assertTrue("Greeter_GreeterPort_Server.java is not generated", 
server.exists());
     }
-    
-    
-    
+
+
+
     @Test
     public void testGenServerAndImpl() throws Exception {
-        String[] args = new String[] {"-d", output.getPath(), "-impl", 
"-server",
+        String[] args = new String[] {"-d", output.getPath(), "-server",
                                       
"org.apache.hello_world_soap12_http.Greeter"};
         JavaToWS.main(args);
 
         File server = new File(output.getPath()
                                + 
"/org/apache/hello_world_soap12_http/GreeterServer.java");
         assertTrue("GreeterServer.java is not generated", server.exists());
-        
-        
+
+
         File impl = new File(output.getPath()
                                + 
"/org/apache/hello_world_soap12_http/GreeterImpl.java");
         assertTrue("GreeterImpl.java is not generated", impl.exists());
     }
-    
+
     @Test
     public void testGenWrapperBean() throws Exception {
         String[] args = new String[] {"-d", output.getPath(),
                                       "-wrapperbean",
                                       "-impl", "-server",
                                       
"org.apache.cxf.tools.java2ws.fortest.Calculator"};
-        JavaToWS.main(args);        
+        JavaToWS.main(args);
     }
-    
-    
+
+
     @Test
     public void testInvalidFlag() throws Exception {
         String[] args = new String[] {"-frontend", "tmp", "-wsdl", "-o", 
output.getPath() + "/tmp.wsdl",


Reply via email to