| # How to test the Show or List method This topic describes how you can test the public Show and List methods of a Business Object. Procedure To test the Show method, take the following steps: Enter the request argument: enter the object ID, for example, the order number, to be retrieved by the Show method. Select the attributes to be retrieved. Optionally, define a filter or a condition. To test the List method, take the following steps: Select the attributes to be retrieved Optionally: define a filter or a condition. Refer to the following sections for more details. XML schema file request The following figure shows the XML schema file of the Request argument of the Show method of the Order (tlbct790) Business Object. Schema file tl bct bl790shrq0000.xsd tlbct790-Show-Request The following figure shows the details of the LogicalExpression and ComparisonExpression elements in the Request argument. Schema file tl bct bl790shrq0000.xsd tlbct790-Show-Request - continued The XML schema file of the Request argument of the List method is nearly equal: Schema file tl bct bl790blrsq0000.xsd tlbct790-List-Request The SelectionAndFiltering part is equal for the Show and List method. The difference between Show and List is that Show is working on one object that must mandatorily be filled in the XML message. Filtering is applicable not only for the List method, but also for the Show method, because you can apply filtering on the components, such as order lines, in a Business Object, for example: show order X, but give me only order lines with quantity greater than 1 and item equal to "some-item". Enter request Click Enter Request to define the Request argument for the Show method. If you click this button, a Graphical Browser appears, in which you must enter the object ID, for example, the order number, to be retrieved by the Show method: Save the Request argument and close the graphical browser to return to the BOL Test Tool - Public Layer (tlbct3250m000) session. Note For the List method, the Enter Request button is unavailable. The objects that the List method retrieves are determined purely by the filter specification. Refer to the following section for details. Define selection The selection is part of the XML Request argument. To define the selection, click Define Selection. The following Graphical Browser appears: The Graphical Browser lists all the attributes on which a selection is permitted. This list of allowed attributes is defined in the XML schema, which is part of the filterAttributeList. If you right-click an attribute, a shortcut menu with the following options appears: Select: The attribute is colored blue, which means that this attribute will be part of the response message. For color-blind users, the keyword [Selected] is added. Deselect: The attribute returns from the color blue to black. The attribute is no longer part of the response message. For color-blind users, the keyword [Selected] is removed. Users can select attributes either one-by-one or all-at-once. To select attributes all-at-once, first close the SelectionList folder, and subsequently use the shortcut menu on the keyword SelectionList: The result if you click Select and subsequently open the folder is as follows: Close the Graphical Browser when you finish selecting attributes. The test tool stores your selection automatically. Define filter The filter is part of the XML Request argument. To create a filter, click Define Filter. The graphical browser for filtering starts. The graphical browser checks whether a filter is already defined for the current test case. If no filter exists, the following question appears: Click Filter if you want to specify a single condition: one condition on one attribute. The Filter Attribute (tlbct3200m000) session starts, in which you must specify the attribute, operator, and value for the condition. The following figure shows an example of a filter created in this session: Click Condition if you want to specify multiple conditions, for example, to specify a condition for three attributes. You must select a boolean operator (AND/OR), and for each attribute, specify the attribute name, a logical operator, and a value. For more details, refer to Condition, later in this topic. Condition To create a condition, click Define Filter and click Condition. The following question appears: Select the desired operator. The boolean operator is required to link two conditions. If you choose And, you can always change this operator later to Or, and vice versa. As a result (default) two arguments appear in the Graphical Browser. You must fill each of these arguments. If you right-click an argument, a shortcut menu appears with the following options: Insert Comparison Expression This option starts the Filter Attribute (tlbct3200m000) session, in which you must specify the attribute, operator, and value for the condition. The result is, for example: If a comparison expression contains no data, this is reported by the Check Syntax command that is available on the Specific menu on the Menu Browser. The following message appears: "Comparison Expressions found that are not filled. Fill or remove empty Comparison Expressions." Insert Or This option fills the argument with an Or and creates two subfolders with the name "<Argument>", for the Or. The following figure provides an example: Insert And This option fills the argument with an And and creates two subfolders with the name "<Argument>", for the And. The following figure provides an example: All <Argument>'s must be filled or deleted. You can check this through the Check Syntax command that is available on the Specific menu on the Menu Browser. The following warning appears: "<Argument>'s found. Replace or remove." A possible complete filter is: If you run Check Syntax on this example, the following message appears: "Filter specification is correct." Note You can use the shortcut menu to change an And to an Or, and vice versa. In addition, you can also add an <Argument> folder. The following figure provides an example: Perform test After you create the Request argument, you can run the test. Click Execute Test. Refer to Execute test for more details. View response The following figure provides an example of a show result: View result The following figure provides an example of a possible error: Related topics How to test public methods for Infor LN How to test protected methods for Infor LN Modeling a Business Object |