summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.0/samples/helloworld-bpel/README
blob: 7ba1b3422e4e3d729f9c38ec3ebdd1c63a7ea395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Hello World BPEL Sample
======================================
This sample demonstrates an SCA service implemented by a BPEL process. 

The README in the samples directory (the directory above this) provides 
general instructions about building and running samples. Take a look there 
first. 

If you just want to run it to see what happens open a command prompt, please 
check the section to build and run the sample using maven.

The sample will start the an embedded BPEL engine, deploy 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
-----------------------------------------

Ant script is not supported at the moment.
     

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.

We first need to tweek the helloworld-bpel pom.xml in order to overcome a surefire 
defect. See below the changes that need to be done on the helloworld-bpel\pom.xml

Original:
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<useFile>false</useFile>
					<trimStackTrace>false</trimStackTrace>
					<skip>true</skip>
					<!--useSystemClassLoader>true</useSystemClassLoader-->
				</configuration>
			</plugin>

Updated:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<useFile>false</useFile>
					<trimStackTrace>false</trimStackTrace>
					<useSystemClassLoader>true</useSystemClassLoader>
				</configuration>
			</plugin>

Now that you have the updated pom :

cd helloworld-bpel
mvn

You should see the following output from the test phase.

-

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running helloworld.BPELHelloWorldTestCase
Starting BPELHelloWorldComponent org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl
INFO - GeronimoLog.info(79) | BPEL Server Started.
10:19:31,609 INFO  [BpelServerImpl] BPEL Server Started.
Deploying : D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\classes
D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\classes
INFO - GeronimoLog.info(79) | Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
10:19:37,656 INFO  [BpelServerImpl] Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
INFO - GeronimoLog.info(79) | Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
10:19:38,312 INFO  [BpelServerImpl] Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
INFO - GeronimoLog.info(79) | Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
10:19:38,312 INFO  [BpelServerImpl] Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
INFO - GeronimoLog.info(79) | Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
10:19:38,453 INFO  [BpelServerImpl] Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
::message:: <?xml version="1.0" encoding="UTF-8"?>
<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/></TestPart></message>
Status: RESPONSE
Response: <?xml version="1.0" encoding="UTF-8"?>
<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"> World</hello></TestPart></message>
Stopping BPELHelloWorldComponent org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.031 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\samples\helloworld-bpel\target\sample-helloworld-bpel.jar
[INFO] [install:install]
[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresende\.m
2\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: 1 minute 3 seconds
[INFO] Finished at: Tue Sep 18 10:19:41 PDT 2007
[INFO] Final Memory: 24M/46M
[INFO] ------------------------------------------------------------------------


This shows that the Junit test cases have run successfully.