Using the batch processor it is possible to create test scripts. The batch processor can be configured to read from a database connection, or a directory of CSV files, so that it can generate a large number of test cases based on real-world data. The steps to create test scripts from existing data are:
Data can be read from a directory of files containing data formatted as comma-separated values (CSV). The files containing the data to be read must end with the .csv extension.
The batch processor supports a configuration-free option for CSV files as long as they follow the conventions below:
A special case is where a CSV file represents a many-to-many relationship. In that case the name of the document needs to correspond to the public name of one of the directions of the relationship. The CSV document is then required to have two columns with the first column having foreign key references to source entity instances and the second column with foreign key references to target entity instances (source and target are from the perspective of the side of the relationship used for the name of the document).
The expected format for attribute values is:
Value Type | Format Description | Blank Value |
---|---|---|
Number |
Numeric values must adhere to the following conditions:
|
Blank values are considered UNCERTAIN |
String | String values will be read as-is | Blank string values are considered to be a blank value |
Boolean |
Boolean values must adhere to the following conditions:
|
Blank values are considered UNCERTAIN |
Date |
Date values must adhere to the format "yyyy-MM-dd" where:
|
Blank values are considered UNCERTAIN |
Datetime |
Datetime values must adhere to the format "yyyy-MM-dd HH:mm:ss" where:
|
Blank values are considered UNCERTAIN |
Time |
Time values must adhere to the format "HH:mm:ss" where:
|
Blank values are considered UNCERTAIN |
If there is only a single CSV file in the folder, or one of the CSV files is "global.csv" then it is presumed to be the 'base' table, otherwise the base table needs to be specified. For example, a folder may contain "parent.csv" and "child.csv" - without specifying which is the base table, the batch processor won't know whether it should be processing cases for parents or children. Note that once a base table is established, other tables will be brought in as required by containment or reference relationships.
You can use Excel to perform batch generation of test scripts for Oracle Policy Modeling. You just need to convert the data into CSV format first. To do this:
# | income |
---|---|
1 | 0 |
=a2+1 | =b2+1000 |
The batch processor is invoked from the command line. To generate a test script you will need to specify at least the following parameters:
Note that the data source can be specified in the XML configuration file to be used by the batch processor instead of as a command line parameter.
For more details, see the Batch Processor section of the Oracle Policy Automation Developer's Guide.
In the Oracle Policy Modeling project, add the generated tsc file from the previous step (File | Add |Add Existing File...). You can then use the regression tester in OPM to customize the test script. See Define, modify or remove test scripts for more information.
See also: