Starting JSwat

Startup Options

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
Program should launch as usual.
java -Djava.source.path=/usr/java/src com.bluemarsh.jswat.Main
Program should launch with sourcepath pre-defined. Test this by invoking the 'sourcepath' command and verifying that the output contains /usr/java/src.
java com.bluemarsh.jswat.Main <command> [<arguments>]
Program will start and execute the given command with any arguments provided.

Console Mode

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
Program should launch into console mode.
java -Djava.source.path=/usr/java/src com.bluemarsh.jswat.Main -console
Program should launch with sourcepath pre-defined. Test this by invoking the 'sourcepath' command and verifying that the output contains /usr/java/src.
java com.bluemarsh.jswat.Main -console <command> [<arguments>]
Program will start and execute the given command with any arguments provided.

Startup Files

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.

Unreadable

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.

Parent Directories

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.