Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2021.1

An interpreted data source is a tabular data source that is regarded by SOAtest as a relational representation repre-sentation of a Java object graph. An interpreted data source can be used to facilitate creation of multiple Java objects and object graphs that can be used as  as test parameter inputs by the EJB Client Tool and other SOAtest tools. For more information on the EJB Client tool, see see EJB Client.

Generating a Data Source from the fields of a Java Bean

...

  1. Do one of the following:
    • For test suite level data sources, select the desired test suite node and click the Add Database toolbar button Image Removed. toolbar button.

      Image Added

    • For project level data sources, right-click the related project’s Test Case Explorer node, then choose Add New > New> Data Source.
    • For global level data sources, right-click the Test Case Explorer’s Global Data Sources node, then choose Add New > New> Data Source.
  2. Select Bean Wizard and click Next. The Bean Wizard dialog appears dialog displays.



  3. Complete the following options in the Bean Wizard dialog:
    • Destination Type: Select the type of table template you would like to create from the drop-down menu.
    • Destination Directory: Specify where the tables will be written.
    • Write Over Existing Files: Specify whether you want to overwrite existing files.
    • Java Class: Specify the class for which you would like to create a tabular representation.
    • Trace Dependencies: Select either Yes or No for trace dependencies. Selecting Yes prompts SOAtest to generate tables for types of class member variables “reachable” from the “root” class that you specified in the Java Class field.
  4. Click the Next button. The Dependencies dialog appears dialog displays.
  5. Select the desired type dependencies from the Generate Table for Classes list.
  6. Click the Finish button to generate the tables. The tables will be created in the designated directory and a data source for each file will be added to the test suite you selected.

...

As an example, let us consider an object graph with CreditCardDO as a root. CreditCardDO contains instances of PersonDOand AddressDO and a Vector of ActivityDO type objects.

 

public class CreditCardDO extends PaymentMethodDO implements Serializable
{
    protected String ccNumber;    
    protected Date expirationDate;
    protected PersonDO ccHolder;
    protected AddressDO billingAddress;
    protected Vector recentActivity = new Vector();
  
    // set…()/get…() methods omitted
}
public class PaymentMethodDO implements Serializable {
    protected String bankName;
  
    // set…()/get…() methods omitted
}
public class AddressDO implements Serializable {
    protected String streetAddress;    
    protected String city;
    protected int zipCode;
    protected String state;
  
    // set…()/get…() methods omitted
}
public class PersonDO implements Serializable {
    protected String firstName;
    protected String lastName;
  
    // set…()/get…() methods omitted
}
public class ActivityDO implements Serializable {
    private float amount;
    private String description;
  
    // set…()/get…() methods omitted
}

 

The following tables illustrate how the above object graph example can be represented in tabular format:
Table CreditCardDO.csv

soatest.examples.CreditCardDO
bankName
billingAddress ref
ccHolder ref
ccNumber
expirationDate
recentActivityref 
1SampleBankAddressDO 1PersonDO 1

1234123412341

234

8/31/2005RecentActivities-1

Table AddressDO.csv

soatest.examples.AddressDO
city
state
streetAddress
zipCode
1Los AngelesCA101 E. Huntington Dr.91016

Table PersonDO.csv

soatest.examples.PersonDO
firstName
lastName
DonaldDuck

Table ActivityDO.csv

soatest.examples.ActivityDO
amount
description
soatest.examples.ActivityDO
amount
description
11010 Charge-10
22020 Charge-20
33030 Charge-30
44040 Charge-40
55050 Charge-50
66060 Charge-60
77070 Charge-70
88080 Charge-80
99090 Charge-90
10100100 Charge-100

Table RecentActivities-1.csv

ActivityDO ref
ActivityDO 1
ActivityDO 2
ActivityDO 3