Testing a script

To test a script in SwitchScripter:


  1. Create an initial version of your script as described in Writing a script.
  2. Save the script package with an appropriate name in an appropriate location.
  3. Click the "View declaration/fixture pane" tool button to reveal the Fixture pane.
  4. In the Fixture pane, configure the basic fixture settings, the incoming jobs and the outgoing connections to reflect a relevant test scenario. If the script accesses information in the internal job ticket of incoming jobs, setup the corresponding test data as well.
  5. To simulate the arrival of a job on one of the script's incoming connections, select the desired job in the Fixture pane (make sure it is enabled). Then select the "jobArrived" entry point using the selector in the toolbar and press the "invoke entry point" tool button. The selected job is passed to the script's "job" argument and all enabled jobs are returned when the script requests a complete list of incoming jobs (disabled jobs are hidden from the script).
  6. To simulate a timer event, select the "timerFired" entry point using the selector in the toolbar, and click the "Invoke entry point with the test fixture" tool button. Again, all enabled jobs are returned when the script requests a complete list of incoming jobs.
  7. In the Messages pane, review the messages issued by SwitchScripter and by the script to evaluate the script's operation. Also, use the Environment.log() and Job.log() functions to generate messages for debugging.
  8. If desired, adjust the script program and/or the script declaration and start over.

Contents