Author: slaws
Date: Sun Mar 21 18:57:14 2010
New Revision: 925862
URL: http://svn.apache.org/viewvc?rev=925862&view=rev
Log:
Add a trip contribution that demonstrates the logging policy. Was only turned
on in the trip unit test previously.
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
(with props)
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/resources/
Modified:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml
Modified:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml?rev=925862&r1=925861&r2=925862&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml
(original)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml Sun
Mar 21 18:57:14 2010
@@ -93,6 +93,7 @@
<module>payment-bpel</module>
<module>payment-groovy</module>
<module>policy-client</module>
+ <module>trip-policy</module>
</modules>
</profile>
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
Sun Mar 21 18:57:14 2010
@@ -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.
+-->
+
+<project name="scatours-contribution-trip" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-contribution-common.jar"/>
+ </path>
+ <path id="test-path" refid="compile-path"/>
+</project>
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-contribution-trip-policy</artifactId>
+ <name>Apache Tuscany SCA Tours Prepackaged Trip Policy Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-contribution-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-logging</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,94 @@
+/*
+ * 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.trip.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.common.Book;
+import com.tuscanyscatours.common.Search;
+import com.tuscanyscatours.common.SearchCallback;
+import com.tuscanyscatours.common.TripItem;
+import com.tuscanyscatours.common.TripLeg;
+
+/**
+ * An implementation of the Trip service
+ */
+...@scope("STATELESS")
+...@service(interfaces = {Search.class, Book.class})
+public class TripImpl implements Search, Book {
+
+ private List<TripInfo> trips = new ArrayList<TripInfo>();
+
+ @Callback
+ protected SearchCallback searchCallback;
+
+ @Init
+ public void init() {
+ trips.add(new TripInfo("FS1DEC06", "Florence and Siena pre-packaged
tour", "LGW", "FLR", "06/12/09",
+ "13/12/09", "27", 450, "EUR",
"http://localhost:8085/tbd"));
+ trips.add(new TripInfo("FS1DEC13", "Florence and Siena pre-packaged
tour 2", "LGW", "FLR", "13/12/09",
+ "20/12/09", "27", 550, "EUR",
"http://localhost:8085/tbd"));
+ }
+
+ public TripItem[] searchSynch(TripLeg tripLeg) {
+ List<TripItem> items = new ArrayList<TripItem>();
+
+ // find the pre-package trip
+ for (TripInfo trip : trips) {
+ if ((trip.getFromLocation().equals(tripLeg.getFromLocation())) &&
(trip.getToLocation().equals(tripLeg
+ .getToLocation()))
+ && (trip.getFromDate().equals(tripLeg.getFromDate()))) {
+ TripItem item =
+ new TripItem("", "", TripItem.TRIP, trip.getName(),
trip.getDescription(),
+ trip.getFromLocation() + " - " +
trip.getToLocation(), trip.getFromDate(), trip
+ .getToDate(), trip.getPricePerPerson(),
trip.getCurrency(), trip.getLink());
+ items.add(item);
+ }
+ }
+
+ return items.toArray(new TripItem[items.size()]);
+ }
+
+ public void searchAsynch(TripLeg tripLeg) {
+ System.out.println("Starting trip search");
+
+ try {
+ Thread.sleep(2000);
+ } catch (Exception ex) {
+ // do nothing
+ }
+
+ // return available hotels
+ searchCallback.searchResults(searchSynch(tripLeg));
+ }
+
+ public int getPercentComplete() {
+ return 100;
+ }
+
+ public String book(TripItem tripItem) {
+ return "trip1";
+ }
+}
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,140 @@
+/*
+ * 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.trip.impl;
+
+public class TripInfo {
+
+ private String name;
+ private String description;
+ private String fromLocation;
+ private String toLocation;
+ private String fromDate;
+ private String toDate;
+ private String spaces;
+ private double pricePerPerson;
+ private String currency;
+ private String link;
+
+ public TripInfo() {
+ }
+
+ public TripInfo(String name,
+ String description,
+ String fromLocation,
+ String toLocation,
+ String fromDate,
+ String toDate,
+ String spaces,
+ double pricePerPerson,
+ String currency,
+ String link) {
+
+ this.name = name;
+ this.description = description;
+ this.fromLocation = fromLocation;
+ this.toLocation = toLocation;
+ this.fromDate = fromDate;
+ this.toDate = toDate;
+ this.spaces = spaces;
+ this.pricePerPerson = pricePerPerson;
+ this.currency = currency;
+ this.link = link;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getFromLocation() {
+ return fromLocation;
+ }
+
+ public void setFromLocation(String fromLocation) {
+ this.fromLocation = fromLocation;
+ }
+
+ public String getToLocation() {
+ return toLocation;
+ }
+
+ public void setToLocation(String toLocation) {
+ this.toLocation = toLocation;
+ }
+
+ public String getFromDate() {
+ return fromDate;
+ }
+
+ public void setFromDate(String fromDate) {
+ this.fromDate = fromDate;
+ }
+
+ public String getToDate() {
+ return toDate;
+ }
+
+ public void setToDate(String toDate) {
+ this.toDate = toDate;
+ }
+
+ public String getSpaces() {
+ return spaces;
+ }
+
+ public void setSpaces(String spaces) {
+ this.spaces = spaces;
+ }
+
+ public double getPricePerPerson() {
+ return pricePerPerson;
+ }
+
+ public void setPricePerPerson(double pricePerPerson) {
+ this.pricePerPerson = pricePerPerson;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public String getLink() {
+ return link;
+ }
+
+ public void setLink(String link) {
+ this.link = link;
+ }
+}
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:scatours="http://scatours">
+ <import.java package="com.tuscanyscatours.common"/>
+ <export.java package="com.tuscanyscatours.trip.impl"/>
+ <deployable composite="scatours:packagedtrip" />
+</contribution>
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+
+ <!-- PolicySets -->
+ <policySet name="JDKLoggingPolicy" provides="tuscany:logging"
appliesTo="sca:implementation.java"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <tuscany:jdkLogger name="myLogger">
+ <logLevel>FINER</logLevel>
+ </tuscany:jdkLogger>
+ </policySet>
+</definitions>
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scatours"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ name="packagedtrip">
+
+ <component name="Trip">
+ <implementation.java class="com.tuscanyscatours.trip.impl.TripImpl"
requires="tuscany:logging"/>
+ <service name="Search"/>
+ <service name="Book"/>
+ </component>
+
+</composite>
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/main/resources/trip.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java?rev=925862&view=auto
==============================================================================
---
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
(added)
+++
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
Sun Mar 21 18:57:14 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.trip;
+
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.tuscanyscatours.common.Book;
+import com.tuscanyscatours.common.TripItem;
+
+/**
+ *
+ */
+public class TripTestCase {
+ private static SCANode tripNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ try {
+ tripNode =
+ SCANodeFactory.newInstance().createSCANode("trip.composite",
+ new
SCAContribution("trip", "./target/classes"),
+ new
SCAContribution("trip-test", "./target/test-classes"));
+
+ tripNode.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testPayment() {
+ SCAClient client = (SCAClient)tripNode;
+ Book booking = client.getService(Book.class, "Trip/Book");
+ TripItem tripItem =
+ new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence
and Siena pre-packaged tour", "FLR",
+ "06/12/09", "13/12/09", 450, "EUR",
"http://localhost:8085/tbd");
+ System.out.println("Result = " + booking.book(tripItem) + "\n");
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ tripNode.stop();
+ }
+
+}
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date