Previous Topic: Using Data Sets in the COENext Topic: Usage Scenarios for Complex Objects


Usage Scenarios for Simple Objects

The following examples are based on the standard Java classes for simple objects. We have used classes from the demo server included with DevTest that are easy to reproduce in your environment.

Simple DTO Object Scenario 1

A simple DTO com.itko.examples.dto.Address has been loaded in the COE using a Dynamic Java Execution step. The Address class has simple properties only.

A simple DTO com.itko.examples.dto.Address has been loaded in the COE using a Dynamic Java Execution step

For a simple DTO, parameter values can be entered into the Data Sheet panel as fixed values or properties. In the previous example, city could be set equal to the property currentCity.

To enter parameters using the DTO setters in the Call sheet panel:

COE Call Sheet tab with getter selected

  1. In the Call Sheet tab, select a getter, such as setCity(java.lang.String city) and click Icon - right arrow Add Method.

    The method runs and COE opens in the Call tab.

    COE Call tab opened

  2. Enter the parameter value as a fixed value or a property. Use the DevTest property syntax, propname.
  3. Click the Execute button to invoke the method.
  4. Repeat this procedure to set other DTO properties.

Simple Java Object Scenario 2

A simple Java object, java.util.Date, has been loaded in the COE using a Dynamic Java Execution step.

A simple Java object, java.util.Date, has been loaded in the COE using a Dynamic Java Execution step

In this case, Expert Mode must be used, because the Date type is not a DTO. In fact the COE forces Expert mode.

COE in Expert Mode

But we can still enter parameter values and invoke methods. In the previous example, we execute the parse method, which requires one input parameter. We have entered it as a string value, 9/1/2007.

Note: In Expert Mode, we use the Null or Use Property check box to denote the parameter type. If neither is selected, fixed value is entered. We would not use the {{ }} property syntax here. Even if we were entering a property rather than a string value, we would enter only the property name.

Because we are in Expert Mode, we can add inline filters and assertions.