09.04 - Build-in shortcuts (macros)
# LOAD_FFF {fixed_field_file_path} USING {fixed_field_file_descriptor_path} AS {fixed_field_file}
What: This macro will load the fixed field file descriptor and the fixed field file. Then it will verify that the fixed field file is valid by using the fixed field file descriptor. And at least it checked that the fixed field file has the expected autonumbers. The macro will also convert the fixed field file into a resource of type fixed.fileld.file.
# LOAD_FFF {fixed_field_file_path} USING {fixed_field_file_descriptor_path} AS {fixed_field_file}
=>
LOAD {fixed_field_file_descriptor_path} AS __temp{%%rand1}.file
CONVERT __temp{%%rand1}.file TO fixed.field.file.descriptor(descriptor) AS __temp_{%%rand2}.fff.descriptor
LOAD {fixed_field_file_path} AS __temp{%%rand3}.file
CONVERT __temp{%%rand3}.file TO fixed.field.file(structured) USING __temp_{%%rand2}.fff.descriptor AS {fixed_field_file}
ASSERT {fixed_field_file} IS valid
ASSERT {fixed_field_file} HAS expected.autonumbers
Input:
{fixed_field_file_path}: The path to the fixed field file (relative to the root of the repository)
{fixed_field_file_descriptor_path} : The path to the fixed field file descriptor (relative to the root of the repository)
Output:
{fixed_field_file}: The name (in the context) of the fixed field field
Example:
# LOAD_FFF repo/fff/data.txt USING repo/descriptor/my_descriptor.xml AS fixed_field_file.fff
# ASSERT_FFF {fff} HAS EXPECTED CONTENT USING {fff_queries_path}
What: This macro permits to valid the content of a fixed field file using a fixed field file query file.
# ASSERT_FFF {fff} HAS EXPECTED CONTENT USING {fff_queries_path}
=>
LOAD {fff_queries_path} AS __temp{%%rand1}.file
CONVERT __temp{%%rand1}.file TO fixed.field.file.queries(query) AS __temp_{%%rand2}.fff.queries
ASSERT {fff} HAS expected.content USING __temp_{%%rand2}.fff.queries
Input:
{fff}: The path to the fixed field file (relative to the root of the repository).
{fff_queries_path}: The path to the query file (relative to the root of the repository).
Example:
# ASSERT_FFF repo/fff/data.txt HAS EXPECTED CONTENT repo/queries/my_queries.xml