| How to test the Create method |  |
| This topic describes how you can test the public Create method of a Business Object. XML schema file Request The following figure shows the XML schema file of the Request argument of the Create method of the Order (tlbct790) Business Object. tl bct bl790bcrrq0000.xsd tlbct790-Create-Request Enter request Start the BOL Test Tool - Public Layer (tlbct3250m000) session and enter the Business Object and the method to be tested. Click Enter Request. A graphical browser starts, in which you must define the request argument for the Create method. The folders and leaves of the browser are based on the XML schema that belongs to the BOL method's request argument. Folders and leaves (attributes) for which data entry by the user is obligated are marked with a red asterisk: Folders (Business Object components) that repeat are identified with a special icon (Order and Line are repeating): Because the public layer is set-oriented, you can create multiple orders as part of a single message. For one order, one header exists and you can enter multiple lines. You can also read that header and line is mandatory for an order, an order cannot exist without a header, and a minimum of one line. The browser starts with one object, for example, one order, and a single component, for example, one line. If multiple orders or lines are required, you must use the Copy and Paste buttons. First, select the folder that you want to copy, click Copy, and click Paste. The following figure provides an example of the result: Double-click an attribute, or right-click an attribute, and on the shortcut menu, click Instance Value, to start the Instance Value (tlbct3210m000) session, in which you can enter the value for the attribute. Note For attributes for which no specific data is entered, you must explicitly make the following choice for each attribute: Click Delete to remove the attribute. Deleting an attribute is interpreted as the client application not having a value for this specific attribute. In technical terms, the public layer does not call a setter from the protected layer. The DAL is free to update this field with the default ERP value. Keep the attribute. The client or the tester has the choice to fill the attribute with a blank or zero value. In technical terms, the public layer calls a setter from the protected layer, and passes the value as blank. The DAL cannot update this attribute with a value. The Specific menu on the Menu Browser contains the following commands: Check Consistency: This option provides a warning for each Mandatory attribute for which no value is entered. For example, if the mandatory material attribute is not filled, the "Mandatory node material not filled" message appears. Create Request Argument: If you click this command, the user's data entry is approved and actualized. Changes that are not activated are lost. Clear Value: All data that is entered and activated, as described in the Create Request Argument option, is cleared. Undo Changes: All data entry and modifications that the user makes but that are not yet activated are rolled back. To roll back the activated changes, click the Clear Value command. Tip: to print the test data you enter, click Print in the Menu Browser. Save the Request argument and close the graphical browser to return to the BOL Test Tool - Public Layer (tlbct3250m000) session. Execute test When the Request argument is created, you can run the test. Click Execute Test. The public layer is now called for the selected BOL method. The Request argument is sent as input to the method's interface. Note that before you carry out the test, you can place the public layer and protected layer DLLs in debugger. You can do this, for example, in case you want to apply white box testing to check the internal details of the execution. If the method finishes successfully, the Response Graphical Browser appears automatically. If the method fails, the Result Graphical Browser appears automatically. View response If the execution is successful, that implies that no data errors are found, and a new object is created. For example: View result A possible error is an application logic error from the DAL: Related topics How to test public methods for Infor ERP LN How to test protected methods for Infor ERP LN To Model a Business Object |