From b08924d760b10b6095e40634d51d5c40b1923740 Mon Sep 17 00:00:00 2001 From: nash Date: Fri, 11 Sep 2009 12:07:43 +0000 Subject: Add itest/jaxws for TUSCANY-3267 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@813789 13f79535-47bb-0310-9956-ffa450edef68 --- branches/sca-java-1.5.1/itest/jaxws/pom.xml | 125 +++++++++++++++++++++ .../tuscanyscatours/payment/impl/PaymentImpl.java | 35 ++++++ .../itest/jaxws/src/main/resources/Payment.wsdl | 83 ++++++++++++++ .../jaxws/src/main/resources/payment.composite | 33 ++++++ .../java/scatours/payment/PaymentTestCase.java | 55 +++++++++ branches/sca-java-1.5.1/itest/pom.xml | 1 + 6 files changed, 332 insertions(+) create mode 100644 branches/sca-java-1.5.1/itest/jaxws/pom.xml create mode 100644 branches/sca-java-1.5.1/itest/jaxws/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 branches/sca-java-1.5.1/itest/jaxws/src/main/resources/Payment.wsdl create mode 100644 branches/sca-java-1.5.1/itest/jaxws/src/main/resources/payment.composite create mode 100644 branches/sca-java-1.5.1/itest/jaxws/src/test/java/scatours/payment/PaymentTestCase.java (limited to 'branches/sca-java-1.5.1/itest') diff --git a/branches/sca-java-1.5.1/itest/jaxws/pom.xml b/branches/sca-java-1.5.1/itest/jaxws/pom.xml new file mode 100644 index 0000000000..ba3e3f7cfe --- /dev/null +++ b/branches/sca-java-1.5.1/itest/jaxws/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.6-SNAPSHOT + ../../pom.xml + + itest-jaxws + Apache Tuscany SCA iTest JAXWS generated artifacts + + + + org.apache.tuscany.sca + tuscany-node-api + 1.6-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.6-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.6-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.6-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + 1.6-SNAPSHOT + test + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + + + diff --git a/branches/sca-java-1.5.1/itest/jaxws/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/branches/sca-java-1.5.1/itest/jaxws/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..3b557d693a --- /dev/null +++ b/branches/sca-java-1.5.1/itest/jaxws/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentImpl implements Payment { + + public String makePaymentMember(String customerId, float amount) { + return "Made payment of " + amount + " to customer " + customerId; + } +} diff --git a/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/Payment.wsdl b/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..3885764899 --- /dev/null +++ b/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/payment.composite b/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/payment.composite new file mode 100644 index 0000000000..77a956a3c6 --- /dev/null +++ b/branches/sca-java-1.5.1/itest/jaxws/src/main/resources/payment.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/branches/sca-java-1.5.1/itest/jaxws/src/test/java/scatours/payment/PaymentTestCase.java b/branches/sca-java-1.5.1/itest/jaxws/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..610e20b456 --- /dev/null +++ b/branches/sca-java-1.5.1/itest/jaxws/src/test/java/scatours/payment/PaymentTestCase.java @@ -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 scatours.payment; + +import com.tuscanyscatours.payment.Payment; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class PaymentTestCase { + private static SCANode node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("payment.composite", + new SCAContribution("payment", "./target/classes")); + node.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient) node; + Payment payment = client.getService(Payment.class, "Payment"); + System.out.println(payment.makePaymentMember("c-0", 100.00f)); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } +} diff --git a/branches/sca-java-1.5.1/itest/pom.xml b/branches/sca-java-1.5.1/itest/pom.xml index 0cd17c899b..a4363b8fc0 100644 --- a/branches/sca-java-1.5.1/itest/pom.xml +++ b/branches/sca-java-1.5.1/itest/pom.xml @@ -99,6 +99,7 @@ interop-soap-round2-client interop-soap-service --> + jaxws jms jms-args jms-callbacks -- cgit v1.2.3