How to test protected methods for LNThis topic describes how you can test the protected layer of the BOL software before you expose the layer to the outside world. Introduction Using the Business Object Layer (BOL), LN is open towards other ERP components and other external software. Before you expose the BOL software to the outside world, you must test the code to assure quality. One way to test this code is to write test code that calls the methods. This process, however, is cumbersome and time consuming. Therefore, a tool has been developed that will assist the engineer when performing this task. The test utility enables the ERP software engineer to test a protected BOL method by specifying the Business Object and method name. The tool analyzes the BOR and asks for the value of the input parameters. If you click Test, the method will be executed and the output parameters appear on the screen. Procedure To test a protected method, take the following steps:
For details on these steps, refer to the BOL Test Tool - Launcher and BOL Test Tool – Tester. BOL Test Tool - Launcher For details on the BOL Test Tool - Launcher, click the following link: BOL Test Tool - Protected Layer (tlbct2210m000) BOL Test Tool – Tester Via the BOL Test Tool Launcher (BOL Test Tool - Protected Layer (tlbct2210m000) session) you have specified which method from which Business Object to test. Based on this information, a specific test program performs the actual test. Three temporary sessions (BOL Test Tool – Tester parts one through three) appear, in which you can specify input arguments and their values and view the results. The screens of these sessions have the following structure:
The following figure shows an example of the first temporary session: BOL Test Tool – Tester part one Define the input arguments to be used. Click Continue to go to the next screen. The following figure shows an example of the second temporary session: BOL Test Tool – Tester part two Enter the input arguments values. You only have to enter the input parameters values and click Test to run the method and see the result of the output arguments, return value, and error message. The following figure shows an example of the third temporary session: BOL Test Tool – Tester part three Click Continue to go back to the first screen. Note Each time you click Cancel (or ESC) followed by Launch again, a complete new test program is generated. For this reason, use Continue whenever possible to reuse the current test object. Supported features
Company handling The tool must deal with various data sets ( companies) and can cause some confusion when you look at the bottom-right corner of the screen: The following datasets are used:
Developers mode You can start the test tool in developers mode to control the test script that is run. In developers mode, the test tool provides various extra options, for example, to monitor the program flow, and to edit, compile and run the generated test script manually. Refer to BOL Test Tool - Protected Layer (tlbct2210m000) for details. To start the test tool in developers mode, you must add the
following line to the Command field of your BW Configuration
file: Intermediate files The following files are created on the $BSE_TMP directory:
Program Flow
| |||||||||||