From e766494b2c34ae0f7ae0f9da01deb66ea0b13de6 Mon Sep 17 00:00:00 2001 From: nash Date: Wed, 26 May 2010 15:57:39 +0000 Subject: Tag for travelsample-1.0-RC2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@948485 13f79535-47bb-0310-9956-ffa450edef68 --- .../contributions/usingsca/build.xml | 22 +++ .../contributions/usingsca/pom.xml | 118 ++++++++++++++ .../java/com/tuscanyscahotels/HotelOffers.java | 26 +++ .../com/tuscanyscahotels/impl/HotelOffersImpl.java | 35 +++++ .../src/main/java/com/tuscanyscatours/Address.java | 172 ++++++++++++++++++++ .../java/com/tuscanyscatours/AirportCodes.java | 28 ++++ .../java/com/tuscanyscatours/BillingAddress.java | 174 +++++++++++++++++++++ .../main/java/com/tuscanyscatours/Bookings.java | 26 +++ .../src/main/java/com/tuscanyscatours/Cars.java | 27 ++++ .../com/tuscanyscatours/CurrencyConverter.java | 27 ++++ .../java/com/tuscanyscatours/CustomerInfo.java | 27 ++++ .../src/main/java/com/tuscanyscatours/Flights.java | 27 ++++ .../src/main/java/com/tuscanyscatours/Hotels.java | 27 ++++ .../usingsca/impl/CarPartnerImpl.java | 36 +++++ .../usingsca/impl/CarVendorImpl.java | 34 ++++ .../usingsca/impl/CurrencyConverterImpl.java | 45 ++++++ .../usingsca/impl/CustomerImpl.java | 47 ++++++ .../usingsca/impl/FlightPartnerImpl.java | 31 ++++ .../usingsca/impl/HotelPartnerImpl.java | 31 ++++ .../usingsca/impl/TripBookingImpl.java | 73 +++++++++ .../client/impl/AirportCodesClientImpl.java | 36 +++++ .../scatours/client/impl/BookingsClientImpl.java | 36 +++++ .../client/impl/BookingsZeroClientImpl.java | 36 +++++ .../client/impl/CarBookingsClientImpl.java | 38 +++++ .../scatours/client/impl/ConverterClientImpl.java | 43 +++++ .../client/impl/HotelOffersClientImpl.java | 36 +++++ .../scatours/client/impl/Orders1ClientImpl.java | 36 +++++ .../scatours/client/impl/Orders2ClientImpl.java | 38 +++++ .../usingsca/src/main/resources/address.xsd | 41 +++++ .../src/main/resources/airportcodes.composite | 26 +++ .../src/main/resources/bookings1.composite | 42 +++++ .../src/main/resources/bookings2.composite | 42 +++++ .../src/main/resources/bookings3.composite | 39 +++++ .../src/main/resources/bookings4.composite | 42 +++++ .../src/main/resources/carbookings1.composite | 36 +++++ .../src/main/resources/carbookings2.composite | 37 +++++ .../src/main/resources/carbookings3.composite | 36 +++++ .../src/main/resources/converter.composite | 35 +++++ .../src/main/resources/hotelsdomain.composite | 38 +++++ .../usingsca/src/main/resources/orders1.composite | 37 +++++ .../usingsca/src/main/resources/orders2.composite | 46 ++++++ .../usingsca/src/main/resources/orders2.xsd | 24 +++ .../test-clients/airportcodes-client.composite | 33 ++++ .../test-clients/bookings1-client.composite | 33 ++++ .../test-clients/bookings2-client.composite | 33 ++++ .../test-clients/bookings3-client.composite | 33 ++++ .../test-clients/bookings4-client.composite | 35 +++++ .../test-clients/carbookings1-client.composite | 33 ++++ .../test-clients/carbookings2-client.composite | 33 ++++ .../test-clients/carbookings3-client.composite | 33 ++++ .../test-clients/converter-client.composite | 34 ++++ .../test-clients/hotelsdomain-client.composite | 34 ++++ .../test-clients/orders1-client.composite | 33 ++++ .../test-clients/orders2-client.composite | 33 ++++ .../test-clients/toursdomain-client.composite | 33 ++++ .../src/main/resources/toursdomain.composite | 39 +++++ .../test/java/scatours/AirportCodesTestCase.java | 56 +++++++ .../src/test/java/scatours/BindingsTestCase.java | 56 +++++++ .../test/java/scatours/CarAutowireTestCase.java | 56 +++++++ .../src/test/java/scatours/CarPartnerTestCase.java | 56 +++++++ .../test/java/scatours/CarWireElementTestCase.java | 56 +++++++ .../scatours/ComplexPropertyElementTestCase.java | 56 +++++++ .../java/scatours/ComplexPropertyTypeTestCase.java | 56 +++++++ .../java/scatours/CurrencyConverterTestCase.java | 56 +++++++ .../test/java/scatours/MultiDomainTestCase.java | 65 ++++++++ .../test/java/scatours/TripAutowireTestCase.java | 56 +++++++ .../test/java/scatours/TripBookingTestCase.java | 56 +++++++ .../java/scatours/TripWireElementTestCase.java | 56 +++++++ .../usingsca/src/test/resources/jndi.properties | 38 +++++ 69 files changed, 3044 insertions(+) create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/address.xsd create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/airportcodes.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings3.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings4.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings3.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/converter.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/hotelsdomain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.xsd create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/converter-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/toursdomain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/resources/jndi.properties (limited to 'sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca') diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/build.xml new file mode 100644 index 0000000000..9f5fa9ed69 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/pom.xml new file mode 100644 index 0000000000..61957498b0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/pom.xml @@ -0,0 +1,118 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-usingsca + Apache Tuscany SCA Tours Using SCA Components Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + test + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java new file mode 100644 index 0000000000..8abc5af687 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java @@ -0,0 +1,26 @@ +/* + * 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.tuscanyscahotels; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface HotelOffers { + String bookTodaysSpecial(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java new file mode 100644 index 0000000000..fccef2beed --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.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.tuscanyscahotels.impl; + +import java.util.Date; +import org.osoa.sca.annotations.Reference; + +import com.tuscanyscahotels.HotelOffers; +import com.tuscanyscatours.Hotels; + +public class HotelOffersImpl implements HotelOffers { + + @Reference + protected Hotels hotels; + + public String bookTodaysSpecial() { + return hotels.bookHotel("LBH", new Date(), 3, "STD"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java new file mode 100644 index 0000000000..614da1e2ad --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java @@ -0,0 +1,172 @@ +/* + * 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. + */ + +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2010.03.27 at 05:55:25 AM GMT +// + + +package com.tuscanyscatours; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Address complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Address">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="city" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="state" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="zip" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Address", propOrder = { + "street", + "city", + "state", + "zip" +}) +public class Address { + + @XmlElement(required = true) + protected String street; + @XmlElement(required = true) + protected String city; + @XmlElement(required = true) + protected String state; + @XmlElement(required = true) + protected String zip; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zip property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZip() { + return zip; + } + + /** + * Sets the value of the zip property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZip(String value) { + this.zip = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java new file mode 100644 index 0000000000..577f22250a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java @@ -0,0 +1,28 @@ +/* + * 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; + +public class AirportCodes { + public String getAirport(String code) { + if ("AAA".equals(code)) return "Anaa"; + else if ("AAB".equals(code)) return "Arrabury"; + // other airport codes and cities would follow here + else return null; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java new file mode 100644 index 0000000000..4687cf1116 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java @@ -0,0 +1,174 @@ +/* + * 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. + */ + +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2010.03.27 at 05:55:25 AM GMT +// + + +package com.tuscanyscatours; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="city" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="state" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="zip" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "street", + "city", + "state", + "zip" +}) +@XmlRootElement(name = "billingAddress") +public class BillingAddress { + + @XmlElement(required = true) + protected String street; + @XmlElement(required = true) + protected String city; + @XmlElement(required = true) + protected String state; + @XmlElement(required = true) + protected String zip; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zip property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZip() { + return zip; + } + + /** + * Sets the value of the zip property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZip(String value) { + this.zip = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java @@ -0,0 +1,26 @@ +/* + * 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; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Bookings { + String newBooking(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java new file mode 100644 index 0000000000..f58fa33c8d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java @@ -0,0 +1,27 @@ +/* + * 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; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Cars { + String bookCar(Date pickup, int days, String carClass); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java new file mode 100644 index 0000000000..9c201813e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java @@ -0,0 +1,27 @@ +/* + * 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; + +import java.math.BigDecimal; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CurrencyConverter { + BigDecimal convert(BigDecimal amount); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java new file mode 100644 index 0000000000..958ca6cf8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java @@ -0,0 +1,27 @@ +/* + * 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; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CustomerInfo { + String getBillingAddress(); + String getDeliveryAddress(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java new file mode 100644 index 0000000000..873b0afc0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java @@ -0,0 +1,27 @@ +/* + * 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; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Flights { + String bookFlight(String flightNumber, Date date, int seats, String flightClass); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java new file mode 100644 index 0000000000..85944ad1b6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java @@ -0,0 +1,27 @@ +/* + * 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; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Hotels { + String bookHotel(String hotelCode, Date date, int days, String roomType); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java new file mode 100644 index 0000000000..cb354e0ccc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java @@ -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 com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import org.osoa.sca.annotations.Reference; +import com.tuscanyscatours.Cars; + +public class CarPartnerImpl implements Cars { + + @Reference + protected Cars[] cars; + + @Reference(required=false) + protected Cars[] luxuryCars; + + public String bookCar(Date pickup, int days, String carClass) { + return cars[0].bookCar(pickup, days, carClass); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java new file mode 100644 index 0000000000..13c8de7f30 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java @@ -0,0 +1,34 @@ +/* + * 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.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Cars; + +public class CarVendorImpl implements Cars { + + protected int minAge; // implicitly defines an SCA property + + public String bookCar(Date pickup, int days, String carClass) { + System.out.println("Booking confirmed for pickup date " + pickup + + " duration " + days + " days in a " + carClass + + " class car"); + return "CV234"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java new file mode 100644 index 0000000000..a7687c61f7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java @@ -0,0 +1,45 @@ +/* + * 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.usingsca.impl; + +import java.math.BigDecimal; +import org.osoa.sca.annotations.Property; +import com.tuscanyscatours.CurrencyConverter; + +public class CurrencyConverterImpl implements CurrencyConverter { + + @Property + protected String fromCurrency; + + @Property + protected String toCurrency; + + public BigDecimal convert(BigDecimal amount) { + return amount.multiply(getRate(toCurrency)) + .divide(getRate(fromCurrency), 2, 0); + } + + private BigDecimal getRate(String currency) { + int rate = 0; + for (int i = 0; i < currency.length(); i++) { + rate += currency.codePointAt(i); + } + return new BigDecimal(rate).divide(new BigDecimal(100)); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java new file mode 100644 index 0000000000..361d5b35c7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java @@ -0,0 +1,47 @@ +/* + * 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.usingsca.impl; + +import org.osoa.sca.annotations.Property; +import com.tuscanyscatours.Address; +import com.tuscanyscatours.BillingAddress; +import com.tuscanyscatours.CustomerInfo; + +public class CustomerImpl implements CustomerInfo { + + @Property + protected BillingAddress billingAddress; + + @Property + protected Address deliveryAddress; + + public String getBillingAddress() { + return billingAddress.getStreet() + ", " + + billingAddress.getCity() + ", " + + billingAddress.getState() + " " + + billingAddress.getZip(); + } + + public String getDeliveryAddress() { + return deliveryAddress.getStreet() + ", " + + deliveryAddress.getCity() + ", " + + deliveryAddress.getState() + " " + + deliveryAddress.getZip(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java new file mode 100644 index 0000000000..e076a725d1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java @@ -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. + */ +package com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Flights; + +public class FlightPartnerImpl implements Flights { + + public String bookFlight(String flightNumber, Date date, int seats, String flightClass) { + System.out.println("Booking confirmed for flight " + flightNumber + " on date " + + date + " with " + seats + " seats in " + flightClass + " class"); + return "FP345"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java new file mode 100644 index 0000000000..86c98517e7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java @@ -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. + */ +package com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Hotels; + +public class HotelPartnerImpl implements Hotels { + + public String bookHotel(String hotelCode, Date date, int days, String roomType) { + System.out.println("Booking confirmed for hotel " + hotelCode + " arriving on " + + date + " for " + days + " days in a " + roomType + " room"); + return "HP456"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java new file mode 100644 index 0000000000..04c06a8fe6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java @@ -0,0 +1,73 @@ +/* + * 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.usingsca.impl; + +import java.text.DateFormat; +import java.util.Date; +import org.osoa.sca.annotations.Reference; + +import com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Cars; +import com.tuscanyscatours.Flights; +import com.tuscanyscatours.Hotels; + +public class TripBookingImpl implements Bookings { + + public TripBookingImpl(@Reference(name="cars") Cars cars) { + this.cars = cars; + } + + protected Cars cars; + + @Reference + protected Flights flights; + + private Hotels hotels; + + @Reference + public void setHotels(Hotels hotels) { + this.hotels = hotels; + } + + public String newBooking(String trip, int people) { + /* In a real implementation this method would look up the trip code + in the travel catalog to get details of the car, flight and hotel + bookings needed. Instead these details are hard-wired here for + test purposes. */ + Date startDate = new Date(); //TEMP - need to fix + /* + try { + startDate = DateFormat.getInstance().parse("7 Jul, 2012"); + } catch (Exception e) { + e.printStackTrace(); + } + */ + + if (people > 0) { + cars.bookCar(startDate, 7, "B"); + flights.bookFlight("AA123", startDate, people, "Y"); + hotels.bookHotel("DBH", startDate, 7, "SUP"); + + return "HW3546"; + + } else { + return "NONE"; + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java new file mode 100644 index 0000000000..4857b25fb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java @@ -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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.AirportCodes; + +@Service(Runnable.class) +public class AirportCodesClientImpl { + + @Reference + protected AirportCodes airportcodes; + + public void run() { + String airport = airportcodes.getAirport("AAB"); + System.out.println("AAB is the airport code for " + airport); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java new file mode 100644 index 0000000000..aa842c80f7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java @@ -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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Bookings; + +@Service(Runnable.class) +public class BookingsClientImpl { + + @Reference + protected Bookings bookings; + + public void run() { + String bookingCode = bookings.newBooking("VR3MAY9", 2); + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java new file mode 100644 index 0000000000..1fd519d5e9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java @@ -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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Bookings; + +@Service(Runnable.class) +public class BookingsZeroClientImpl { + + @Reference + protected Bookings bookings; + + public void run() { + String bookingCode = bookings.newBooking("DUMMY", 0); + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java new file mode 100644 index 0000000000..0c78a77825 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.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.client.impl; + +import java.util.Date; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Cars; + +@Service(Runnable.class) +public class CarBookingsClientImpl { + + @Reference + protected Cars cars; + + public void run() { + String bookingCode = cars.bookCar(new Date(), 3, "K"); // need to FIX + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java new file mode 100644 index 0000000000..5eab8f8a16 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java @@ -0,0 +1,43 @@ +/* + * 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.client.impl; + +import java.math.BigDecimal; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CurrencyConverter; + +@Service(Runnable.class) +public class ConverterClientImpl { + + @Reference + protected CurrencyConverter eur2jpy; + + @Reference + protected CurrencyConverter usd2gbp; + + public void run() { + BigDecimal jpy = eur2jpy.convert(new BigDecimal("1000.00")); + System.out.println("Converted EUR 1000.00 to JPY " + jpy); + BigDecimal gbp = usd2gbp.convert(new BigDecimal("1000.00")); + System.out.println("Converted USD 1000.00 to GBP " + gbp); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java new file mode 100644 index 0000000000..e581273113 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java @@ -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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscahotels.HotelOffers; + +@Service(Runnable.class) +public class HotelOffersClientImpl { + + @Reference + protected HotelOffers offers; + + public void run() { + String bookingCode = offers.bookTodaysSpecial(); + System.out.println("Hotel offers booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java new file mode 100644 index 0000000000..af21ad3683 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java @@ -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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CustomerInfo; + +@Service(Runnable.class) +public class Orders1ClientImpl { + + @Reference + protected CustomerInfo customer; + + public void run() { + String address = customer.getBillingAddress(); + System.out.println("Customer billing address: " + address); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java new file mode 100644 index 0000000000..41727ac621 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.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.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CustomerInfo; + +@Service(Runnable.class) +public class Orders2ClientImpl { + + @Reference + protected CustomerInfo customer; + + public void run() { + String address = customer.getBillingAddress(); + System.out.println("Customer billing address: " + address); + address = customer.getDeliveryAddress(); + System.out.println("Customer delivery address: " + address); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/address.xsd b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/address.xsd new file mode 100644 index 0000000000..116110f1f3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/address.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/airportcodes.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/airportcodes.composite new file mode 100644 index 0000000000..e68fc732b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/airportcodes.composite @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings1.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings1.composite new file mode 100644 index 0000000000..72347e9987 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings1.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings2.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings2.composite new file mode 100644 index 0000000000..ef1e214b30 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings2.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings3.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings3.composite new file mode 100644 index 0000000000..6b961242fd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings3.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings4.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings4.composite new file mode 100644 index 0000000000..321c891ff8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/bookings4.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings1.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings1.composite new file mode 100644 index 0000000000..f112f25cbc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings1.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings2.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings2.composite new file mode 100644 index 0000000000..b41b569544 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings2.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings3.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings3.composite new file mode 100644 index 0000000000..1bcfb101e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/carbookings3.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/converter.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/converter.composite new file mode 100644 index 0000000000..2afe9cd6e2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/converter.composite @@ -0,0 +1,35 @@ + + + + + + EUR + JPY + + + + USD + GBP + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/hotelsdomain.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/hotelsdomain.composite new file mode 100644 index 0000000000..758c3e31d2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/hotelsdomain.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders1.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders1.composite new file mode 100644 index 0000000000..b0ff245132 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders1.composite @@ -0,0 +1,37 @@ + + + + + + + + + 123 Main Street + New York + NY + 01234 + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.composite new file mode 100644 index 0000000000..79d4be7b61 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.composite @@ -0,0 +1,46 @@ + + + + + + + + + 123 Main Street + New York + NY + 01234 + + + + + 456 Market Street + San Francisco + CA + 98765 + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.xsd b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.xsd new file mode 100644 index 0000000000..db6ee8766e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/orders2.xsd @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite new file mode 100644 index 0000000000..faf2aced82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite new file mode 100644 index 0000000000..c1c4ecfe12 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite new file mode 100644 index 0000000000..e84c7fec06 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite new file mode 100644 index 0000000000..21248976a6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite new file mode 100644 index 0000000000..bc3af6ae4a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite new file mode 100644 index 0000000000..363f498997 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite new file mode 100644 index 0000000000..f80eaf4eca --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite new file mode 100644 index 0000000000..e3cf379de3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/converter-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/converter-client.composite new file mode 100644 index 0000000000..c488a454b4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/converter-client.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite new file mode 100644 index 0000000000..597a5f0a4f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite new file mode 100644 index 0000000000..9015e14cb8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite new file mode 100644 index 0000000000..f9ae67332b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite new file mode 100644 index 0000000000..b84dbe8f72 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/toursdomain.composite b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/toursdomain.composite new file mode 100644 index 0000000000..a0ee26fb89 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/main/resources/toursdomain.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java new file mode 100644 index 0000000000..53d9029e7f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the AirportCodes component implementation class + */ +public class AirportCodesTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/airportcodes-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "AirportCodesClient"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java new file mode 100644 index 0000000000..2daa59245e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests services and references with configured bindings + */ +public class BindingsTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings4-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings4Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java new file mode 100644 index 0000000000..bf20e7cae1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests autowiring of references with different multiplicities + */ +public class CarAutowireTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings3-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings3Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java new file mode 100644 index 0000000000..18e43e7a8b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests wiring of references with different multiplicities + */ +public class CarPartnerTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java new file mode 100644 index 0000000000..997460e0ea --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests wire elements for references with different multiplicities + */ +public class CarWireElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java new file mode 100644 index 0000000000..177b4b2355 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests complex properties defined as XML Schema global elements + */ +public class ComplexPropertyElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/orders1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java new file mode 100644 index 0000000000..168d8f3273 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests complex properties defined as XML Schema types + */ +public class ComplexPropertyTypeTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/orders2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java new file mode 100644 index 0000000000..dec2ae9976 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the CurrencyConverterImpl component implementation class + */ +public class CurrencyConverterTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/converter-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "ConverterClient"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java new file mode 100644 index 0000000000..a7028f6d8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java @@ -0,0 +1,65 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the multiple domains with bindings scenario + */ +public class MultiDomainTestCase { + + private SCANode hotelsNode; + private SCANode toursNode; + + @Before + public void startServer() throws Exception { + hotelsNode = SCANodeFactory.newInstance().createSCANode("test-clients/hotelsdomain-client.composite", + new SCAContribution("using", "./target/classes")); + hotelsNode.start(); + toursNode = SCANodeFactory.newInstance().createSCANode("test-clients/toursdomain-client.composite", + new SCAContribution("using", "./target/classes")); + toursNode.start(); + } + + @Test + public void testImpl() { + Runnable hotelsClient = ((SCAClient)hotelsNode).getService(Runnable.class, "HotelsDomainClient"); + hotelsClient.run(); + Runnable toursClient = ((SCAClient)toursNode).getService(Runnable.class, "ToursDomainClient"); + toursClient.run(); + } + + @After + public void stopServer() throws Exception { + if (toursNode != null) { + toursNode.stop(); + } + if (hotelsNode != null) { + hotelsNode.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java new file mode 100644 index 0000000000..a6f1df98ef --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the use of autowire in the Trip Booking implementation scenario + */ +public class TripAutowireTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings3-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings3Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java new file mode 100644 index 0000000000..d08d176464 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Trip Booking implementation scenario + */ +public class TripBookingTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java new file mode 100644 index 0000000000..36811a98d8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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; + +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.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the use of wire elements in the Trip Booking implementation scenario + */ +public class TripWireElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/resources/jndi.properties b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/resources/jndi.properties new file mode 100644 index 0000000000..80236a8e6c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC2/contributions/usingsca/src/test/resources/jndi.properties @@ -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. +## --------------------------------------------------------------------------- + +# START SNIPPET: jndi + +java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory + +# use the following property to configure the default connector +java.naming.provider.url = vm://localhost?broker.persistent=false + +# use the following property to specify the JNDI name the connection factory +# should appear as. +#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry +connectionFactoryNames = ConnectionFactory + +# register some queues in JNDI using the form +# queue.[jndiName] = [physicalName] +queue.Bookings = BookingsRequestQueue + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +#topic.MyTopic = example.MyTopic + +# END SNIPPET: jndi -- cgit v1.2.3