From 7146f9a6e5527f7f8f9e64c97479b155b5d2abd6 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Sep 2010 13:06:31 +0000 Subject: Add a couple of sample contributions that reuse the helloworld sample contribution with and include and adding a ws binding. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@997736 13f79535-47bb-0310-9956-ffa450edef68 --- .../contributions/helloworld-recursive-ws/README | 153 +++++++++++++++++++++ .../contributions/helloworld-recursive-ws/pom.xml | 82 +++++++++++ .../main/resources/META-INF/sca-contribution.xml | 28 ++++ .../src/main/resources/helloworld-ws.composite | 33 +++++ .../contributions/helloworld-recursive/README | 7 + .../contributions/helloworld-recursive/pom.xml | 76 ++++++++++ .../main/resources/META-INF/sca-contribution.xml | 26 ++++ .../main/resources/helloworld-recursive.composite | 30 ++++ 8 files changed, 435 insertions(+) create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/README create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/pom.xml create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/README create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/pom.xml create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/helloworld-recursive.composite (limited to 'sca-java-2.x/trunk') diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/README b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/README new file mode 100644 index 0000000000..a21077ba58 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/README @@ -0,0 +1,153 @@ +Hello World BPEL Sample +====================================== +This sample demonstrates an SCA service implemented by a BPEL process. + +The README in the /samples directory provides +general instructions about building and running samples. (where +distribution-unpack-dir is the directory in which you unpacked the tuscany +binary distribution archive). Take a look there first (noting at you read it that this sample +is not a new style sample). + +If you just want to run it to see what happens open a command prompt, navigate +to this sample directory, and do + +ant compile run + +OR if you don't have ant, on Windows do + +mkdir target\classes +mkdir target\wsdl2java-source +java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl +java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl +unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database +javac -d target\classes -cp target\classes;..\..\lib\tuscany-sca-manifest.jar -sourcepath src\main\java;target\wsdl2java-source -target 1.5 -g -source 1.5 src\main\java\helloworld\BPELClient.java +copy src\main\resources\* target\classes +java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient + +and on *nix do + +mkdir target/classes +mkdir target/wsdl2java-source +java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl +java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl +unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database +javac -d target/classes -cp target/classes;../../lib/tuscany-sca-manifest.jar -sourcepath src/main/java;target/wsdl2java-source -target 1.5 -g -source 1.5 src/main/java/helloworld/BPELClient.java +cp src/main/resources/* target/classes +java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient + +The sample will start an embedded BPEL engine, deploy a process and invoke it. + +Sample Overview +--------------- +The sample provides a single component that is wired to a service with a +web service binding. + +helloworld-bpel/ + src/ + main/ + java/ + helloworld/ + BPELClient.java - client application for + BEPELHelloWorldComponent + + resources/ + deploy.xml - ODE deployment descriptor + helloworld.bpel - helloworld bpel process + helloworld.componentType - helloworld bpel service description + helloworld.composite - the SCA assembly for this sample + helloworld.wsdl - the service description that describes + the bpel process + log4j.properties - logging configuration + + test/ + java/ + helloworld/ + BPELHelloWorldTestCase.java - JUnit test case + helloworld-bpel.png - a pictorial representation of the + sample .composite file + build.xml - the Ant build file + pom.xml - the Maven build file + +Building And Running The Sample Using Ant +----------------------------------------- + +With the binary distribution the sample can be built and run using Ant as +follows + +cd helloworld-bpel +ant compile +ant run + + +You should see the following output from the run target. + +run: + [java] Starting BPELHelloWorldComponent + [java] >>> Deploying : D:\temp\SCA1.1-RC1\tuscany-sca-1.1-incubating\samples\helloworld-bpel\target\classes + [java] ::arg:::::: + [java] Hello + [java] ::message:: + [java] Hello + [java] Status: RESPONSE + [java] Response: + [java] Hello World + [java] Hello World + [java] Stopping BPELHelloWorldComponent + [java] Stopped !!! + +BUILD SUCCESSFUL +Total time: 36 seconds + +Building And Running The Sample Using Maven +------------------------------------------- +With either the binary or source distributions the sample can be built and run +using Maven as follows. When using Maven, a simple test is present that exercise +the same logic as the client to invoke the BPEl process. + +cd helloworld-bpel +mvn + +You should see the following output from the test phase. + +- + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running helloworld.BPELHelloWorldTestCase +Starting BPELHelloWorldComponent +>>> Deploying : D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\classes +::arg:::::: +Hello +::message:: +Hello +Status: RESPONSE +Response: +Hello World +Stopping BPELHelloWorldComponent +Stopped !!! +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.656 sec + +Results : + +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 + +[INFO] [jar:jar] +[INFO] Building jar: D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar +[INFO] [install:install] +[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresend +e\.m2\repository\org\apache\tuscany\sca\sample-helloworld-bpel\1.1-incubating-SNAPSHOT\sample-helloworld-bpel-1.1-incubating-SNAPSHOT.jar +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESSFUL +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 53 seconds +[INFO] Finished at: Sun Jan 13 09:54:39 PST 2008 +[INFO] Final Memory: 24M/43M +[INFO] ------------------------------------------------------------------------ + + +This shows that the Junit test cases have run successfully. diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/pom.xml b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/pom.xml new file mode 100644 index 0000000000..80432461e4 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-samples + 2.0-SNAPSHOT + ../pom.xml + + + zip + sample-helloworld-recursive-ws + Apache Tuscany SCA Sample Helloworld using recursive composition and a Web Service + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-SNAPSHOT + provided + + + org.apache.tuscany.sca + sample-helloworld + 2.0-SNAPSHOT + provided + + + junit + junit + 4.8.1 + test + + + + + ${artifactId} + + + + + org.apache.tuscany.maven.plugins + maven-zip-plugin + alpha2 + true + + + + + org.apache.tuscany.maven.plugins + maven-tuscany-plugin + 2.0-SNAPSHOT + + + + ..\helloworld-recursive\target\sample-helloworld-recursive.jar + ..\helloworld\target\sample-helloworld.jar + + + + + + + diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ffc35bb553 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite new file mode 100644 index 0000000000..719754224d --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/README b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/README new file mode 100644 index 0000000000..ed0f1d0ce4 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/README @@ -0,0 +1,7 @@ +The README in the /samples directory provides +general instructions about building and running samples. (where +distribution-unpack-dir is the directory in which you unpacked the tuscany +binary distribution archive). Take a look there first (noting at you read it that this sample +is not a new style sample). + +TODO - finish this \ No newline at end of file diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/pom.xml b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/pom.xml new file mode 100644 index 0000000000..4326970c33 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-samples + 2.0-SNAPSHOT + ../pom.xml + + + zip + sample-helloworld-recursive + Apache Tuscany SCA Sample Helloworld using recursive composition + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-SNAPSHOT + provided + + + junit + junit + 4.8.1 + test + + + + + ${artifactId} + + + + + + org.apache.tuscany.maven.plugins + maven-zip-plugin + alpha2 + true + + + + + org.apache.tuscany.maven.plugins + maven-tuscany-plugin + 2.0-SNAPSHOT + + + + ..\helloworld\target\sample-helloworld.jar + + + + + + + diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..15d9304d05 --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/helloworld-recursive.composite b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/helloworld-recursive.composite new file mode 100644 index 0000000000..1094fea85e --- /dev/null +++ b/sca-java-2.x/trunk/samples/getting-started/contributions/helloworld-recursive/src/main/resources/helloworld-recursive.composite @@ -0,0 +1,30 @@ + + + + + + + + + -- cgit v1.2.3