summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest/ws/external-service
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-10-06 13:54:26 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-10-06 13:54:26 +0000
commit26c7d87982e6eb53ff3f5b394b06af135395824b (patch)
treec7d5d5ca95633ca693838e4569453e9e26f7982c /sca-java-2.x/trunk/testing/itest/ws/external-service
parent3c39df7ce9d8d2db2abcf67b2c5797a2bad5bb30 (diff)
Copy itest and compliance test to be under testing folder
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1005039 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/ws/external-service')
-rw-r--r--sca-java-2.x/trunk/testing/itest/ws/external-service/pom.xml104
-rw-r--r--sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java152
-rw-r--r--sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java88
-rw-r--r--sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java64
-rw-r--r--sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java49
5 files changed, 457 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/ws/external-service/pom.xml b/sca-java-2.x/trunk/testing/itest/ws/external-service/pom.xml
new file mode 100644
index 0000000000..f789844419
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/ws/external-service/pom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-ws-external-service</artifactId>
+ <name>Apache Tuscany SCA iTest WS External Service</name>
+
+ <dependencies>
+
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/jaxws-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>1.12</version>
+ <!-- Explicitly add the transitive dependencies for jaxws-api
+ http://jira.codehaus.org/browse/MEV-498
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>1.0-MR1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>wsgen1</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>wsgen</goal>
+ </goals>
+ <configuration>
+ <sei>org.apache.tuscany.sca.binding.ws.jaxws.external.service.HelloWorldService</sei>
+ <genWsdl>true</genWsdl>
+ <staleFile>${project.build.directory}/jaxws/stale/.wsgen1StaleFlag</staleFile>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <target>2.1</target>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <resourceDestDir>${project.build.directory}/jaxws-source</resourceDestDir>
+ <verbose>true</verbose>
+ <xnocompile>true</xnocompile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java
new file mode 100644
index 0000000000..1f330aa441
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java
@@ -0,0 +1,152 @@
+/*
+ * 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.tuscany.sca.binding.ws.jaxws.external.service;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for bar complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="bar">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="b" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ * &lt;element name="s" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="x" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * &lt;element name="y" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "bar", propOrder = {
+ "b",
+ "s",
+ "x",
+ "y"
+})
+public class Bar {
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ /**
+ * Gets the value of the b property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isB() {
+ return b;
+ }
+
+ /**
+ * Sets the value of the b property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setB(Boolean value) {
+ this.b = value;
+ }
+
+ /**
+ * Gets the value of the s property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getS() {
+ return s;
+ }
+
+ /**
+ * Sets the value of the s property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setS(String value) {
+ this.s = value;
+ }
+
+ /**
+ * Gets the value of the x property.
+ *
+ */
+ public int getX() {
+ return x;
+ }
+
+ /**
+ * Sets the value of the x property.
+ *
+ */
+ public void setX(int value) {
+ this.x = value;
+ }
+
+ /**
+ * Gets the value of the y property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getY() {
+ return y;
+ }
+
+ /**
+ * Sets the value of the y property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setY(Integer value) {
+ this.y = value;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java
new file mode 100644
index 0000000000..1b22153169
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java
@@ -0,0 +1,88 @@
+/*
+ * 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.tuscany.sca.binding.ws.jaxws.external.service;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for foo complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="foo">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="bars" type="{http://ws.binding.sca.tuscany.apache.org/}bar" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "foo", propOrder = {
+ "bars"
+})
+public class Foo {
+
+ @XmlElement(nillable = true)
+ protected List<Bar> bars;
+
+ /**
+ * Gets the value of the bars property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the bars property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getBars().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Bar }
+ *
+ *
+ */
+ public List<Bar> getBars() {
+ if (bars == null) {
+ bars = new ArrayList<Bar>();
+ }
+ return this.bars;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
new file mode 100644
index 0000000000..129365b5e4
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
@@ -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.tuscany.sca.binding.ws.jaxws.external.service;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+@WebService(name = "HelloWorldService", targetNamespace = "http://helloworld/external")
+public class HelloWorldService {
+
+ @WebMethod
+ @WebResult(name = "getGreetingsReturn", targetNamespace = "http://helloworld/external")
+ @RequestWrapper(localName = "getGreetings", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetings")
+ @ResponseWrapper(localName = "getGreetingsResponse", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetingsResponse")
+ public String getGreetings( @WebParam(name = "name", targetNamespace = "http://helloworld/external")
+ String name) {
+ System.out.println("Entering External Service HelloWorld.getGreetings: " + name);
+ String response = "Hello " + name;
+ System.out.println("Leaving External Service HelloWorld.getGreetings: " + response);
+ return response;
+ }
+
+ public Foo getGreetingsComplex(Foo foo){
+ System.out.println("Entering External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ Foo response = foo;
+ Bar b3 = new Bar();
+ b3.setS("simon");
+ b3.setX(7);
+ b3.setY(new Integer(8));
+ b3.setB(Boolean.TRUE);
+ response.getBars().add(b3);
+ System.out.println("Leaving External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ return response;
+ }
+
+ public String GetGreetingsCaps(String name) {
+ System.out.println("Entering External Service HelloWorld.GetGreetingsCaps: " + name);
+ String response = "Hello " + name;
+ System.out.println("Leaving External Service HelloWorld.GetGreetingsCaps: " + response);
+ return response;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
new file mode 100644
index 0000000000..3a6266f1ef
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
@@ -0,0 +1,49 @@
+/*
+ * 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.tuscany.sca.binding.ws.jaxws.external.service;
+
+import javax.xml.ws.Endpoint;
+
+public class HelloWorldServiceLauncher {
+
+ public Endpoint endpoint;
+
+ public HelloWorldServiceLauncher(){
+
+ }
+
+ public void createService(){
+ System.out.println(">>> Starting external JAXWS service at http://localhost:8086/External/HelloWorld");
+
+ // default JVM JAXWS support.
+ endpoint= Endpoint.publish("http://localhost:8086/External/HelloWorld",
+ new HelloWorldService());
+ }
+
+ public void destoryService(){
+ System.out.println(">>> Stopping external JAXWS service at http://localhost:8086/External/HelloWorld");
+ endpoint.stop();
+ }
+
+ public static void main(String[] args) throws Exception {
+ HelloWorldServiceLauncher launcher = new HelloWorldServiceLauncher();
+ launcher.createService();
+ }
+}