cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r504085 [2/2] - in /incubator/cxf/trunk: rt/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools2/ tools2/common/src/main/java/org/apache/cxf/tools/common/ tools2/common/src/test/java/org/apache/cxf/tools/common/ tools2/j...
Date Tue, 06 Feb 2007 11:26:17 GMT
Added: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,31 @@
+/**
+ * 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.processor.internal.simple;
+
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilder;
+
+public class SimpleServiceBuilder extends ServiceBuilder {
+    
+    public SimpleServiceBuilder() {
+        super();
+        setServiceFactory(new ReflectionServiceFactoryBean());
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleServiceBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,25 @@
+/**
+ * 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.simple;
+
+public interface Hello {
+    String sayHello();
+    void ping();
+    String echo(String text);    
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/simple/Hello.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,33 @@
+/**
+ * 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.withannotation.doc;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
+@WebService(name = "Hello", targetNamespace = "http://cxf.com/", wsdlLocation = "file:///c:/tmp.wsdl")
+public class Hello {
+    @WebMethod(operationName = "sayHi", exclude = false)
+    String sayHi() {
+        return "hi";
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/Hello.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,35 @@
+/**
+ * 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.generator;
+
+import junit.framework.TestCase;
+import org.apache.cxf.tools.common.ToolConstants;
+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);
+        AbstractGenerator generator = factory.newGenerator();
+        assertNotNull(generator);
+        assertTrue(generator instanceof WSDL11Generator);
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,45 @@
+/**
+ * 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.processor;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.tools.fortest.classnoanno.docbare.Stock;
+import org.apache.cxf.tools.fortest.simple.Hello;
+
+public class FrontendFactoryTest extends TestCase {
+
+    FrontendFactory factory = FrontendFactory.getInstance();
+    
+    public void testDefaultStyle() {
+        factory.setServiceClass(null);
+        assertEquals(FrontendFactory.Style.Jaxws, factory.discoverStyle());
+    }
+
+    public void testJaxwsStyle() {
+        factory.setServiceClass(Stock.class);
+        assertEquals(FrontendFactory.Style.Jaxws, factory.discoverStyle());
+    }
+
+    public void testSimpleStyle() {
+        factory.setServiceClass(Hello.class);
+        assertEquals(FrontendFactory.Style.Simple, factory.discoverStyle());
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/FrontendFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,61 @@
+/**
+ * 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.processor;
+
+import java.io.*;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Service;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.helpers.WSDLHelper;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+
+public class JavaToProcessorTest extends ProcessorTestBase {
+    JavaToProcessor processor = new JavaToProcessor();
+    private WSDLHelper wsdlHelper = new WSDLHelper();
+    
+    public void tearDown() {
+    }
+    
+    public void testGetWSDLVersion() {
+        processor.setEnvironment(new ToolContext());
+        assertEquals(ToolConstants.WSDLVersion.WSDL11, processor.getWSDLVersion());
+    }
+
+    public void testSimpleClass() throws Exception {
+        ToolContext context = new ToolContext();
+        context.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/doc_wrapped_bare.wsdl");
+        context.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.simple.Hello");
+        //context.put(ToolConstants.CFG_TNS, tns);
+        //context.put(ToolConstants.CFG_SERVICENAME, serviceName);
+        processor.setEnvironment(context);
+        processor.process();
+
+        File wsdlFile = new File(output, "doc_wrapped_bare.wsdl");
+        assertTrue("Fail to generate wsdl file", wsdlFile.exists());
+
+        String tns = "http://simple.fortest.tools.cxf.apache.org";
+        Definition def = wsdlHelper.getDefinition(wsdlFile);
+        Service wsdlService = def.getService(new QName(tns, "Hello"));
+        assertNotNull("Generate WSDL Service Error", wsdlService);
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java
(from r503552, incubator/cxf/trunk/tools/java2wsdl/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=504085&p1=incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java&r1=503552&p2=incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessorTest.java&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/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
Tue Feb  6 03:26:13 2007
@@ -19,7 +19,7 @@
 
 package org.apache.cxf.tools.java2wsdl.processor;
 
-import java.io.File;
+import java.io.*;
 import java.util.Iterator;
 
 import javax.wsdl.Binding;
@@ -37,27 +37,31 @@
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.common.extensions.soap.SoapBinding;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
-import org.apache.cxf.tools.wsdl2java.processor.WSDLToJavaProcessor;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
 
 public class JavaToWSDLProcessorTest extends ProcessorTestBase {
 
     private JavaToWSDLProcessor j2wProcessor;
-    private WSDLToJavaProcessor wj2Processor;
+    private JAXWSContainer wj2Processor;
     private String tns = "org.apache.asyn_lit";
     private String serviceName = "cxfService";
     private WSDLHelper wsdlHelper = new WSDLHelper();
     private File classFile;
-
+    private String toolspecFile = "/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml";
+    private InputStream ins = getClass().getResourceAsStream(toolspecFile);
+    private ToolSpec toolspec = new ToolSpec(ins, true);
+    
     public void setUp() throws Exception {
 
         super.setUp();
-        wj2Processor = new WSDLToJavaProcessor();
         j2wProcessor = new JavaToWSDLProcessor();
         classFile = new java.io.File(output.getCanonicalPath() + "/classes");
         classFile.mkdir();
         System.setProperty("java.class.path", getClassPath() + classFile.getCanonicalPath()
                                               + File.separatorChar);
+        wj2Processor = new JAXWSContainer(toolspec);
     }
 
     public void tearDown() {
@@ -72,8 +76,8 @@
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/java2wsdl_wsdl/hello_world_async.wsdl"));
-        wj2Processor.setEnvironment(env);
-        wj2Processor.process();
+        wj2Processor.setContext(env);
+        wj2Processor.execute();
 
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/asyn.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "org.apache.hello_world_async_soap_http.GreeterAsync");
@@ -99,8 +103,8 @@
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/java2wsdl_wsdl/hello_world_doc_wrapped_bare.wsdl"));
-        wj2Processor.setEnvironment(env);
-        wj2Processor.process();
+        wj2Processor.setContext(env);
+        wj2Processor.execute();
 
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/doc_wrapped_bare.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "org.apache.hello_world_doc_wrapped_bare.Greeter");
@@ -126,8 +130,8 @@
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/java2wsdl_wsdl/hello_world_doc_lit.wsdl"));
-        wj2Processor.setEnvironment(env);
-        wj2Processor.process();
+        wj2Processor.setContext(env);
+        wj2Processor.execute();
 
         System.setProperty("java.class.path", "");
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/doc_lit.wsdl");
@@ -154,8 +158,8 @@
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/java2wsdl_wsdl/hello_world_rpc_lit.wsdl"));
-        wj2Processor.setEnvironment(env);
-        wj2Processor.process();
+        wj2Processor.setContext(env);
+        wj2Processor.execute();
 
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/rpc_lit.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "org.apache.hello_world_rpclit.GreeterRPCLit");
@@ -206,8 +210,8 @@
         env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
         env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/java2wsdl_wsdl/hello_world_soap12.wsdl"));
-        wj2Processor.setEnvironment(env);
-        wj2Processor.process();
+        wj2Processor.setContext(env);
+        wj2Processor.execute();
 
         env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/soap12.wsdl");
         env.put(ToolConstants.CFG_CLASSNAME, "org.apache.hello_world_soap12_http.Greeter");

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,55 @@
+/**
+ * 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.processor.internal;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.tools.fortest.classnoanno.docbare.Stock;
+import org.apache.cxf.tools.fortest.simple.Hello;
+import org.apache.cxf.tools.java2wsdl.processor.FrontendFactory;
+import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.JaxwsServiceBuilder;
+import org.apache.cxf.tools.java2wsdl.processor.internal.simple.SimpleServiceBuilder;
+
+public class ServiceBuilderFactoryTest extends TestCase {
+    ServiceBuilderFactory factory = ServiceBuilderFactory.getInstance();
+    
+    public void testGetBuilderClassName() {
+        assertNotNull(factory);
+        assertEquals(JaxwsServiceBuilder.class.getName(),
+                     factory.getBuilderClassName(FrontendFactory.Style.Jaxws));
+
+        assertEquals(SimpleServiceBuilder.class.getName(),
+                     factory.getBuilderClassName(FrontendFactory.Style.Simple));
+    }
+
+    public void testGetJaxwsBuilder() {
+        factory.setServiceClass(Stock.class);
+        ServiceBuilder builder = factory.newBuilder();
+        assertNotNull(builder);
+        assertTrue(builder instanceof JaxwsServiceBuilder);
+    }
+
+    public void testGetSimpleBuilder() {
+        factory.setServiceClass(Hello.class);
+        ServiceBuilder builder = factory.newBuilder();
+        assertNotNull(builder);
+        assertTrue(builder instanceof SimpleServiceBuilder);
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,40 @@
+/**
+ * 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.processor.internal.jaxws;
+
+import java.io.File;
+import junit.framework.TestCase;
+import org.apache.cxf.tools.fortest.classnoanno.docbare.Stock;
+import org.apache.cxf.tools.fortest.withannotation.doc.Hello;
+
+public class JaxwsServiceBuilderTest extends TestCase {
+
+    public void testGetOutputFile() {
+        JaxwsServiceBuilder builder = new JaxwsServiceBuilder();
+        builder.setServiceClass(Stock.class);
+        assertNull(builder.getOutputFile());
+
+        builder.setServiceClass(Hello.class);
+        assertNotNull(builder.getOutputFile());
+        File expected = new File("file:///c:/tmp.wsdl");
+        assertTrue(expected.equals(builder.getOutputFile()));
+    }
+    
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java?view=auto&rev=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
(added)
+++ incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
Tue Feb  6 03:26:13 2007
@@ -0,0 +1,64 @@
+/**
+ * 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.processor.internal.jaxws;
+
+import java.lang.reflect.Method;
+import junit.framework.TestCase;
+
+public class WrapperUtilTest extends TestCase {
+    String pkgName = "org.apache.cxf.tools.fortest.classnoanno.docwrapped";
+    Class stockClass;
+    Method method;
+    
+    public void setUp() throws Exception {
+        stockClass = Class.forName(pkgName + ".Stock");
+        assertNotNull(stockClass);
+        method = stockClass.getMethod("getPrice", String.class);
+        assertNotNull(method);
+    }
+
+    public void testGetRequestWrapper() {
+        Wrapper wrapper = WrapperUtil.getRequestWrapper(method);
+        assertNotNull(wrapper);
+        assertEquals(pkgName + ".jaxws.GetPrice", wrapper.className);
+        assertEquals("getPrice", wrapper.localName);
+        assertNull(wrapper.targetNamespace);
+    }
+
+    public void testGetResponseWrapper() {
+        Wrapper wrapper = WrapperUtil.getResponseWrapper(method);
+        assertNotNull(wrapper);
+        assertEquals(pkgName + ".jaxws.GetPriceResponse", wrapper.className);
+        assertEquals("getPriceResponse", wrapper.localName);
+        assertNull(wrapper.targetNamespace);
+    }
+
+    public void testIsWrapperClassExists() {
+        assertTrue(WrapperUtil.isWrapperClassExists(method));
+    }
+
+    public void testWrapperClassNotExists() throws Exception {
+        Class helloClass = Class.forName("org.apache.cxf.tools.fortest.withannotation.doc.HelloWrapped");
+        assertNotNull(helloClass);
+        Method helloMethod = helloClass.getMethod("sayHi");
+        assertNotNull(helloMethod);
+        assertFalse(WrapperUtil.isWrapperClassExists(helloMethod));
+    }
+}

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/WrapperUtilTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools2/javato/src/test/resources/java2wsdl_wsdl/hello_world_soap12.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/test/resources/java2wsdl_wsdl/hello_world_soap12.wsdl?view=diff&rev=504085&r1=503552&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/test/resources/java2wsdl_wsdl/hello_world_soap12.wsdl
(original)
+++ incubator/cxf/trunk/tools2/javato/src/test/resources/java2wsdl_wsdl/hello_world_soap12.wsdl
Tue Feb  6 03:26:13 2007
@@ -112,5 +112,9 @@
         </operation>
     </wsdl:binding>
 
-
+    <wsdl:service name="SOAPService">
+        <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+            <soap12:address location="http://localhost:9012/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
 </definitions>

Modified: incubator/cxf/trunk/tools2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/pom.xml?view=diff&rev=504085&r1=504084&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/pom.xml (original)
+++ incubator/cxf/trunk/tools2/pom.xml Tue Feb  6 03:26:13 2007
@@ -39,5 +39,6 @@
 	<module>common</module>
 	<module>validator</module>
 	<module>wsdlto</module>
+	<module>javato</module>
     </modules>
 </project>

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=504085&r1=504084&r2=504085
==============================================================================
--- 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
Tue Feb  6 03:26:13 2007
@@ -48,6 +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.toolspec.ToolSpec;
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml?view=diff&rev=504085&r1=504084&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml Tue Feb  6 03:26:13 2007
@@ -52,11 +52,11 @@
 	    <artifactId>cxf-rt-core</artifactId>
 	    <version>${project.version}</version>
 	    <exclusions>
-	    	            <exclusion>
-	    	              <groupId>org.apache.cxf</groupId>
-	    	              <artifactId>cxf-testutils</artifactId>
-	    	            </exclusion>
-	      </exclusions>
+		<exclusion>
+		    <groupId>org.apache.cxf</groupId>
+		    <artifactId>cxf-testutils</artifactId>
+		</exclusion>
+	    </exclusions>
 	</dependency>
 
 	<dependency>

Modified: incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?view=diff&rev=504085&r1=504084&r2=504085
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Tue Feb  6 03:26:13 2007
@@ -624,6 +624,7 @@
         assertNotNull("method should be generated", method);
     }
 
+    @SuppressWarnings("unchecked")
     public void testSupportXMLBindingBare() throws Exception {
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/xml_http_bare.wsdl"));
         processor.setContext(env);



Mime
View raw message