Testing a Published Business Service
You must perform unit testing for the published business service (and business service) that you develop to ensure that the service works as intended. Because published business services depend on the JD Edwards EnterpriseOne system, most of the testing is actually integrated testing. Unit testing should include scenarios that test all decision points in the code. Here are some possible unit tests:
Test for each action code that is passed, for example, add, change, cancel.
Test 1 line, 5 lines, 0 lines.
Perform negative tests.
You can use any of the following methods to test objects in your code:
Create a test harness class to test the different functions of the published business service.
If you create a test harness, you must call business service foundation methods at the start and finish of the test to shut down the process within JDeveloper. You can use the code template E1Test – EnterpriseOne Test Harness Class to generate the framework for your test harness application. You can use this code sample as a model for creating a test harness:
public static void main(String[] args) throws BusinessServiceException{ try{ //call required prior to starting test from application (main()) TestBusinessService.startTest(); //call test method testAddNoPhone(); } finally{ //call required after completing test from application (main()) TestBusinessService.finishTest(); } }
Use the JUnit extension for JDeveloper and create test cases that test the functionality of the published business service.
JUnit provides a way of running all tests in a suite and can write assertions to determine whether a test passed or failed.
Test all functionality through the web service graphical user interface that JDeveloper offers.
When you use this method, you can save and rerun XML documents.