Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
_This_Is_a_Draft
_This_Is_a_Draft
Anchor
top
top

Table of Contents

Creating a New Test Class

How to Create a Test Class

Create an ETLUnit test class with any ASCII compatible text editor.

Test Class File Naming

  • The name of the file containing the test class should end with the extension, '.etlunit.'
  • The file name does not have to have the same name as the test class.
  • The file may contain multiple test classes.

Test Class Content Format

The syntax used in ETLUnit test classes is proprietary to ETLUnit.  In appearance, it appears to be a cross between an object oriented programming language like Java, and JSON syntax. SEE the Test Class Declaration example below.

Go to top

 

Syntax for a Test Class

Sample Test Class

Below is a sample ETLUnit test class.  It runs tests against Informatica work flows.

Include Page
_ETLUnit_Full_Test_Class_Example
_ETLUnit_Full_Test_Class_Example

Go to top

Parts of a Test Class

Annotations

Annotations may be placed at the file, class or method levels.  Annotations begin with the '@' symbol.  Here is an example.

Include Page
_Annotations_Example
_Annotations_Example

 

Test Class Declaration
Anchor
Test_Class_Declaration
Test_Class_Declaration

A single ETLUnit test file may have any number of test classes in it.  It is good form to try to stick to only one test class per test file, and to use the same name for both the file and the declared test class.

...

Include Page
_Test_Class_Example
_Test_Class_Example

Test Method Declaration

The test method sets apart a single 'test.'  A test class may have any number of test methods.

Include Page
_Test_Method_Example
_Test_Method_Example

Operations

Some common test operations are:

  • stage()  - - Sets up data, typically to be used by the execute().
  • set()  - - Sets a variable.
  • execute()  - - Represents the process being tested.
  • assert()set()  - - Test an assumption against the actual artifact or condition.
  • assert-log()  - - Test an assumption against the actual log file.

 

Include Page
_Test_Operations_Example
_Test_Operations_Example

Comments

There are two ways to include comments in an ETLUnit test class file.

Include Page
_Comment_Lines_Example
_Comment_Lines_Example

Dig deeper

Child pages (Children Display)

Go to top