Test Project 2 Details

This second of the two test projects included with the JFileChecker installation is for fixed width files with the following column structure:
  1. Comment (text field, no constraints)
  2. First Name (text field between 2 and 20 charactes containing only letters and spaces)
  3. Last Name (text field between 2 and 21 charactes containing only letters and spaces)
  4. Birthday (date field accepting dates in yyyyMMdd format)
  5. Weight (non-negative integer numeric field)
  6. Gender (text field accepting only the case-sensitive values "M" and "F")
Other information to note about this test project is that This is an example of a data file that may be checked for this test project.

Set-Up Information

To set up this test project, the following files located in the installation's sql subfolder can be run in this order:
  1. If running Unix/Linux, edit and run test_2_unix_check_project.sql, if running windows, edit and run test_2_windows_check_project.sql. These files are used to add data to the check_project table for test project #2 and contain defaults for data, log, and file paths that may need to change (so edit the last three lines of the file before running it). The escape character is also different. I've noticed that under Windows/Access, backslashes will get loaded from the query directly into the database "as is" while under Linux/MySQL the backslashes need to be escaped with a second backslash. Please adjust the backslashes in this query appropriately.
  2. run test_2_check_field_1.sql - adds data for handling the first field (Comment)
  3. run test_2_check_field_2.sql - adds data for handling the second field (First Name)
  4. run test_2_check_field_3.sql - adds data for handling the third field (Last Name)
  5. run test_2_check_field_4.sql - adds data for handling the fourth field (Birthday)
  6. run test_2_check_field_5.sql - adds data for handling the fifth field (Weight)
  7. run test_2_check_field_6.sql - adds data for handling the sixth field (Gender)
  8. run test_2_field_dt_format.sql - adds a date format for Birthday
  9. run test_2_project_constraint.sql - defines the unique constraint (Name)
  10. run test_2_field_constraint_1.sql - adds First Name to the unique constraint
  11. run test_2_field_constraint_2.sql - adds Last Name to the unique constraint

Test data for this project is located in the installation's testdata subfolder in a file named "test_2_data_file.dat". This data file (or any other for this test project) should be copied to the data directory defined by the project's data_path directory (given in the check_project table, defined in item 1 above). Similarly, be sure the data, log, and result directories for this project (per the check_project table) exist and can have data written to them before running JFileChecker. If all is set up and run properly, the result file generated by running JFileChecker against the test project 2 data file should look like this.