The Test Harness allows you to test handlers without having to add them to your Kinetic Task install, and creating a task tree. it allows you to define both your test inputs, and what the expected outputs should be. Any logging entries are displayed directly to the screen.
Setting Up the Test Harness
Prerequisites - java 1.5 or greater installed
Note - This test harness should be used to test handlers that will be used with Kinetic Task 1.x.
Note - For the purposes of these instructions, it is assumed that all the directories are copied directly to C:\
- Download the Test Harness zip file attached to this article
- Extract the zip file, it hast two directories - arslibs & kineticTask
- Copy these directories to your system (see note above)
- Add the arslibs to your system Path variable
- Create a folder for your task handlers (see note above)
Configuring a Task Handler to run with the Test Harness
You do not have to change anything in the init.rb or the node.xml. However, it is normal that these are altered as part of your development and testing. The two files that the test harness will specifically use are in the test directory, simple_input.rb & simple_output.xml.
The task handler should be extracted into the handlers directory to run with the test harness.
The first file – simple_input.rb - sets the environment and parameters that are passed during the test. Here is an example from the Sample Person Retrieve:
Command to Run the Test harness
java -jar kinetic-task.jar -test-handler=PATH_TO_HANDLER
This assumes that you are running the command from the c:\kineticTask directory.
Assuming you are testing the Sample People Retrieve handler, the full command would look like this:
java -jar kinetic-task.jar -test-handler="C:\handlers\kinetic_sample_people_retrieve_v2"