Author: objectiser
Date: 2012-05-16 08:43:14 -0400 (Wed, 16 May 2012)
New Revision: 1560
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
Modified:
branches/RiftSaw-2.3.x/integration-tests/build.xml
branches/RiftSaw-2.3.x/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
trunk/integration-tests/build.xml
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
Log:
RIFTSAW-491 - if ESB invokes a BPEL process, which results in an unexpected or technical
fault with no message content, then currently the action pipeline silently terminates.
This fix ensures an exception is thrown that can be handled by the pipeline.
Modified: branches/RiftSaw-2.3.x/integration-tests/build.xml
===================================================================
--- branches/RiftSaw-2.3.x/integration-tests/build.xml 2012-05-08 06:27:54 UTC (rev 1559)
+++ branches/RiftSaw-2.3.x/integration-tests/build.xml 2012-05-16 12:43:14 UTC (rev 1560)
@@ -192,6 +192,7 @@
<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_exception/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"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_header_wsdl/build.xml"
/>
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,65 @@
+/*
+ * 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.esb;
+
+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_hello_world sample modified to throw
+ * an exception, related to RIFTSAW-491.
+ */
+public class QuickstartESBBPELHelloWorldExceptionTestCase extends RiftSawTest {
+
+ // NOTE: Test is named after the bpel process, as that is where the exception is
+ // thrown. Will reuse existing esb_bpel_hello_world ESB service to invoke the
+ // exception generating BPEL process.
+ private static final String TEST_NAME =
"Quickstart_bpel_hello_world_exception";
+
+ public QuickstartESBBPELHelloWorldExceptionTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(QuickstartESBBPELHelloWorldExceptionTestCase.class,
+ TEST_NAME,
"../Quickstart_esb_bpel_hello_world/Quickstart_esb_bpel_hello_world.esb,Quickstart_bpel_hello_world_exception-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+
+ try {
+ String result=sendESBMessage("Hello World via ESB to BPEL",
"HelloWorldBPELESB", "SayHello");
+
+ fail("Shouldn't return a response");
+ } catch(Exception e) {
+ if (e.getCause() instanceof org.jboss.soa.esb.actions.ActionProcessingException) {
+ if
(!e.getCause().getMessage().equals("{http://www.jboss.org/bpel/examples}somethingBadHappened"))
{
+ fail("Cause message was not
'{http://www.jboss.org/bpel/examples}somethingBadHappened':
"+e.getCause().getMessage());
+ }
+ } else {
+ fail("Unexpected exception: "+e+" with cause: "+e.getCause());
+ }
+ }
+ }
+}
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,70 @@
+<!--
+ ~ 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="HelloWorld"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <throw name="anErrorOccured"
faultName="tns:somethingBadHappened" />
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+</process>
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,67 @@
+<?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/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage"
name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding"
type="tns:HelloPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort"
binding="tns:HelloSoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_hello_worldWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,30 @@
+<project name="Quickstart_bpel_hello_world_exception"
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:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added:
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
===================================================================
---
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
(rev 0)
+++
branches/RiftSaw-2.3.x/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><Test...
World</TestPart></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified:
branches/RiftSaw-2.3.x/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
===================================================================
---
branches/RiftSaw-2.3.x/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2012-05-08
06:27:54 UTC (rev 1559)
+++
branches/RiftSaw-2.3.x/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2012-05-16
12:43:14 UTC (rev 1560)
@@ -61,6 +61,8 @@
protected ConfigTree _config;
private static BPELEngine _bpelEngine;
+
+ private final Log logger = LogFactory.getLog(getClass());
public BPELInvoke(ConfigTree config) {
_config = config;
@@ -353,6 +355,9 @@
} catch(Exception e) {
logger.error("Failed to parse response '"+resp+"'", e);
}
+ } else if (faultName != null) {
+ logger.debug("Unknown fault '"+faultName+"' occurred");
+ throw new org.jboss.soa.esb.actions.ActionProcessingException(faultName.toString());
}
logger.debug("Response: "+ret);
@@ -489,6 +494,4 @@
return(ret);
}
-
- private final Log logger = LogFactory.getLog(getClass());
}
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2012-05-08 06:27:54 UTC (rev 1559)
+++ trunk/integration-tests/build.xml 2012-05-16 12:43:14 UTC (rev 1560)
@@ -192,6 +192,7 @@
<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_exception/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"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_header_wsdl/build.xml"
/>
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/esb/QuickstartESBBPELHelloWorldExceptionTestCase.java 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,65 @@
+/*
+ * 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.esb;
+
+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_hello_world sample modified to throw
+ * an exception, related to RIFTSAW-491.
+ */
+public class QuickstartESBBPELHelloWorldExceptionTestCase extends RiftSawTest {
+
+ // NOTE: Test is named after the bpel process, as that is where the exception is
+ // thrown. Will reuse existing esb_bpel_hello_world ESB service to invoke the
+ // exception generating BPEL process.
+ private static final String TEST_NAME =
"Quickstart_bpel_hello_world_exception";
+
+ public QuickstartESBBPELHelloWorldExceptionTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(QuickstartESBBPELHelloWorldExceptionTestCase.class,
+ TEST_NAME,
"../Quickstart_esb_bpel_hello_world/Quickstart_esb_bpel_hello_world.esb,Quickstart_bpel_hello_world_exception-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+
+ try {
+ String result=sendESBMessage("Hello World via ESB to BPEL",
"HelloWorldBPELESB", "SayHello");
+
+ fail("Shouldn't return a response");
+ } catch(Exception e) {
+ if (e.getCause() instanceof org.jboss.soa.esb.actions.ActionProcessingException) {
+ if
(!e.getCause().getMessage().equals("{http://www.jboss.org/bpel/examples}somethingBadHappened"))
{
+ fail("Cause message was not
'{http://www.jboss.org/bpel/examples}somethingBadHappened':
"+e.getCause().getMessage());
+ }
+ } else {
+ fail("Unexpected exception: "+e+" with cause: "+e.getCause());
+ }
+ }
+ }
+}
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.bpel 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,70 @@
+<!--
+ ~ 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="HelloWorld"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <throw name="anErrorOccured"
faultName="tns:somethingBadHappened" />
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+</process>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/HelloWorld.wsdl 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,67 @@
+<?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/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage"
name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding"
type="tns:HelloPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort"
binding="tns:HelloSoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_hello_worldWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/bpel/deploy.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/build.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,30 @@
+<project name="Quickstart_bpel_hello_world_exception"
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_hello_world_exception/messages/hello_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_request1.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world_exception/messages/hello_response1.xml 2012-05-16
12:43:14 UTC (rev 1560)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><Test...
World</TestPart></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified:
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
===================================================================
---
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2012-05-08
06:27:54 UTC (rev 1559)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2012-05-16
12:43:14 UTC (rev 1560)
@@ -61,6 +61,8 @@
protected ConfigTree _config;
private static BPELEngine _bpelEngine;
+
+ private final Log logger = LogFactory.getLog(getClass());
public BPELInvoke(ConfigTree config) {
_config = config;
@@ -353,6 +355,9 @@
} catch(Exception e) {
logger.error("Failed to parse response '"+resp+"'", e);
}
+ } else if (faultName != null) {
+ logger.debug("Unknown fault '"+faultName+"' occurred");
+ throw new org.jboss.soa.esb.actions.ActionProcessingException(faultName.toString());
}
logger.debug("Response: "+ret);
@@ -489,6 +494,4 @@
return(ret);
}
-
- private final Log logger = LogFactory.getLog(getClass());
}