There are several options available when starting the program. Most notable is that JSwat can execute an arbitrary command when given appropriate arguments on the command line.
java com.bluemarsh.jswat.Main
java -Djava.source.path=/usr/java/src
com.bluemarsh.jswat.Main
sourcepath
' command and
verifying that the output contains
/usr/java/src
.java com.bluemarsh.jswat.Main <command>
[<arguments>]
JSwat supports more than one interface mode. At present the
program defaults to running with a graphical interface based on the
JFC component set. In addition, the program can be made to run
within a console, without any graphical interface at all. This mode
is invoked with the -console
option. It must be the
first option following the JSwat "Main" class name. Use
the following test cases to test the console-only mode of the
program.
java com.bluemarsh.jswat.Main -console
java -Djava.source.path=/usr/java/src
com.bluemarsh.jswat.Main -console
sourcepath
' command and
verifying that the output contains
/usr/java/src
.java com.bluemarsh.jswat.Main -console <command>
[<arguments>]
Upon starting, JSwat looks for a file named
jswat.init
in the current directory. If it finds it, it
reads each line as if it were a JSwat command. Lines beginning with
#
are ignored.
For this test, make an unreadable jswat.init
file.
This is easily done by changing the owner and/or permissions on the
file using normal file commands (e.g. "chmod"). Start
JSwat in this directory and ensure that it does not read the
contents of the file.
JSwat not only reads the jswat.init
file in the
current directory but also all parent directories. Test this by
putting a file in each parent directory, each with a unique
command. Start JSwat and ensure that each command was run in
turn.