Test Project 1 Details
This first of the two test projects included with the JFileChecker installation is for comma delimited files with the following column structure:
Other information to note about this test project is that
- Comment (text field, no constraints)
- Name (text field between 2 and 40 charactes containing only letters and spaces)
- Salary (non-negative numeric field accepting numbers with up to 2 decimal places)
- Date of Hire (date field accepting dates greater than or equal to 1/1/1950 in MM/dd/yyyy format)
- Active (list field accepting only the non case-sensitive values "true" and "false")
This is an example of a data file that may be checked for this test project.
- There is an all-or-none constraint on the salary and date of hire fields
- Data fields are expected to contain a single header row in data files it checks.
- Commas in text fields can be escaped with a single backslash
To set up this test project, the following files located in the installation's sql subfolder can be run in this order:
- If running Unix/Linux, edit and run test_1_unix_check_project.sql, if running windows, edit and run test_1_windows_check_project.sql.
These files are used to add data to the check_project table for test project #1 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.
- run test_1_check_field_1.sql - adds data for handling the first field (Comment)
- run test_1_check_field_2.sql - adds data for handling the second field (Name)
- run test_1_check_field_3.sql - adds data for handling the third field (Salary)
- run test_1_check_field_4.sql - adds data for handling the fourth field (Date of Hire)
- run test_1_check_field_5.sql - adds data for handling the fifth field (Active)
- run test_1_field_dt_format.sql - adds a date format for Date of Hire
- run test_1_field_list_1.sql - adds a list item for Active (list item = "true")
- run test_1_field_list_2.sql - adds a list item for Active (list item = "false")
- run test_1_project_constraint.sql - defines the all-or-none constraint (Salary and Date of Hire)
- run test_1_field_constraint_1.sql - adds Salary to the all-or-none constraint
- run test_1_field_constraint_2.sql - adds Date of Hire to the all-or-none constraint
Test data for this project is located in the installation's testdata subfolder in a file named "test_1_data_file.csv".
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 1 data file should look like