Author: objectiser
Date: 2009-10-29 11:30:55 -0400 (Thu, 29 Oct 2009)
New Revision: 212
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq2.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq3.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml
trunk/samples/quickstart/loan_approval/messages/loanreq3.xml
Removed:
trunk/samples/quickstart/loan_approval/bpel/loan_approval.cbp
trunk/samples/quickstart/loan_approval/bpel/output/
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/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java
trunk/samples/quickstart/loan_approval/build.xml
trunk/samples/quickstart/loan_approval/readme.txt
trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java
Log:
Added fault generation to loan_approval example, when amount is > 20000 - currently
causes exception in server (RIFTSAW-90). Also added to integration tests, but currently
commented out this failing test case.
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-10-29
04:24:00 UTC (rev 211)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java 2009-10-29
15:30:55 UTC (rev 212)
@@ -42,10 +42,26 @@
TEST_NAME,
"Quickstart_bpel_loan_approval-1.jar,Quickstart_bpel_loan_approval.war"));
}
- public void testSendHello() throws Exception {
+ public void testSendLoanRequest1() throws Exception {
String result=sendSOAPMessage("loanreq1.xml",
"http://localhost:8080/bpel/processes/loanService");
assertMessageFromFile(result, "loanresp1.xml");
}
+
+ public void testSendLoanRequest2() throws Exception {
+ String result=sendSOAPMessage("loanreq2.xml",
+ "http://localhost:8080/bpel/processes/loanService");
+
+ assertMessageFromFile(result, "loanresp2.xml");
+ }
+
+ /*
+ public void testSendLoanRequest3() throws Exception {
+ String result=sendSOAPMessage("loanreq3.xml",
+ "http://localhost:8080/bpel/processes/loanService");
+
+ assertMessageFromFile(result, "loanresp3.xml");
+ }
+ */
}
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq2.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq2.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq2.xml 2009-10-29
15:30:55 UTC (rev 212)
@@ -0,0 +1,10 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://example.com/loan-approval/wsdl/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:request>
+ <firstName>Fred</firstName>
+ <name>Bloggs</name>
+ <amount>11000</amount>
+ </wsdl:request>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq3.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq3.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq3.xml 2009-10-29
15:30:55 UTC (rev 212)
@@ -0,0 +1,10 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://example.com/loan-approval/wsdl/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:request>
+ <firstName>Joe</firstName>
+ <name>Bloggs</name>
+ <amount>21000</amount>
+ </wsdl:request>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml 2009-10-29
15:30:55 UTC (rev 212)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
and Approved</accept></message></env:Body></env:Envelope>
\ No newline at end of file
Added:
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
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp3.xml 2009-10-29
15:30:55 UTC (rev 212)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
\ No newline at end of file
Modified:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java 2009-10-29
04:24:00 UTC (rev 211)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java 2009-10-29
15:30:55 UTC (rev 212)
@@ -12,20 +12,22 @@
@WebService(targetNamespace = "http://example.com/loan-approval/wsdl/",
endpointInterface="com.example.loan_approval.wsdl.LoanApprovalPT",
portName="loanApprover_Port")
public class LoanApprovalPTImpl implements LoanApprovalPT {
-
- public String approve(
- String firstName,
- String name,
- BigInteger amount)
- throws ErrorMessage {
- System.out.println("\nLoanApprovalPTImpl");
-
System.out.println("*************************************************");
- System.out.println("firstName Parameter: " + firstName );
- System.out.println("name Parameter: " + name );
- System.out.println("amount Parameter: " + amount );
-
System.out.println("*************************************************");
- System.out.println("\n");
- return "Evaluated and Approved";
- }
+
+ public String approve(String firstName, String name,
+ BigInteger amount) throws ErrorMessage {
+ System.out.println("\nLoanApprovalPTImpl");
+ System.out.println("*************************************************");
+ System.out.println("firstName Parameter: " + firstName );
+ System.out.println("name Parameter: " + name );
+ System.out.println("amount Parameter: " + amount );
+ System.out.println("*************************************************");
+ System.out.println("\n");
+
+ if (amount.intValue() >= 20000) {
+ throw new ErrorMessage("Amount too large", amount);
+ }
+ return "Evaluated and Approved";
+ }
+
}
Deleted: trunk/samples/quickstart/loan_approval/bpel/loan_approval.cbp
===================================================================
(Binary files differ)
Modified: trunk/samples/quickstart/loan_approval/build.xml
===================================================================
--- trunk/samples/quickstart/loan_approval/build.xml 2009-10-29 04:24:00 UTC (rev 211)
+++ trunk/samples/quickstart/loan_approval/build.xml 2009-10-29 15:30:55 UTC (rev 212)
@@ -86,4 +86,32 @@
</java>
</target>
+ <target name="sendloanreq2">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/bpel/processes/loanService"/>
+ <arg value="messages/loanreq2.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="sendloanreq3">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/bpel/processes/loanService"/>
+ <arg value="messages/loanreq3.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
</project>
Added: trunk/samples/quickstart/loan_approval/messages/loanreq3.xml
===================================================================
--- trunk/samples/quickstart/loan_approval/messages/loanreq3.xml
(rev 0)
+++ trunk/samples/quickstart/loan_approval/messages/loanreq3.xml 2009-10-29 15:30:55 UTC
(rev 212)
@@ -0,0 +1,10 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://example.com/loan-approval/wsdl/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:request>
+ <firstName>Joe</firstName>
+ <name>Bloggs</name>
+ <amount>21000</amount>
+ </wsdl:request>
+ </soapenv:Body>
+</soapenv:Envelope>
Modified: trunk/samples/quickstart/loan_approval/readme.txt
===================================================================
--- trunk/samples/quickstart/loan_approval/readme.txt 2009-10-29 04:24:00 UTC (rev 211)
+++ trunk/samples/quickstart/loan_approval/readme.txt 2009-10-29 15:30:55 UTC (rev 212)
@@ -11,11 +11,9 @@
10000 are considered low risk.
If the loan amount is greater or equal to 10000, then it will invoke
-the loan approver service.
+the loan approver service. If the amount is greater than 20000, then the
+approver will return a fault, indicating that the amount is too much.
-If the approver service is invoked, its response will be returned back
-to the customer. Currently this service will approve all requests.
-
To deploy the example, open a command line window in the example's folder,
and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
@@ -26,7 +24,8 @@
Alternatively, use the 'ant sendloanreq1' command (from a command line window)
to send an example loan request message with amount less than 10000
directly to the deployed process. Or use the command 'ant sendloanreq2' to
-send a loan request with amount greater or equal to 10000.
+send a loan request with amount greater or equal to 10000. Or use command
+'ant sendloanreq3' to send an amount greater than 20000.
NOTE: The "ant deploy" command will by default deploy version 1 of the
example to the server. If you wish to change the example, and redeploy,
Modified:
trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java
===================================================================
---
trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java 2009-10-29
04:24:00 UTC (rev 211)
+++
trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/LoanApprovalPTImpl.java 2009-10-29
15:30:55 UTC (rev 212)
@@ -12,20 +12,22 @@
@WebService(targetNamespace = "http://example.com/loan-approval/wsdl/",
endpointInterface="com.example.loan_approval.wsdl.LoanApprovalPT",
portName="loanApprover_Port")
public class LoanApprovalPTImpl implements LoanApprovalPT {
-
- public String approve(
- String firstName,
- String name,
- BigInteger amount)
- throws ErrorMessage {
- System.out.println("\nLoanApprovalPTImpl");
-
System.out.println("*************************************************");
- System.out.println("firstName Parameter: " + firstName );
- System.out.println("name Parameter: " + name );
- System.out.println("amount Parameter: " + amount );
-
System.out.println("*************************************************");
- System.out.println("\n");
- return "Evaluated and Approved";
- }
+
+ public String approve(String firstName, String name,
+ BigInteger amount) throws ErrorMessage {
+ System.out.println("\nLoanApprovalPTImpl");
+ System.out.println("*************************************************");
+ System.out.println("firstName Parameter: " + firstName );
+ System.out.println("name Parameter: " + name );
+ System.out.println("amount Parameter: " + amount );
+ System.out.println("*************************************************");
+ System.out.println("\n");
+
+ if (amount.intValue() >= 20000) {
+ throw new ErrorMessage("Amount too large", amount);
+ }
+ return "Evaluated and Approved";
+ }
+
}