diff options
Diffstat (limited to 'sca-java-1.x/trunk/tutorials')
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(); |