summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/java/scatours/client/TestClient.java22
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml1
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/client.composite1
3 files changed, 24 insertions, 0 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/java/scatours/client/TestClient.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/java/scatours/client/TestClient.java
index b1858782cf..6f1243b103 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/java/scatours/client/TestClient.java
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/java/scatours/client/TestClient.java
@@ -19,20 +19,42 @@
package scatours.client;
+
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
import com.tuscanyscatours.payment.Payment;
+import com.tuscanyscatours.common.Book;
+import com.tuscanyscatours.common.TripItem;
+
+/**
+ * A client for calling payment and trip components directly. The components in this
+ * case are expected to have policy configuration associated with the in the
+ * composite files that define them
+ *
+ */
@Service(Runnable.class)
public class TestClient {
@Reference
protected Payment payment;
+
+ @Reference
+ protected Book tripBooking;
public TestClient() {
}
public void run() {
+ System.out.println("===============================================");
+ System.out.println("Test the loggin policy by calling the trip component");
+ 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 = " + tripBooking.book(tripItem));
+ System.out.println("===============================================");
+ System.out.println("Test the basic authentication policy by calling the payment component");
System.out.println("TestClient - Successful Payment - Status = " + payment.makePaymentMember("c-0", 100.00f));
+ System.out.println("===============================================");
}
}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml
index 3ccb9da245..4300ce0dc0 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml
@@ -20,5 +20,6 @@
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:client="http://client.scatours/">
<import.java package="payment" />
+ <import.java package="com.tuscanyscatours.common"/>
<deployable composite="client:Client" />
</contribution>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/client.composite b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/client.composite
index 788dd81a92..5b632b4be2 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/client.composite
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/src/main/resources/client.composite
@@ -24,5 +24,6 @@
<component name="TestClient">
<implementation.java class="scatours.client.TestClient" />
<reference name="payment" target="Payment/Payment" />
+ <reference name="tripBooking" target="Trip/Book" />
</component>
</composite>