Author: objectiser
Date: 2010-08-24 08:41:43 -0400 (Tue, 24 Aug 2010)
New Revision: 924
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELFaultCompensationTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/bpel-deploy.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.bpel
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.wsdl
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_request1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_request1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_request1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_response1.xml
Modified:
trunk/integration-tests/build.xml
Log:
Add fault_compensation sample to integration tests.
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2010-08-23 16:09:07 UTC (rev 923)
+++ trunk/integration-tests/build.xml 2010-08-24 12:41:43 UTC (rev 924)
@@ -128,6 +128,7 @@
<antcall target="copy.rosetta.aop" />
<mkdir dir="target/tests"/>
+ <ant
antfile="src/test/resources/samples/Quickstart_bpel_fault_compensation/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_extended_timeout/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_header_ode/build.xml"
/>
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELFaultCompensationTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELFaultCompensationTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELFaultCompensationTestCase.java 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.samples;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Test case for running the Quickstart_bpel_fault_compensation sample.
+ */
+public class QuickstartBPELFaultCompensationTestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "Quickstart_bpel_fault_compensation";
+
+ public QuickstartBPELFaultCompensationTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(QuickstartBPELFaultCompensationTestCase.class,
+ TEST_NAME, "Quickstart_bpel_fault_compensation-1.jar"));
+ }
+
+ public void testSendOk() throws Exception {
+ String result=sendSOAPMessage("fc_ok_request1.xml",
+ "http://localhost:8080/Quickstart_bpel_fault_compensationWS");
+
+ result = processResult(result);
+
+ assertMessageFromFile(result, "fc_ok_response1.xml");
+ }
+
+ public void testSendFail() throws Exception {
+ String result=sendSOAPMessage("fc_fail_request1.xml",
+ "http://localhost:8080/Quickstart_bpel_fault_compensationWS");
+
+ result = processResult(result);
+
+ assertMessageFromFile(result, "fc_fail_response1.xml");
+ }
+
+ public void testSendCompensate() throws Exception {
+ String result=sendSOAPMessage("fc_compensate_request1.xml",
+ "http://localhost:8080/Quickstart_bpel_fault_compensationWS");
+
+ result = processResult(result);
+
+ assertMessageFromFile(result, "fc_compensate_response1.xml");
+ }
+}
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/bpel-deploy.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/bpel-deploy.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/bpel-deploy.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
xmlns:examples="http://www.jboss.org/bpel/examples">
+ <process name="examples:scope">
+ <active>true</active>
+ <retired>false</retired>
+ <process-events generate="all"/>
+ <provide partnerLink="scopeProcess">
+ <service name="examples:scopeService"
port="scopeServicePort"/>
+ </provide>
+ </process>
+</deploy>
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.bpel
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.bpel
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.bpel 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,145 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<process name="scope"
+ suppressJoinFailure="yes"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:ns="http://www.jboss.org/bpel/examples"
+
xmlns:types="http://www.jboss.org/bpel/examples/types"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
+ location="scope.wsdl"
+
namespace="http://www.jboss.org/bpel/examples" />
+
+
+
+ <partnerLinks>
+ <partnerLink name="scopeProcess" myRole="scopeProcess"
partnerLinkType="ns:scopeProcess" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="inputMessage"
messageType="ns:scopeRequestMessage" />
+ <variable name="outputMessage"
messageType="ns:scopeResponseMessage" />
+ </variables>
+
+ <sequence>
+ <receive createInstance="yes"
+ operation="processRequest"
+ partnerLink="scopeProcess"
+ portType="ns:scopePT"
+ variable="inputMessage" />
+
+ <scope name="OuterScope">
+ <variables>
+ <variable name="localVariable" type="xsd:string" />
+ </variables>
+
+ <faultHandlers>
+ <catchAll>
+ <sequence>
+ <if name="If">
+ <condition>$inputMessage.payload/compensate =
'false'</condition>
+ <rethrow name="Rethrow"/>
+ </if>
+
+ <compensateScope target="InnerScope" />
+ </sequence>
+ </catchAll>
+ </faultHandlers>
+
+ <sequence>
+ <assign name="AssignInitialValue">
+ <copy>
+ <from>
+ <literal>Initial variable value</literal>
+ </from>
+ <to variable="localVariable" />
+ </copy>
+ </assign>
+
+ <scope name="InnerScope">
+ <compensationHandler>
+ <flow>
+ <links>
+ <link name="L1"/>
+ </links>
+
+ <assign name="AssignCompensatedValue">
+ <sources>
+ <source linkName="L1"/>
+ </sources>
+
+ <copy>
+ <from>
+ <literal>Compensated value</literal>
+ </from>
+ <to variable="localVariable"/>
+ </copy>
+ </assign>
+
+ <assign name="CopyLocalVarToOutputMessage">
+ <targets>
+ <target linkName="L1"/>
+ </targets>
+ <copy>
+ <from variable="localVariable"/>
+ <to>$outputMessage.result</to>
+ </copy>
+ </assign>
+
+ </flow>
+ </compensationHandler>
+
+ <sequence>
+ <assign name="AssignInnerScopeValue">
+ <copy>
+ <from>
+ <literal>Inner scope value</literal>
+ </from>
+ <to variable="localVariable" />
+ </copy>
+ </assign>
+ </sequence>
+
+ </scope>
+
+ <empty name="DoSomethingInteresting"/>
+
+ <if name="If">
+ <condition>$inputMessage.payload/simulateException =
'true'</condition>
+ <throw faultName="ns:propagatedFault" />
+ </if>
+
+ <assign name="CopyLocalVarToOutputMessage">
+ <copy>
+ <from variable="localVariable"/>
+ <to>$outputMessage.result</to>
+ </copy>
+ </assign>
+ </sequence>
+ </scope>
+
+ <reply operation="processRequest"
+ partnerLink="scopeProcess"
+ portType="ns:scopePT"
+ variable="outputMessage"/>
+
+ </sequence>
+</process>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.wsdl
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.wsdl
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/bpel/scope.wsdl 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<wsdl:definitions
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <wsdl:types>
+ <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
targetNamespace="http://www.jboss.org/bpel/examples">
+
+ <xsd:complexType name="scopeFault">
+ <xsd:sequence>
+ <xsd:element name="faultMessage" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="scopeReqest">
+ <xsd:sequence>
+ <xsd:element name="simulateException"
type="xsd:boolean"/>
+ <xsd:element name="compensate" type="xsd:boolean"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="scopeRequestMessage">
+ <wsdl:part name="payload" type="tns:scopeReqest" />
+ </wsdl:message>
+ <wsdl:message name="scopeResponseMessage">
+ <wsdl:part name="result" type="xsd:string" />
+ </wsdl:message>
+ <wsdl:message name="Exception">
+ <wsdl:part name="message" type="tns:scopeFault"/>
+ </wsdl:message>
+
+ <wsdl:portType name="scopePT">
+ <wsdl:operation name="processRequest">
+ <wsdl:input message="tns:scopeRequestMessage" />
+ <wsdl:output message="tns:scopeResponseMessage" />
+ <wsdl:fault message="tns:Exception" name="Exception" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="scopeServiceBinding" type="tns:scopePT">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="processRequest">
+ <soap:operation
soapAction="http://www.jboss.org/bpel/examples/receiveOrder" />
+ <wsdl:input>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap:fault use="literal" name="Exception"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="scopeService">
+ <wsdl:port name="scopeServicePort"
binding="tns:scopeServiceBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_fault_compensationWS" />
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="scopeProcess">
+ <plnk:role name="scopeProcess" portType="tns:scopePT"/>
+ </plnk:partnerLinkType>
+
+</wsdl:definitions>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/build.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/build.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,30 @@
+<project name="Quickstart_bpel_fault_compensation"
default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="version" value="1" />
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="test.dir"
value="${basedir}/src/test/resources/samples/${ant.project.name}" />
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <jar basedir="${test.dir}/bpel"
destfile="${deploy.dir}/${ant.project.name}/${sample.jar.name}" />
+
+ <copy todir="${deploy.dir}/${ant.project.name}">
+ <fileset dir="${test.dir}/messages"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+</project>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_request1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>true</simulateException>
+ <compensate>true</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_response1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_response1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_compensate_response1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:odens='http://www.jboss.org/bpel/examples'><result>...
value</result></odens:processRequestResponse></env:Body></env:Envelope>
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_request1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>true</simulateException>
+ <compensate>false</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_response1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_response1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_fail_response1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><faul...
xmlns:valueNS='http://www.jboss.org/bpel/examples'>valueNS:pro...
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_request1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>false</simulateException>
+ <compensate>false</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_response1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_response1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_fault_compensation/messages/fc_ok_response1.xml 2010-08-24
12:41:43 UTC (rev 924)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:odens='http://www.jboss.org/bpel/examples'><result>... scope
value</result></odens:processRequestResponse></env:Body></env:Envelope>
\ No newline at end of file