From eb06796859bc8746cb3f25e065d3211fdadf2d6b Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 8 Feb 2009 10:34:50 +0000 Subject: re-org the modules git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@742040 13f79535-47bb-0310-9956-ffa450edef68 --- .../paymentprocess-contribution/log4j.properties | 36 +++++ .../paymentprocesstest.composite | 47 ++++++ .../chapter-06/paymentprocess-contribution/pom.xml | 179 +++++++++++++++++++++ .../resources/CreditCardPayment.wsdl | 117 ++++++++++++++ .../resources/EmailGateway.wsdl | 89 ++++++++++ .../resources/META-INF/sca-contribution.xml | 23 +++ .../resources/PaymentProcess.wsdl | 83 ++++++++++ .../resources/paymentprocess.bpel | 164 +++++++++++++++++++ .../resources/paymentprocess.componentType | 38 +++++ .../paymentprocess/PaymentProcessClientImpl.java | 38 +++++ .../paymentprocess/PaymentProcessTestCase.java | 76 +++++++++ 11 files changed, 890 insertions(+) create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java (limited to 'sandbox/travelsample/chapter-06/paymentprocess-contribution') diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties b/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties new file mode 100644 index 0000000000..7ed0bcaf77 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties @@ -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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=DEBUG +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF +log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite b/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite new file mode 100644 index 0000000000..f45dc01a57 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml b/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml new file mode 100644 index 0000000000..c1a9712a66 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml @@ -0,0 +1,179 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-paymentprocess-contribution + Apache Tuscany SCA Tours Payment Process Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + ${basedir}/src + ${basedir}/test + + + ${basedir}/resources + + + + + ${basedir}/resources + + + ${basedir} + + *.composite + *.properties + + + + + + 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.9 + + + wsimport + generate-sources + + wsimport + + + scatours.paymentprocess + ${basedir}/resources + + + PaymentProcess.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + test-compile + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + + diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..a90c73cdfb --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..d9a5e36bc0 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8146abbceb --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl new file mode 100644 index 0000000000..c4157cf475 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel new file mode 100644 index 0000000000..08c6b8f636 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa + 12345678 + 2 + 2010 + + Empty +
+ 1 The Road + Winchester + Hampshire + AB1 2CD + 12345678 +
+
+
+ 0.0 +
+
+
+ $authorizeRequestMessage.parameters +
+ + $makePaymentRequestMessage.parameters/CustomerId/text() + $authorizeRequestMessage.parameters/CreditCard/CardOwner/Name + + + $makePaymentRequestMessage.parameters/Amount/text() + $authorizeRequestMessage.parameters/Amount + +
+ + + + + + + + + + + Default + Payment Confirmation + Your payment has been confirmed + + + + + $sendEmailRequestMessage.parameters + + + $makePaymentRequestMessage.parameters/CustomerId/text() + $sendEmailRequestMessage.parameters/Email/To + + + + + + + + + + + + + OK + + + + $makePaymentResponseMessage.parameters + + + + + + +
+
diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType new file mode 100644 index 0000000000..ecc2f55a47 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java new file mode 100644 index 0000000000..8d9c2f918c --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java @@ -0,0 +1,38 @@ +/* + * 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.paymentprocess; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * + */ +@Service(PaymentProcess.class) +public class PaymentProcessClientImpl implements PaymentProcess { + @Reference + protected PaymentProcess paymentProcess; + + public String makePayment(String customerId, float amount) { + // Delegate the external web service + return paymentProcess.makePayment(customerId, amount); + } + +} diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java new file mode 100644 index 0000000000..f1b4bc6aba --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java @@ -0,0 +1,76 @@ +/* + * 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.paymentprocess; + +import org.apache.tuscany.sca.node.SCAClient; +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.Ignore; +import org.junit.Test; + +/** + * + */ +public class PaymentProcessTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = factory.createSCANodeFromClassLoader("paymentprocesstest.composite", PaymentProcess.class.getClassLoader()); + node.start(); + } + + @Test + @Ignore + public void testPaymentProcess() { + SCAClient client = (SCAClient) node; + PaymentProcess pp = client.getService(PaymentProcess.class, "PaymentProcessClient"); + System.out.println("Result = " + pp.makePayment("Fred", 100.00f)); + } + + @Test + //@Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} -- cgit v1.2.3