From fb22ec3f14a2a075ce9297cb741755a23c03b5b9 Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 1 Jun 2010 21:50:07 +0000 Subject: Tag for travelsample-1.0-RC3 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@950266 13f79535-47bb-0310-9956-ffa450edef68 --- .../contributions/payment-groovy/build.xml | 35 +++++ .../contributions/payment-groovy/pom.xml | 161 +++++++++++++++++++++ .../src/main/resources/EmailGateway.wsdl | 89 ++++++++++++ .../main/resources/META-INF/sca-contribution.xml | 24 +++ .../payment-groovy/src/main/resources/Payment.wsdl | 83 +++++++++++ .../src/main/resources/payment.composite | 38 +++++ .../src/main/resources/payment/PaymentImpl.groovy | 31 ++++ .../java/scatours/payment/PaymentTestCase.java | 77 ++++++++++ .../payment/client/impl/PaymentClientImpl.java | 37 +++++ .../test/resources/META-INF/sca-contribution.xml | 24 +++ .../src/test/resources/payment-client.composite | 32 ++++ 11 files changed, 631 insertions(+) create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite (limited to 'sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy') diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml new file mode 100644 index 0000000000..bc16f99976 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml new file mode 100644 index 0000000000..8294c5d66e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-groovy + Apache Tuscany SCA Tours Payment Groovy Contribution + + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + 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 + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..a097d9b7e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..36e2990be1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite new file mode 100644 index 0000000000..071c6786d1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + 0.02 + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy new file mode 100644 index 0000000000..854fbd2f4a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy @@ -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. + */ + +def makePaymentMember(customerId, amount) { + + def finalAmount = amount + transactionFee; + + com.tuscanyscatours.emailgateway.EmailType email = new com.tuscanyscatours.emailgateway.EmailType(); + email.setTo(customerId); + email.setTitle("Payment " + finalAmount + " Received"); + + emailGateway.sendEmail(email); + + return "Success"; +} \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..c96fddb6b3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,77 @@ +/* + * 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 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; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + + private static SCANode paymentNode; + private static SCANode emailGatewayNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + emailGatewayNode = + SCANodeFactory.newInstance().createSCANode("emailgateway.composite", + new SCAContribution("emailgateway", + "../emailgateway/target/classes"), + new SCAContribution("emailgateway-test", + "../emailgateway/target/test-classes")); + + emailGatewayNode.start(); + + paymentNode = + SCANodeFactory.newInstance().createSCANode(null, + new SCAContribution("payment-groovy", "./target/classes"), + new SCAContribution("payment-groovy-test", + "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"Success".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + emailGatewayNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..a38ba51ac5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -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. + */ + +package scatours.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..9b3e309d11 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..353c1cea04 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + -- cgit v1.2.3