Author: buildbot
Date: Mon Dec 10 18:37:55 2012
New Revision: 841482
Log:
Staging update by buildbot for ode
Modified:
websites/staging/ode/trunk/content/ (props changed)
websites/staging/ode/trunk/content/writing-bpel-test-cases.html
Propchange: websites/staging/ode/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Dec 10 18:37:55 2012
@@ -1 +1 @@
-1419640
+1419642
Modified: websites/staging/ode/trunk/content/writing-bpel-test-cases.html
==============================================================================
--- websites/staging/ode/trunk/content/writing-bpel-test-cases.html (original)
+++ websites/staging/ode/trunk/content/writing-bpel-test-cases.html Mon Dec 10
18:37:55 2012
@@ -81,7 +81,8 @@
<div class="row">
<div class="span12">
- <p>ODE has a test framework to automatically run BPEL processes. A
big part of our test harness is therefore many different BPEL processes that
test specific BPEL configurations or interactions. If you run into a problem
with one of your processes that seems to be a bug, the best way to get it fixed
is to contribute a test case to the project. We'll run it and keep it to
prevent regressions. The more test cases we have, the more robust ODE will be.
</p>
+ <h2 id="overview">Overview</h2>
+<p>ODE has a test framework to automatically run BPEL processes. A big part of
our test harness is therefore many different BPEL processes that test specific
BPEL configurations or interactions. If you run into a problem with one of your
processes that seems to be a bug, the best way to get it fixed is to contribute
a test case to the project. We'll run it and keep it to prevent regressions.
The more test cases we have, the more robust ODE will be.</p>
<p>This small guide will just explain you how to write and structure a test
case to include it in ODE's test suite. For those who rather have examples than
explanations, you can already check all <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/">existing
test cases</a>.</p>
<p><a name="WritingBPELTestCases-BPELConstraints"></a></p>
<h3 id="bpel-constraints">BPEL Constraints</h3>
@@ -93,7 +94,7 @@
<p>Other than that your process can do anything and can use all the WSDL,
schemas and XSL stylesheets you need.</p>
<p><a name="WritingBPELTestCases-TestDescriptor"></a></p>
<h3 id="test-descriptor">Test Descriptor</h3>
-<p>So to begin with your test process must at least have a <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/HelloWorld2.bpel">BPEL
file</a>, a [WSDL
file|http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/HelloWorld2.wsdl]
and the standard
[deploy.xml|http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/deploy.xml]
deployment descriptor (links are provided for the HelloWorld test case). All
of these should be included in a single directory.</p>
+<p>So to begin with your test process must at least have a <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/HelloWorld2.bpel">BPEL
file</a>, a <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/HelloWorld2.wsdl">WSDL
file</a> and the standard <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2/deploy.xml">deploy.xml</a>
deployment descriptor (links are provided for the HelloWorld test case). All
of these should be included in a single directory.</p>
<p>Then for the test framework to know what it should do you will also need to
write a simple test descriptor. It's a simple properties file saying which
service is implemented by the process and which messages should be sent to
start it and make it continue. It should me named test?.properties with the '?'
being a increasing number. Here is the descriptor for the HelloWorld example,
in test1.properties:</p>
<div class="codehilite"><pre>namespace=http://ode/bpel/unit-test.wsdl
service=HelloService
@@ -111,7 +112,7 @@ response1=.*Hello World.*
namespace=http://ode/bpel/unit-test/testCorrelation.wsdl
service=testCorrelationService
operation=request
-request1=<span
class="nt"><message><requestMessageData><testMessage><requestID></span>Start
Test5.1<span class="nt"></requestID><requestText></span>Event
Start
+request1=<span
class="nt"><message><requestMessageData><testMessage><requestID></span>Start
Test5.1<span class="nt"></requestID><requestText></span>Event Start
Test5.1<span class="nt"></requestText><requestEnd></span>no<span
class="nt"></requestEnd></testMessage></requestMessageData></message></span>
response1=ASYNC
@@ -120,9 +121,9 @@ test2.properties
namespace=http://ode/bpel/unit-test/testCorrelation.wsdl
service=testCorrelationService
operation=continue
-request1=<span
class="nt"><message><requestMessageData><testMessage><requestID></span>Start
Test5.1<span class="nt"></requestID><requestText></span>Event
Start
+request1=<span
class="nt"><message><requestMessageData><testMessage><requestID></span>Start
Test5.1<span class="nt"></requestID><requestText></span>Event Start
Test5.2.1<span
class="nt"></requestText><requestEnd></span>yes<span
class="nt"></requestEnd></testMessage></requestMessageData></message></span>
-response1=.*Event Start Test5.1 -<span class="ni">&gt;</span> loop on
receive until message includes requestEnd = yes -<span
class="ni">&gt;</span> received
+response1=.*Event Start Test5.1 -<span class="ni">&gt;</span> loop on
receive until message includes requestEnd = yes -<span
class="ni">&gt;</span> received
message -<span class="ni">&gt;</span> process complete.*
</pre></div>
@@ -152,7 +153,7 @@ response1=.*Event Start Test5.1 -<span c
<p>Once this has been executed you can check whether the probeStr produced as
a reply contains both "received message" and "big value" or "received message"
and "small value" using a response regular expression.</p>
<p>Practically the probe service takes 2 parts: probeName and probeData. The
probeName part should contain what you wnat to append, the probeData part will
contain the appended string after the call and shouldn't be modified once it's
been initialized. The probeData part will effectively contain the successive
appended strings and that's what you're going to test at the end of the
execution.</p>
<p>Here is a usage example extracted from the <a
href="http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelation/testCorrelation.bpel">correlation
test case</a>:</p>
-<div class="codehilite"><pre><span class="nt"><receive</span> <span
class="na">name=</span><span class="s">"receive1"</span> <span
class="na">partnerLink=</span><span class="s">"request"</span> <span
class="na">portType=</span><span
class="s">"wns:testCorrelationPT"</span>
+<div class="codehilite"><pre><span class="nt"><receive</span> <span
class="na">name=</span><span class="s">"receive1"</span> <span
class="na">partnerLink=</span><span class="s">"request"</span> <span
class="na">portType=</span><span
class="s">"wns:testCorrelationPT"</span>
<span class="na">operation=</span><span
class="s">"request"</span> <span class="na">variable=</span><span
class="s">"request"</span> <span
class="na">createInstance=</span><span class="s">"yes"</span><span
class="nt">></span>
<span class="nt"><correlations></span>
<span class="nt"><correlation</span> <span
class="na">set=</span><span class="s">"testCorr1"</span> <span
class="na">initiate=</span><span class="s">"yes"</span><span
class="nt">/></span>
@@ -172,13 +173,13 @@ response1=.*Event Start Test5.1 -<span c
<span class="nt"><assign></span>
<span class="nt"><copy></span>
<span class="nt"><from></span>
- <span class="nt"><literal></span><span
class="cp"><![CDATA[loop on receive until message </span>
+ <span class="nt"><literal></span><span
class="cp"><![CDATA[loop on receive until message</span>
<span class="cp"> includes requestEnd
= yes]]></span><span class="nt"></literal></span>
<span class="nt"></from></span>
<span class="nt"><to</span> <span class="na">variable=</span><span
class="s">"probeInput"</span> <span class="na">part=</span><span
class="s">"probeName"</span><span class="nt">/></span>
<span class="nt"></copy></span>
<span class="nt"></assign></span>
-<span class="nt"><invoke</span> <span class="na">name=</span><span
class="s">"probe"</span> <span class="na">partnerLink=</span><span
class="s">"probe"</span> <span class="na">portType=</span><span
class="s">"prb:probeMessagePT"</span> <span
class="na">operation=</span><span class="s">"probe"</span>
+<span class="nt"><invoke</span> <span class="na">name=</span><span
class="s">"probe"</span> <span class="na">partnerLink=</span><span
class="s">"probe"</span> <span class="na">portType=</span><span
class="s">"prb:probeMessagePT"</span> <span
class="na">operation=</span><span class="s">"probe"</span>
<span class="na">inputVariable=</span><span
class="s">"probeInput"</span> <span
class="na">outputVariable=</span><span
class="s">"probeInput"</span><span class="nt">/></span>
</pre></div>
@@ -194,13 +195,13 @@ response1=.*Event Start Test5.1 -<span c
<span class="nt"><to</span> <span class="na">variable=</span><span
class="s">"reply"</span> <span class="na">part=</span><span
class="s">"replyText"</span><span class="nt">/></span>
<span class="nt"></copy></span>
<span class="nt"></assign></span>
-<span class="nt"><reply</span> <span class="na">name=</span><span
class="s">"reply"</span> <span class="na">partnerLink=</span><span
class="s">"request"</span> <span class="na">portType=</span><span
class="s">"wns:testCorrelationPT"</span> <span
class="na">operation=</span><span class="s">"continue"</span>
+<span class="nt"><reply</span> <span class="na">name=</span><span
class="s">"reply"</span> <span class="na">partnerLink=</span><span
class="s">"request"</span> <span class="na">portType=</span><span
class="s">"wns:testCorrelationPT"</span> <span
class="na">operation=</span><span class="s">"continue"</span>
<span class="na">variable=</span><span
class="s">"reply"</span><span class="nt">/></span>
</pre></div>
<p>The returned data is finally tested by using a nice regular expression for
the response:</p>
-<div class="codehilite"><pre><span class="n">response1</span><span
class="o">=.*</span><span class="n">Event</span> <span class="n">Start</span>
<span class="n">Test5</span><span class="mf">.1</span> <span
class="o">-&</span><span class="ow">gt</span><span class="p">;</span> <span
class="n">loop</span> <span class="n">on</span> <span class="n">receive</span>
<span class="k">until</span> <span class="n">message</span> <span
class="n">includes</span> <span class="n">requestEnd</span> <span
class="o">=</span> <span class="n">yes</span> <span
class="o">-&</span><span class="ow">gt</span><span class="p">;</span>
+<div class="codehilite"><pre><span class="n">response1</span><span
class="o">=.*</span><span class="n">Event</span> <span class="n">Start</span>
<span class="n">Test5</span><span class="mf">.1</span> <span
class="o">-&</span><span class="ow">gt</span><span class="p">;</span> <span
class="n">loop</span> <span class="n">on</span> <span class="n">receive</span>
<span class="k">until</span> <span class="n">message</span> <span
class="n">includes</span> <span class="n">requestEnd</span> <span
class="o">=</span> <span class="n">yes</span> <span
class="o">-&</span><span class="ow">gt</span><span class="p">;</span>
<span class="n">received</span> <span class="n">message</span>
<span class="o">-&</span><span class="ow">gt</span><span class="p">;</span>
<span class="n">process</span> <span class="n">complete</span><span
class="o">.*</span>
</pre></div>
@@ -209,7 +210,7 @@ response1=.*Event Start Test5.1 -<span c
<p><a name="WritingBPELTestCases-FaultService"></a></p>
<h4 id="fault-service">Fault Service</h4>
<p>When invoked, the fault service (as the name says) will return a fault.
It's mostly used to test fault handlers and compensation. To invoke the fault
service just use:</p>
-<div class="codehilite"><pre><span class="o"><</span><span
class="n">invoke</span> <span class="n">name</span><span
class="o">=</span><span class="s">"throwTestFault"</span> <span
class="n">partnerLink</span><span class="o">=</span><span
class="s">"fault"</span> <span class="n">portType</span><span
class="o">=</span><span class="s">"flt:faultMessagePT"</span> <span
class="n">operation</span><span class="o">=</span><span
class="s">"throwFault"</span>
+<div class="codehilite"><pre><span class="o"><</span><span
class="n">invoke</span> <span class="n">name</span><span
class="o">=</span><span class="s">"throwTestFault"</span> <span
class="n">partnerLink</span><span class="o">=</span><span
class="s">"fault"</span> <span class="n">portType</span><span
class="o">=</span><span class="s">"flt:faultMessagePT"</span> <span
class="n">operation</span><span class="o">=</span><span
class="s">"throwFault"</span>
<span class="n">inputVariable</span><span class="o">=</span><span
class="s">"fault"</span> <span class="n">outputVariable</span><span
class="o">=</span><span class="s">"faultResponse"</span><span
class="o">/></span>
</pre></div>