cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1493644 - in /cxf/trunk/systests/jaxws/src/test: java/org/apache/cxf/systest/jaxws/ java/org/apache/cxf/systest/jaxws/base/ resources/org/apache/cxf/systest/jaxws/
Date Mon, 17 Jun 2013 05:20:32 GMT
Author: ffang
Date: Mon Jun 17 05:20:32 2013
New Revision: 1493644

URL: http://svn.apache.org/r1493644
Log:
[CXF-5061]a testcase to demonstrate that valid WSDL could get generated for List of Complex
Type

Added:
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestService.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestServiceImpl.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/WrapperString.java
    cxf/trunk/systests/jaxws/src/test/resources/org/apache/cxf/systest/jaxws/springWebService.xml

Added: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java?rev=1493644&view=auto
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java (added)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java Mon
Jun 17 05:20:32 2013
@@ -0,0 +1,69 @@
+/**
+ * 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.systest.jaxws;
+
+
+
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.testutil.common.TestUtil;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class CXF5061Test extends AbstractBusClientServerTestBase {
+
+    public static final String ADDRESS 
+        = "http://localhost:" + TestUtil.getPortNumber("org.apache.cxf.systest.jaxws.CXF5061Test")
+            + "/cxf5061";
+    
+    public static class Server extends AbstractBusTestServerBase {
+
+        protected void run() {
+            new SpringBusFactory().createBus("org/apache/cxf/systest/jaxws/springWebService.xml");
+        }
+
+        public static void main(String[] args) {
+            try {
+                Server s = new Server();
+                s.start();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                System.exit(-1);
+            } finally {
+                System.out.println("done!");
+            }
+        }
+    }
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", launchServer(Server.class, true));
+    }
+    
+    @Test
+    public void testCxf5061() throws Exception {
+        //using dcf to generate client from the wsdl which ensure the wsdl is valid
+        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
+        dcf.createClient(ADDRESS + "?wsdl");
+    }
+
+}

Added: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestService.java?rev=1493644&view=auto
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestService.java (added)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestService.java Mon
Jun 17 05:20:32 2013
@@ -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.systest.jaxws;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.cxf.systest.jaxws.base.WrapperString;
+
+@WebService(name = "TestService", portName = "TestServicePort", 
+    serviceName = "TestService", targetNamespace = "http://cxf.apache.org/systest/jaxws")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface TestService {
+    @WebMethod(operationName = "getList")
+    List<WrapperString> getList();
+}

Added: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestServiceImpl.java?rev=1493644&view=auto
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestServiceImpl.java
(added)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/TestServiceImpl.java
Mon Jun 17 05:20:32 2013
@@ -0,0 +1,36 @@
+/**
+ * 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.systest.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.systest.jaxws.base.WrapperString;
+
+public class TestServiceImpl implements TestService {
+    @Override
+    public List<WrapperString> getList() {
+        List<WrapperString> list = new ArrayList<WrapperString>();
+
+        list.add(new WrapperString("Test"));
+        list.add(new WrapperString("Test 2"));
+
+        return list;
+    }
+}

Added: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/WrapperString.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/WrapperString.java?rev=1493644&view=auto
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/WrapperString.java
(added)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/base/WrapperString.java
Mon Jun 17 05:20:32 2013
@@ -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.systest.jaxws.base;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Wrapper class for Strings. This is necessary when sending/receiving Strings in Web Services.
+ * 
+ * @author joshua.shannon
+ */
+@XmlRootElement
+@XmlType(name = "WrapperString")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class WrapperString {
+    private String value;
+
+    public WrapperString() {
+        super();
+    }
+
+    public WrapperString(String value) {
+        this();
+        this.value = value;
+    }
+
+    @Override
+    public String toString() {
+        return value;
+    }
+
+    // ////////////////////////////////////////////
+    //
+    // Getters & Setters
+    //
+    // ////////////////////////////////////////////
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

Added: cxf/trunk/systests/jaxws/src/test/resources/org/apache/cxf/systest/jaxws/springWebService.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/resources/org/apache/cxf/systest/jaxws/springWebService.xml?rev=1493644&view=auto
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/resources/org/apache/cxf/systest/jaxws/springWebService.xml
(added)
+++ cxf/trunk/systests/jaxws/src/test/resources/org/apache/cxf/systest/jaxws/springWebService.xml
Mon Jun 17 05:20:32 2013
@@ -0,0 +1,37 @@
+<!--
+  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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xmlns:cxf="http://cxf.apache.org/core"
+	xsi:schemaLocation="
+		http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+		http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+        <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+	
+	<jaxws:server address="http://localhost:${testutil.ports.org.apache.cxf.systest.jaxws.CXF5061Test}/cxf5061"
+		serviceClass="org.apache.cxf.systest.jaxws.TestService">
+		<jaxws:serviceBean>
+			<bean class="org.apache.cxf.systest.jaxws.TestServiceImpl" />
+		</jaxws:serviceBean>
+	</jaxws:server>
+
+</beans>



Mime
View raw message