Processing an Order in a Purchase Order System Tutorial
Test the Project
The Test run feature allows you to test run your processes. BPEL processes are deployed to the BPEL runtime, which manages the process lifecycle.
Testing the HTTP Binding Component Sample Project
To run the HTTP-SOAP-PO-JBI project:
- From the NetBeans IDE Projects window, right click Test under HTTP-SOAP-PO-JBI, and select New Test Case from the pop-up menu. The New Test Case Wizard appears.
- From the New Test Case Wizard, type HTTPBC-Test1 as the Test Case Name, and click Next.
- From the Select the WSDL Document page of the wizard, expand the HTTP-SOAP-PO-BPEL node in the Select the WSDL Document field, and select POService.wsdl . Click Next.
- From the Select the Operation to Test page of the wizard, select the handlePurchaseOrder operation in the Select the Operation to Test field, and click Finish.
The Input.xml code is displayed in the Source Editor.
- From the Source Editor, make the following changes to the Input.xml code:
- Change the purchase order ID value in line 4 of the source code to 1234.
- Change the customer ID value in line 5 of the source code to 5678.
- Change the purchase order description value in line 6 of the source code to OrderVal_any_description.
- Delete the value given for purchase price in line 7 of the source code.
Note: To display line numbers, right-click the left frame of the Source Editor and select Show Line Numbers from the pop-up menu.
- Click Save All to save your work.
- From the IDE's Projects window, right-click HTTPBC-Test1 and select Run.
- The first time you test run the project, the project fails and an Overwrite Empty Output message appears. Click Yes to save your current output file as the test output.
- Now that your project has a test output message, run the test again. Right-click HTTPBC-Test1 and select Run.
- Check the IDEs JUnit Test Results window to verify that the test passed successfully.
- From the Projects window, double-click Output, under HTTP-SOAP-PO-JBI → Test → TestCase1. The message output, including the purchase price in line 8 of the code, is displayed in the Source Editor.
Note - You can also create a test case to check the Inventory Service by selecting InventoryService.wsdl as the WSDL document, and isInventoryAvailable as the operation.
In this tutorial, you created a purchase order composite application project that uses the HTTP Binding Component. In doing so, you created a BPEL Module project named HTTP-SOAP-PO-BPEL, which includes two XML Schemas, two WSDL documents, and two BPEL processes. Next, you created a composite application project named HTTP-SOAP-PO-JBI, added your HTTP-SOAP-PO-BPEL project to the composite application as a JBI module, and deployed the composite application project. You then tested your composite application.