Testing the Component Interface Peoplesoft

Testing the Component Interface
To test the component interface, you search for the component interface to test, then you test
it.

To search for a component interface to test:
1. Open the component interface in PeopleSoft Application Designer.

2. Select Tools, Test Component Interface from the PeopleSoft Application Designer menu.
The Component Interface Tester search dialog box appears. This dialog box displays the
keys (in the left-hand columns) for getting, creating, or finding an instance of the
component interface. The right-hand columns provide a place for you to enter sample key
values for testing.

3. Enter key values.
a. Double-click the column to the right of any displayed keys.
b. Enter the value in the right-hand column.
The data that is used for the test corresponds to the key values that you enter here. In the
preceding example, we’ve entered an employee ID of 6602.

4. Specify whether to run in Interactive mode.
When in Interactive Mode, any action request occurs immediately. Each property being
set causes an immediate trip to the application server (or database server in two-tier
mode). This differs from non-interactive mode, in which actions are often held and later
sent in batches. For example, in non-interactive mode, if you set a property, the property
is not validated until you perform the save. However, in interactive mode the property is
validated immediately. This means that edit processing (and other processing, such as
FieldChange PeopleCode) occurs for each set property.
Whether you select this option depends on how you expect a particular component
interface to be used and what you are currently testing. In a real production system, this
parameter can significantly affect performance, but it makes little difference in the test
component. In non-interactive mode, errors and properties are not updated until a method
is run. By default, Interactive Mode is selected in the component interface tester.

5. Specify whether to get or edit history items.
Selecting Get History Items retrieves history data. Selecting Edit History Items enables
editing and saving of history data. These options apply to effective-dated fields only and
are equivalent to running in either Update/Display or Correction mode online. These
options are initially cleared.

6. Getting existing records for the test.
Clicking Get Existing is equivalent to opening a record in Update/Display or Correction
mode online. It retrieves one row from the database. After you click the Get Existing
button, the Component Interface Tester dialog box appears.

7. Getting existing records using partial keys.
If you want to retrieve a partial key, click the Find button. The Find Results dialog box
appears. You then can choose the specific instance by selecting and clicking the Get
Selected button. If you do not enter a partial key before clicking Find, all key values in
the database are returned (subject to the maximum count of 300, just as when online).
This is the same as calling the Find method through the Component Interface API,
followed by selecting a value from the Find results, setting the Get key, and calling the
Get method. After you click the Get Selected button, the Component Interface Tester
dialog box appears.

8. Creating new records for the test.
Clicking Create New is equivalent to creating a new row in Add mode online. If your
component does not support the Create method, this button is disabled. After you click
the Create New button, the Component Interface Tester dialog box appears.


Testing the Component Interface (after searching)


To test a component interface (after the search is performed):

1. Test component interface properties.
From the Component Interface Tester dialog box, change a value of a property, doubleclick
a value and enter a new value. Some basic validation is done when you leave the
field, which is equivalent to exiting a field using the TAB key in the online case. This
validation includes system edit, FieldChange PeopleCode events, and FieldEdit
PeopleCode events. Further validation may be done when the Save method is called
(SaveEdit, SavePreChange, Workflow, and SavePostChange). If errors or warnings are
encountered, they are displayed in the Error Message Log area at the bottom of the
window. The Error Message Log displays the same text that would appear in the
PSMessages collection of the Session object if you accessed the component through the
Component Interface API.

2. Test component interface methods by right-clicking the component interface name.
A pop-up menu appears showing the Save and Cancel standard methods and any userdefined
methods that exist for the component interface. The Find, Create, and Get
standard methods are not valid for an instantiated component, and therefore are not
shown.
If a component interface method requires one or more parameters, a dialog box in which
you can enter the parameters appears. After the method gets executed, the same dialog
box appears again, displaying changes to the parameters that were caused by the method.
The return value of the function appears in the title of the dialog box. If a component interface requires no parameters, you do not see the initial dialog but, you do see the
return value dialog box following the function call.
Note. Because running a component interface method can result in a change to the
component interface structure, PeopleSoft Application Designer always redraws the
component interface tree in its collapsed form following a method call.

3. Test collection methods by right-clicking the collection name.
A pop-up menu appears, showing the standard collection methods. Select the collection
method that you want to test for this component interface. After you select a collection
method to test, the Enter parameters dialog box prompts you to enter an item number for
the collection method that you are testing. The value that you enter for index [Number]
is used to retrieve, insert, or delete an item, according to the following rules.
After you enter an index number, the result appears in the dialog box. If there is a return
value, it is displayed in the title bar. Otherwise the message No value is displayed. Click
OK or Cancel to dismiss the dialog box.