Author: objectiser
Date: 2009-11-23 10:06:00 -0500 (Mon, 23 Nov 2009)
New Revision: 298
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml
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/ESBInvocationAdapter.java
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/BPELInvokeTest.java
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
Log:
Fixed ESB/BPEL integration to cope with fact that BPELFault exception is no longer thrown,
and instead the InvocationAdapter needs to indicate fact that fault occurred.
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java 2009-11-23
15:06:00 UTC (rev 298)
@@ -56,7 +56,6 @@
assertMessageFromFile(result, "loanresp2.xml");
}
- /*
public void testSendLoanRequest3() throws Exception {
String result=sendSOAPMessage("loanreq3.xml",
"http://localhost:8080/Quickstart_bpel_loan_approvalWS");
@@ -70,5 +69,4 @@
assertMessageFromFile(result, "loanresp4.xml");
}
- */
}
Modified:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml 2009-11-23
15:06:00 UTC (rev 298)
@@ -1 +1 @@
-<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
\ No newline at end of file
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><faul...
xmlns:valueNS='http://example.com/loan-approval/wsdl/'>valueNS...
xmlns:ns1='http://example.com/loan-approval/xsd/error-messages/'&...
\ No newline at end of file
Modified:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml 2009-11-23
15:06:00 UTC (rev 298)
@@ -1 +1 @@
-<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
\ No newline at end of file
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><faul...
xmlns:valueNS='http://example.com/loan-approval/wsdl/'>valueNS...
xmlns='http://example.com/loan-approval/xsd/error-messages/'>1...
\ 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 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-23
15:06:00 UTC (rev 298)
@@ -178,8 +178,6 @@
org.w3c.dom.Element resp=null;
javax.xml.namespace.QName faultName=null;
- try
- {
QName serviceQName = new QName(getNamespace(serviceName),
getLocalPart(serviceName));
// Create invocationContext
@@ -190,12 +188,7 @@
// invoke ODE
engine.invoke(invocationContext);
resp = invocationContext.getInvocationResult();
- }
- catch(BPELFault fault)
- {
- resp = fault.getFaultMessage();
- faultName = fault.getFaultName();
- }
+ faultName = invocationContext.getFaultName();
if (resp != null) {
ret = MessageFactory.getInstance().getMessage();
Modified:
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 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java 2009-11-23
15:06:00 UTC (rev 298)
@@ -35,6 +35,7 @@
{
private String operationName;
private QName serviceName;
+ private QName faultName;
private Element requestXML;
private Element responseXML;
@@ -48,6 +49,15 @@
{
return operationName;
}
+
+ public QName getFaultName()
+ {
+ return faultName;
+ }
+
+ public void setFaultName(QName fname) {
+ this.faultName = fname;
+ }
public QName getServiceName()
{
@@ -74,6 +84,7 @@
public void createFault(MyRoleMessageExchange mex)
{
this.responseXML = mex.getFaultResponse().getMessage();
+ this.faultName = mex.getFault();
}
public Element getInvocationResult()
Modified:
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/BPELInvokeTest.java
===================================================================
---
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/BPELInvokeTest.java 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/BPELInvokeTest.java 2009-11-23
15:06:00 UTC (rev 298)
@@ -614,13 +614,9 @@
TestBPELEngine bpelEngine=null;
javax.xml.namespace.QName faultName=new
javax.xml.namespace.QName("ns","lp");
- BPELFault fault=null;
-
- try {
- fault = new BPELFault(faultName,
(org.w3c.dom.Element)BPELInvoke.getNode("<data/>"));
+ try {
+ bpelEngine=new TestBPELEngine(faultName,
(org.w3c.dom.Element)BPELInvoke.getNode("<data/>"));
- bpelEngine=new TestBPELEngine(fault);
-
BPELInvoke invoke=new BPELInvoke(config);
invoke.setBPELEngine(bpelEngine);
@@ -656,13 +652,9 @@
TestBPELEngine bpelEngine=null;
javax.xml.namespace.QName faultName=new
javax.xml.namespace.QName("ns","lp");
- BPELFault fault=null;
-
try {
- fault = new BPELFault(faultName,
(org.w3c.dom.Element)BPELInvoke.getNode("<data/>"));
+ bpelEngine=new TestBPELEngine(faultName,
(org.w3c.dom.Element)BPELInvoke.getNode("<data/>"));
- bpelEngine=new TestBPELEngine(fault);
-
BPELInvoke invoke=new BPELInvoke(config);
invoke.setBPELEngine(bpelEngine);
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 2009-11-23
13:25:27 UTC (rev 297)
+++
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2009-11-23
15:06:00 UTC (rev 298)
@@ -18,11 +18,13 @@
package org.jboss.soa.esb.actions.bpel;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
+
import org.jboss.soa.bpel.runtime.engine.BPELFault;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;
import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -36,8 +38,9 @@
m_response = resp;
}
- public TestBPELEngine(BPELFault fault) {
- m_fault = fault;
+ public TestBPELEngine(QName faultName, Element faultResp) {
+ m_response = faultResp;
+ m_faultName = faultName;
}
public TestBPELEngine(String resp) throws Exception {
@@ -70,14 +73,10 @@
public void invoke(InvocationAdapter invocationAdapter)
throws BPELFault, Exception {
- if (m_fault != null) {
- throw m_fault;
- }
-
-
- ESBInvocationAdapter esbCtx = (ESBInvocationAdapter) invocationAdapter;
- m_request = esbCtx.getRequestXML();
- esbCtx.setResponseXML(m_response);
+ ESBInvocationAdapter esbCtx = (ESBInvocationAdapter) invocationAdapter;
+ m_request = esbCtx.getRequestXML();
+ esbCtx.setResponseXML(m_response);
+ esbCtx.setFaultName(m_faultName);
}
public void removeIntegrationLayer(IntegrationLayer il) {
@@ -96,5 +95,5 @@
private Element m_request=null;
private Element m_response=null;
- private BPELFault m_fault=null;
+ private QName m_faultName=null;
}