FAQ

ETLUnit 3.9.6

 

Draft in Progress

This document is a draft and is under development.

 

Commonly Asked Questions

 How can I avoid typing in my own test data?

1) Create a text database file with one column.  For the sake of example, let's say it has ten rows.  That means it looks like this:

MyOneColumnDataFile
1
2
3
4
5
6
7
8
9
10

 

2) Change its line endings to UNIX style, if they are not already in that format (LF instead of CR/LF).

3) In an ETLUnit test method, in the assert function, make this data file the source.

4) Provide a target-table attribute in the assert() function.  That is the table you want the data written to.

5) Provide a target-schema property.

6) Make a file-reference-type referring to the fml that will be used to take the one column data you are offering as source and convert it to the multi-columned format you desire.  Include just the id column, to match your source.

MyUnitTest.etlunit reference-file-type
reference-file-type: {
    version: "edwpet.79",
    column-list-mode: 'include',
    column-list: [
        'DISTRIBUTION_CENTER_ITEM_SK',
        'POPULATION_END_DATE'
    ]
}

7) Turn on "Refresh Assertion Data" in the CLI.

8) Run the test over this test method.

9) The table will be generated by name, and in its proper place in the folder structure.

TODO:  Provide more complete sample code HERE.

 How can I test only fields I am interested in?

TODO:  Brief FML how-to. 

TODO:  Include links to FML syntax page in the user manual.

 What are the rules for using FML files in my ETLUnit test classes?

TODO:  FML implementation's search order

TODO:  Include link to FML syntax page in the user manual

TODO:  Which functions support file-reference-type.

 I want to use an FML file, but I don't want to type in all that code.What are the shortcuts to creating an FML file?

TODO: Provide alternatives.

  • If you have a separate database schema project, look for an FML file there that was written for the table you are using.  If found, copy the FML file from the schema project and make appropriate changes.
  • Make the fml file unavailable to the test and let the test generate an fml file for you.  Copy it under the src/main/reference/file/fml folder as to the location you choose.
 How can I test an SQL script?

TODO:  Provide a brief step-by-step here.

 Can I run a user-defined suite of tests?

Annotate the tests you want to run with the @JoinSuite annotation.

TODO:  Add a "See more information HERE" link.