Author: objectiser
Date: 2010-01-08 11:59:54 -0500 (Fri, 08 Jan 2010)
New Revision: 445
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw144TestCase.java
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/build.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/deployment.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jbm-queue-service.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jboss-esb.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/helloworld/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/helloworld/CopyPayloadAction.java
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java
Removed:
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
Modified:
trunk/integration-tests/build.xml
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
Log:
RIFTSAW-144: Made use of MessagePayloadProxy, provided integration test, and moved the
ESBInvocationAdapter implementation to be an internal class.
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2010-01-08 16:31:56 UTC (rev 444)
+++ trunk/integration-tests/build.xml 2010-01-08 16:59:54 UTC (rev 445)
@@ -138,6 +138,7 @@
<ant
antfile="src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml"
/>
<ant antfile="src/test/resources/testcases/RiftSaw_118/build.xml" />
+ <ant antfile="src/test/resources/testcases/RiftSaw_144/build.xml" />
</target>
</project>
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw144TestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw144TestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw144TestCase.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,50 @@
+/*
+ * 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.testcases;
+
+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.
+ */
+public class RiftSaw144TestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "RiftSaw_144";
+
+ public RiftSaw144TestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(RiftSaw144TestCase.class,
+ TEST_NAME,
"RiftSaw_144.esb,../Quickstart_bpel_hello_world/Quickstart_bpel_hello_world-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+ String result=sendESBMessage("Hello World via ESB to BPEL",
"HelloWorldBPELESB", "SayHello");
+
+ assertMessage(result, "Hello World via ESB to BPEL World");
+ }
+}
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/build.xml
(rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/build.xml 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,43 @@
+<project name="RiftSaw_144" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="classes"
value="${basedir}/target/compile-tests/${ant.project.name}"/>
+ <property name="test.dir"
value="${basedir}/src/test/resources/testcases/${ant.project.name}" />
+ <property name="src.dir" value="${test.dir}/src" />
+
+ <property name="sample.esb.name" value="${ant.project.name}.esb"
/>
+
+ <target name="compile">
+
+ <mkdir dir="${classes}" />
+
+ <javac srcdir="${src.dir}" destdir="${classes}"
debug="true" deprecation="true" fork="true" >
+ <classpath>
+ <fileset dir="${org.jboss.esb.home}/lib" />
+ <fileset dir="${org.jboss.as.home}/client"
excludes="jbossws-native-jaxws.jar jbossws-native-jaxws-ext.jar jaxws-rt.jar
jaxws-tools.jar" />
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="deploy" depends="compile" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <zip destfile="${deploy.dir}/${ant.project.name}/${sample.esb.name}">
+ <zipfileset dir="${test.dir}" includes="deployment.xml"
fullpath="META-INF/deployment.xml"/>
+ <zipfileset dir="${test.dir}" includes="jboss-esb.xml"
fullpath="META-INF/jboss-esb.xml"/>
+ <zipfileset dir="${test.dir}" includes="jbm-queue-service.xml"
fullpath="jbm-queue-service.xml"/>
+ <zipfileset dir="${classes}" />
+ </zip>
+ </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/testcases/RiftSaw_144/deployment.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/deployment.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/deployment.xml 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+ <depends>jboss.bpel:service=BPELEngine</depends>
+
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_esb</depends>
+
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_esb_reply</depends>
+
<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_gw</depends>
+</jbossesb-deployment>
Added:
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jbm-queue-service.xml
===================================================================
---
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jbm-queue-service.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jbm-queue-service.xml 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+
name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+
name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+
name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_bpel_helloworld_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends
optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jboss-esb.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jboss-esb.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/jboss-esb.xml 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,58 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc...
parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ"
connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_bpel_helloworld_Request_gw"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_bpel_helloworld_Request_esb"
+ />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="HelloWorldBPELESB"
+ name="SayHello"
+ description="Hello World">
+ <listeners>
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ is-gateway="true" />
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel" />
+ </listeners>
+ <actions>
+ <action name="action1"
class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull"
value="true"/>
+ </action>
+ <action name="action2"
class="org.jboss.soa.esb.samples.quickstart.helloworld.CopyPayloadAction">
+ <property name="set-payload-location" value="test1"/>
+ </action>
+ <action name="action3"
class="org.jboss.soa.esb.actions.bpel.BPELInvoke">
+ <property name="service"
value="{http://www.jboss.org/bpel/examples/wsdl}HelloService"/>
+ <property name="operation" value="hello"
/>
+ <property name="requestPartName" value="TestPart" />
+ <property name="responsePartName" value="TestPart" />
+ <property name="get-payload-location" value="test1"/>
+ <property name="set-payload-location"
value="test2"/>
+ </action>
+ <action name="action4"
class="org.jboss.soa.esb.samples.quickstart.helloworld.CopyPayloadAction">
+ <property name="get-payload-location" value="test2"/>
+ </action>
+ <!-- The next action is for Continuous Integration testing -->
+ <action name="testStore"
class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added:
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/helloworld/CopyPayloadAction.java
===================================================================
---
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/helloworld/CopyPayloadAction.java
(rev 0)
+++
trunk/integration-tests/src/test/resources/testcases/RiftSaw_144/src/org/jboss/soa/esb/samples/quickstart/helloworld/CopyPayloadAction.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+
+public class CopyPayloadAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree _config;
+
+ public CopyPayloadAction(ConfigTree config) { _config = config; }
+
+ public Message process(Message message) throws Exception {
+ MessagePayloadProxy proxy=new MessagePayloadProxy(_config);
+
+ Object val=proxy.getPayload(message);
+
+ System.out.println("Payload="+val);
+
+ Message ret=MessageFactory.getInstance().getMessage();
+
+ proxy.setPayload(ret, val);
+
+ return ret;
+ }
+}
Copied:
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java
(from rev 438,
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java)
===================================================================
---
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java
(rev 0)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -0,0 +1,106 @@
+/*
+ * 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.internal.soa.esb.actions.bpel;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public class ESBInvocationAdapter implements InvocationAdapter<Element>
+{
+ private String operationName;
+ private QName serviceName;
+ private QName faultName;
+ private Element requestXML;
+ private Element responseXML;
+
+ public ESBInvocationAdapter(String operationName, QName serviceName)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getFaultName()
+ {
+ return faultName;
+ }
+
+ public void setFaultName(QName fname) {
+ this.faultName = fname;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setRequestXML(Element requestXML)
+ {
+ this.requestXML = requestXML;
+ }
+
+ public void parseRequest(MyRoleMessageExchange mex, Message request)
+ {
+ if(null==this.requestXML)
+ throw new IllegalArgumentException("request XML not set");
+ request.setMessage(this.requestXML);
+ }
+
+ public void createResponse(MyRoleMessageExchange mex)
+ {
+ this.responseXML = mex.getResponse().getMessage();
+ }
+
+ public void createFault(MyRoleMessageExchange mex)
+ {
+ this.responseXML = mex.getFaultResponse().getMessage();
+ this.faultName = mex.getFault();
+ }
+
+ public Element getInvocationResult()
+ {
+ return this.responseXML;
+ }
+
+ // test methods
+ public Element getRequestXML()
+ {
+ return requestXML;
+ }
+
+ public void setResponseXML(Element responseXML)
+ {
+ this.responseXML = responseXML;
+ }
+}
+
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 2010-01-08
16:31:56 UTC (rev 444)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -22,9 +22,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.internal.soa.esb.actions.bpel.ESBInvocationAdapter;
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
import org.jboss.soa.esb.message.format.MessageFactory;
import javax.naming.*;
@@ -113,6 +115,9 @@
throw new RuntimeException("Failed to locate BPEL engine");
}
+ // Create MessagePayloadProxy
+ MessagePayloadProxy proxy=new MessagePayloadProxy(_config);
+
String requestPartName=_config.getAttribute(REQUEST_PART_NAME);
logger.debug("Request: "+message);
@@ -121,7 +126,7 @@
org.w3c.dom.Element mesgElem=null;
// Get default body value
- Object value=message.getBody().get();
+ Object value=proxy.getPayload(message); //message.getBody().get();
Node node=null;
if (value instanceof String) {
@@ -178,18 +183,18 @@
org.w3c.dom.Element resp=null;
javax.xml.namespace.QName faultName=null;
- QName serviceQName = new QName(getNamespace(serviceName),
getLocalPart(serviceName));
+ QName serviceQName = new QName(getNamespace(serviceName), getLocalPart(serviceName));
+
+ // Create invocationContext
+ ESBInvocationAdapter invocationContext =
+ new ESBInvocationAdapter(_config.getAttribute(OPERATION), serviceQName);
+ invocationContext.setRequestXML(mesgElem);
+
+ // invoke ODE
+ engine.invoke(invocationContext);
+ resp = invocationContext.getInvocationResult();
+ faultName = invocationContext.getFaultName();
- // Create invocationContext
- ESBInvocationAdapter invocationContext =
- new ESBInvocationAdapter(_config.getAttribute(OPERATION), serviceQName);
- invocationContext.setRequestXML(mesgElem);
-
- // invoke ODE
- engine.invoke(invocationContext);
- resp = invocationContext.getInvocationResult();
- faultName = invocationContext.getFaultName();
-
if (resp != null) {
ret = MessageFactory.getInstance().getMessage();
@@ -236,8 +241,11 @@
logger.error("Unable to convert message part
'"+(defpart==null?"<undefined>":defpart)+
"' into a response document");
} else {
- ret.getBody().add(respValue);
+ //ret.getBody().add(respValue);
+ // Set the payload in the returned message
+ proxy.setPayload(ret, respValue);
+
// Check if fault name should be set
if (faultName != null) {
logger.debug("Fault '"+faultName+"' detected, throwing
exception");
Deleted:
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
===================================================================
---
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java 2010-01-08
16:31:56 UTC (rev 444)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -1,106 +0,0 @@
-/*
- * 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.esb.actions.bpel;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
-import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author Heiko Braun <hbraun(a)redhat.com>
- */
-public class ESBInvocationAdapter implements InvocationAdapter<Element>
-{
- private String operationName;
- private QName serviceName;
- private QName faultName;
- private Element requestXML;
- private Element responseXML;
-
- public ESBInvocationAdapter(String operationName, QName serviceName)
- {
- this.operationName = operationName;
- this.serviceName = serviceName;
- }
-
- public String getOperationName()
- {
- return operationName;
- }
-
- public QName getFaultName()
- {
- return faultName;
- }
-
- public void setFaultName(QName fname) {
- this.faultName = fname;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setRequestXML(Element requestXML)
- {
- this.requestXML = requestXML;
- }
-
- public void parseRequest(MyRoleMessageExchange mex, Message request)
- {
- if(null==this.requestXML)
- throw new IllegalArgumentException("request XML not set");
- request.setMessage(this.requestXML);
- }
-
- public void createResponse(MyRoleMessageExchange mex)
- {
- this.responseXML = mex.getResponse().getMessage();
- }
-
- public void createFault(MyRoleMessageExchange mex)
- {
- this.responseXML = mex.getFaultResponse().getMessage();
- this.faultName = mex.getFault();
- }
-
- public Element getInvocationResult()
- {
- return this.responseXML;
- }
-
- // test methods
- Element getRequestXML()
- {
- return requestXML;
- }
-
- void setResponseXML(Element responseXML)
- {
- this.responseXML = responseXML;
- }
-}
-
Modified:
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
===================================================================
---
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2010-01-08
16:31:56 UTC (rev 444)
+++
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2010-01-08
16:59:54 UTC (rev 445)
@@ -17,6 +17,7 @@
*/
package org.jboss.soa.esb.actions.bpel;
+import org.jboss.internal.soa.esb.actions.bpel.ESBInvocationAdapter;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;