set
Draft in Progress
This document is a draft and is under development.
Description
- Set a variable to the provided value.
- The variable will be resolved based on the context of the test.
- When testing Informatica workflows, for instance, the variable may refer to a variable name in the workflow's parameter (.PRM) file.
Attributes
variable: - >> TYPE: string - - REQUIRED
value: - >> TYPE: string - - REQUIRED
Examples
Prerequisites
etlunit-core
dependency in POM.
<dependencies> <dependency> <groupId>org.bitbucket.bradleysmithllc.etlunit</groupId> <artifactId>etlunit-core</artifactId> <version>${etlunit.project.version}</version> </dependency> </dependencies>
Informatica set()
Example
In the following example, the set() operation is used to set parameters needed by the Informatica workflow. When execute()
is run, the variables needed by the workflow have their needed values.
@Database(id: 'qpt_pet', modes: ['tgt', 'src'])
class load_bucket_payment_stg
{
...
@BeforeTest
setVariables()
{
set(
variable: 'population_date',
value: '20140922'
);
}
@Test
run_test_PRODMVMT()
{
stage(
source: 'BUCKET_PAYMENT_AUD_TEST_PRODMVMT',
target-table: 'BUCKET_PAYMENT_AUD_V0203_20141109',
target-schema: 'AUD',
mode: 'src'
);
set(variable: 'parm-key', value: 'U6B98WM3');
set(variable: 'file-spec', value: 'PRODMVMT');
execute(
workflow: 'wkf_LOAD_BUCKET_PAYMENT_STG',
folder: 'EDW_QPT_BUCKET',
context:
{
pet-connection-src: 'informatica.connections.qpt_pet.src',
pet-connection-lkp: 'informatica.connections.qpt_pet.src',
pet-connection-tgt: 'informatica.connections.qpt_pet.tgt'
}
);
assert(
source-table: 'BUCKET_PAYMENT_STG',
source-schema: 'STG',
target: 'BUCKET_PAYMENT_STG_TEST_PRODMVMT',
column-list-mode: 'exclude',
column-list: ['BUCKET_PAYMENT_SK']
);
}
}