Running JTorX from the command line

From version 1.10 beta on, JTorX can be run from the command line, without Graphical User Interface (GUI).

Running JTorX from the command line

  1. First prepare a configuration file using the JTorX GUI, e.g. myconfig.jtorx:
    1. Configure JTorX like you would do when you would run JTorX using the GUI, using the items in
      1. the Configuration pane (for model and implementation etc.), and
      2. the Test pane (to enable or disable visualization, and optionally, configure random number seed, and max number of test steps)
    2. Save the configuration using the command from the File menu, in a file that has a .jtorx suffix, e.g. myconfig.jtorx.
  2. Invoke jtorxcmd (on linux or mac) or jtorxcmd.bat (on windows), from the torx* folder that results from unpacking the distribution1, with at least one command line option: the configuration file that you just created, like e.g.
    jtorxcmd myconfig.jtorx
    jtorxcmd.bat myconfig.jtorx

When started in this way, JTorX will run until an error is found, or, if a maximum number of Steps was configured in the Test pane, until that number of steps are executed, whichever comes first.

Additional command line arguments

The jtorxcmd(.bat) program accepts additional command line arguments, as shown in the usage message:

usage: jtorxcmd [-c count] [-l logFile] [-r] [-s seed] [-S simseed] configFile
usage: jtorxcmd -V

Arguments:

  • -c count
    stop the test run after count test steps have been executed without failure.
    This overrules a possible Steps setting configured via the Test pane of the GUI.
  • -l logfile
    the location of the file in which to store logging information (the log that is shown in a Log pane when the log checkbox in the Test pane of the GUI is checked).
  • -s seed
    the seed for the random number generator used for decisions made during a test run.
    This overrides a possible Seed setting configured via the Test pane of the GUI.
  • -S simseed
    the seed for the random number generator used for the model simulator, when using a simulated model as system under test.
    This overrides a possible SimSeed setting configured via the Test pane of the GUI.

Notes

1 In the distribution for mac, you will find jtorxcmd in folder Contents/Resources/Java within the JTorX*.app folder that results from unpacking the distribution.