summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-21 19:01:14 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-21 19:01:14 +0000
commit0f1ad3191968f089c21a11d0274af20dfc62d5cc (patch)
tree071ee4bd6808b6f3be1cfe00532f3133bb74f7c9 /sca-java-1.x
parent54c2e4f90a91920badc2bd287d7452211e8300a2 (diff)
Exercise the trip policy from the policy client and policy launcher
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@925864 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/pom.xml7
-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
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/pom.xml9
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/src/main/java/scatours/PolicyLauncher.java4
6 files changed, 42 insertions, 2 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/pom.xml b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/pom.xml
index c0aac2e426..b304838d47 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/pom.xml
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/policy-client/pom.xml
@@ -34,6 +34,13 @@
<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>javax.xml.ws</groupId>
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>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/pom.xml b/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/pom.xml
index bd11cebf24..8cb43fad80 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/pom.xml
+++ b/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/pom.xml
@@ -76,7 +76,14 @@
<artifactId>tuscany-policy-security</artifactId>
<version>${tuscany.version}</version>
<scope>runtime</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-logging</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/src/main/java/scatours/PolicyLauncher.java b/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/src/main/java/scatours/PolicyLauncher.java
index b48c4e88ec..115d747ede 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/src/main/java/scatours/PolicyLauncher.java
+++ b/sca-java-1.x/trunk/tutorials/travelsample/launchers/policy/src/main/java/scatours/PolicyLauncher.java
@@ -30,8 +30,10 @@ public class PolicyLauncher {
public static void main(String[] args) throws Exception {
SCANode node1 =
SCANodeFactory.newInstance().createSCANode(null,
+ locate("common"),
locate("policy-client"),
- locate("payment-java-policy"));
+ locate("payment-java-policy"),
+ locate("trip-policy"));
node1.start();