Testing Actions
File menu
Open File...
File open dialog appears.
- Should open to current working directory the first time.
- Should open to last visited directory subsequent times.
- Filters for "Source Files" (typically ending in
.java
).
- Open a source file.
- Open some other file type. Should print brief message that
the Java parser/scanner did not understand the file.
- Open button.
- Cancel button.
- Dialog close button.
Open Session...
Session open dialog appears.
- Will indicate the current session at the top.
- Ok without selecting anything from the list. Will error with
message "You must select a name."
- Ok with selection. Should switch to selected session. Verify
by looking at the "Start VM" dialog.
- Ok with text entered in text field for new session name.
Should create new session with default properties. Verify by
looking at the "Start VM" dialog.
- Ok button.
- Cancel button.
- Dialog close button.
Copy Session...
Session copy dialog appears.
- Will indicate the current session at the top.
- Ok without selecting anything from the list. Will error with
message "You must select a name."
- Ok with selection. Should copy the current session's
settings to the selected session, and switch to the selected
session. Verify by looking at the "Start VM"
dialog.
- Ok with text entered in text field for new session name.
Should create new session with the current session's
properties. Verify by looking at the "Start VM"
dialog.
- Ok button.
- Cancel button.
- Dialog close button.
Delete Session...
Session delete dialog appears.
- Will indicate the current session at the top.
- Delete without selecting anything from the list. Will do
nothing at all.
- Delete with selection. Should remove the selected entry from
the list.
- Delete the current session, then click Done. New current
session should be "default".
- Delete the "default" session, then click Done.
Should have created a new "default" session with
default properties.
- Delete button.
- Done button.
- Dialog close button.
Exit
When selected, the window should close and the program may
exit.
- If this was the last open JSwat window, the program should
exit.
- If a debuggee VM was launched from JSwat, it should
terminate.
View menu
Refresh
Causes panels to update their contents.
- Will appear to do nothing when session is inactive.
- Threads panel will likely resort the threads when session is
active.
- Invoke when debuggee VM is running.
- Invoke when debuggee VM is suspended.
Search Source...
Displays dialog asking for term to look for in currently
selected source file. Option to perform case insensitive
comparison.
- If no source view opened, complains about no selected source
view.
- Search for string with case sensitivity on.
- Search for string with case sensitivity off.
- Ok button.
- Cancel button.
- Dialog close button.
Search Again
Attempts to repeat the last search performed by the "Search
Source..." action. If no previous search was made, displays
the dialog described above.
- If no source view opened, complains about no selected source
view.
- Invoking this should perform the previous search again.
Session menu
List Connectors
Prints a list of available JVM connectors to the message
log.
- Will always print at least one entry, usually for
com.sun.jdi.SocketAttach
.
Attach to remote...
Shows dialog for inputting host name/port or a shared memory
name of the debuggee VM to attach to.
- Press Ok when fields are empty. Should complain that the port
number or shared memory name is invalid.
- Select "socket", enter only a host name.
- Select "socket", enter an invalid port number (such
as "abc123").
- Select "socket", enter valid data to attach to a
debuggee VM.
- Select "shared memory" on a Unix system that does
not support the
dt_shmem
connector. Should
complain.
- Select "shared memory" on a Windows system, enter
valid data to attach to a debuggee VM.
- Attach button.
- Cancel button.
- Dialog close button.
Start VM...
Shows a dialog asking for class name and arguments, with
optional debuggee VM options. In addition, the "Java
Home" and "JVM Executable" fields are available and
populated with default values.
- Ok with no class name. Should complain about missing
name.
- Ok with invalid JVM executable. Should report that the VM
load failed.
- Ok with invalid Java Home directory. Should report that the
VM load failed.
- Ok with -classic or -hotspot in debuggee VM options. With JDK
1.4 and later, the -classic option should generate a warning to
the debuggee output.
- Some debuggee VM options are automatically generated by
JSwat, such as the "-classic" and "-cp"
arguments. These should not appear in the "VM Options"
field, however.
- If "Use -classic" is selected in the options menu,
the
-classic
option should be added automatically to
the debuggee VM options.
- Ok with debuggee VM option containing an incorrect classpath,
i.e. one that points to the wrong directory. When debuggee VM is
resumed, should stop with
ClassNotFoundException
thrown and reported to the messages area.
- Ok with debuggee VM option containing
-cp "class
path
(note the missing closing quote). Should attempt to
launch debuggee VM but will fail. The options printed to the Log
should show "[malformed classpath]" at the point where
the quote is missing.
- Ok with debuggee VM option containing
-cp " class
path"
(note the initial space). This regresses bug
365. Of course, having a space as the first character is
generally not a valid path and will generate a class not found
error.
- Ok with non-options in the debuggee VM options field. The
non-options will be passed to the JVM executable which should
stop and report an error (shown in the messages area).
- Any argument to
-cp
or -classpath
will be saved as the classpath in the session properties.
- Ok button.
- Cancel button.
- Dialog close button.
End session
Deactivates the current session.
- If attached to a remote VM, the remote VM will remain
running.
- If debuggee VM launched, will be terminated.
- Disabled when session is inactive.
Terminate VM
Deactivates the current session, terminating debuggee VM.
- If attached to a remote VM, the remote VM will be
terminated.
- If debuggee VM launched, will be terminated.
- Disabled when session is inactive.
Suspend
Suspends the debuggee VM.
- If active, debuggee VM will be suspended.
- Suspend actions are not cumulative. Repeatedly suspending a
debuggee VM will make no difference.
- Disabled when session is inactive.
Resume
Resumes the suspended debuggee VM.
- If active, debuggee VM will be resumed.
- Disabled when session is inactive.
Breakpoints menu
List Breakpoints...
Shows dialog containing all defined breakpoints, along with
buttons for managing those breakpoints. See breakpoints checklist for more
information. At a minimum, there are the following test cases.
New Breakpoint...
Shows dialog asking for class name and location at which to set
breakpoint.
- Ok with empty fields - should complain about empty
location.
- Ok with just location - should attempt to set a breakpoint in
the current class. If the current location is not set, complains
about no class name.
- Ok with just class name - should complain about empty
location.
- Ok with invalid location ("abc123") - should
complain about missing method arguments.
- Ok with valid data - should set a breakpoint.
- Ok button.
- Cancel button.
- Dialog close button.
Trace Method...
Shows dialog asking for class and thread filters to control the
method entry and exit events.
- Ok with empty fields - creates trace of all methods.
- Ok with class filter - creates trace for matching classes
only.
- Ok with thread filter - creates trace for the matching
threads (name or number allowed).
- Ok with class and thread filter - creates trace for the
matching classes and threads (name or number allowed).
- Ok button
- Cancel button
- Dialog close button.
Catch Exception...
Shows dialog asking for name of the exception to catch.
- Ok with empty name - should complain.
- Ok with bogus name - should create an exception breakpoint
that will never be hit.
- Ok with expected exception - should create the breakpoint and
eventually hit it when the exception is thrown.
- Ok button
- Cancel button
- Dialog close button.
Thread Breakpoint...
Shows dialog asking for name of the thread.
- Ok with empty name - should complain.
- Ok with bogus name - should create a thread breakpoint that
will never be hit.
- Ok with valid name - should create the breakpoint and
eventually hit it when the thread is started and dies.
- Ok with valid name, and checkboxes changed - should create
the breakpoint with the appropriate properties disabled.
- Ok button
- Cancel button
- Dialog close button.
Class Breakpoint...
Shows dialog asking for class filters.
- Ok with empty name - should create a class breakpoint that
will stop when any class is prepared.
- Ok with bogus name - should create a class breakpoint that
will never be hit.
- Ok with valid name - should create the breakpoint and
eventually hit it when the class is prepared and unloaded.
- Ok with valid name, and checkboxes changed - should create
the breakpoint with the appropriate properties disabled.
- Ok button
- Cancel button
- Dialog close button.
Watch Variable...
Shows dialog asking for the name of the field to watch.
- Ok with empty name - should complain about missing field
name.
- Ok with bogus name - should complain about one of: no current
thread or field not defined. Or, if the session is inactive,
simply disables the watchpoint.
- Ok with valid name - should create the watchpoint. Will be
disabled until it can be resolved. If session is active, current
location is set, and field is visible, resolves immediately.
- Ok with valid name, and checkboxes changed - should create
the watchpoint with the appropriate properties disabled.
- Ok button
- Cancel button
- Dialog close button.
Step menu
Step Line
Single-steps a source line; steps into method calls.
- If debuggee VM stopped at a breakpoint, steps as
described.
- If debuggee VM running, prints message about no current
thread.
- Disabled if session inactive.
Step Instruction
Single-steps an instruction; steps into method calls.
- If debuggee VM stopped at a breakpoint, steps as
described.
- If debuggee VM running, prints message about no current
thread.
- Disabled if session inactive.
Next Line
Single-steps a source line; steps over method calls.
- If debuggee VM stopped at a breakpoint, steps as
described.
- If debuggee VM running, prints message about no current
thread.
- Disabled if session inactive.
Next Instruction
Single-steps an instruction; steps over method calls.
- If debuggee VM stopped at a breakpoint, steps as
described.
- If debuggee VM running, prints message about no current
thread.
- Disabled if session inactive.
Finish Method
Finishes the current method and returns to the line following
the one that called this method.
- If debuggee VM stopped at a breakpoint, steps as
described.
- If debuggee VM running, prints message about no current
thread.
- Disabled if session inactive.
Options menu
Set Classpath...
Displays dialog allowing the user to modify the classpath. The
dialog contains a list in which each entry is a part of the
classpath. The list entries and be moved forward and backward in
the overall classpath. List entries can be edited in place, though
the focus and cursor don't always seem to work correctly.
- Test with no classpath defined. There will always be
some kind of classpath, even if it's just the current working
directory.
- Test with one classpath entry.
- Test with multiple classpath entries.
- Clear all of the entries and press Ok.
- Add more than one entry.
- Select the first entry. "Move Up" is disabled and
"Move Down" is enabled.
- Select the last entry. "Move Down" is disabled and
"Move Up" is enabled.
- Select an entry: "Remove Path" is enabled.
- Move Up - moves selected entry up one.
- Move down - moves selected entry down one.
- Remove Path - removes the selected entry.
- Ok - ensure classpath is set appropriately by looking at the
output from the
classpath
command.
- Cancel button.
- Dialog close button.
Set Sourcepath...
This is exactly like the classpath dialog except that it can be
completely empty. Verify the results using the
sourcepath
command.
Evaluate...
Displays dialog allowing the user to evaluate a Java-like
expression. See the Testing Expressions
page for details.
Capture Messages...
Displays dialog asking user where to capture messages to.
Options include sending messages to "stdout" and/or to a
named file.
- Ok with nothing selected - disappears silently.
- Ok with "stdout" chosen - new messages appear on
console.
- Ok with "file" chosen, but no file name - complains
"file not found".
- Ok with "file" and name of read-only file -
complains about file not being writable.
- Ok with both "stdout" and "file"
selected.
- Ok button.
- Cancel button.
- Dialog close button.
Preferences...
Shows a dialog with numerous options that can be enabled and
values that can be set for the program. Use the following preferences checklist to test this
dialog. At a minimum, there are the following test cases.
- Ok button.
- Cancel button.
- Dialog close button.
Options
Displays submenu of checkboxes to control sundry options. Use
the following preferences checklist
to test these.
Look & Feel
Displays submenu of available JFC "look & feel"
options.
- Choosing a look and feel should immediately change the
interface to the new look and feel. Only the window frame is
unaffected.
- Choosing "Windows" on a non-Windows system will
report a message to the console and disable the
"Windows" option.
- Choosing "MacOS" on a non-Macintosh system will
report a message to the console and disable the "MacOS"
option.
- The setting is remembered from one invocation of JSwat to the
next.
Logging
Displays a submenu of checkboxes to control the various logging
categories. Test them by turning them all on and running the
program through its paces. Bunches of messages should appear in the
console that started JSwat.
Windows menu
Minimize All
Causes all of the opened source view windows to become iconified
(i.e. minimized). When no source windows are opened, does
nothing.
- Select when no windows opened - nothing happens.
- Select when windows are opened - observe iconification.
Maximize All
Causes all of the opened source view windows to become
deiconified (i.e. maximized). When no source windows are opened,
does nothing.
- Select when no windows opened - nothing happens.
- Select when windows are opened - observe
deiconification.
Window list
This is not a menu item per se but rather a special feature of
the Windows menu. As source views are opened their name is added to
the Windows menu. When source views are closed, their entry in the
menu is subsequently removed.
- Make sure list is initially empty.
- Watch list grow as windows are opened.
- Watch list shrink as windows are closed.
- Select a window from the menu and it will be brought
forward.
- Select an iconified window from the menu and it will be
deiconified and brought forward.
Help menu
Help Index...
Displays a frame (as opposed to a dialog) displaying the help
index.
- Back and Forward buttons are initially disabled since there
is no browser history.
- Refresh button reloads current page.
- Top button goes to index as a new page (adds to
history).
- Copy button selects all text and copies to clipboard. If text
is already selected, copies selected text to clipboard.
- Clicking on a hyperlink will navigate to the new page. Back
button becomes enabled. If later history existed, it is
erased.
- Back button will go to previous page. Forward button becomes
enabled. Back button becomes disabled when first page is
reached.
- Forward button will go to next page in history. Becomes
disabled when last page is reached.
- Back button.
- Forward button.
- Refresh button.
- Top button.
- Copy button.
- Close button.
- Window close button.
Getting Help...
Displays a frame (as opposed to a dialog) displaying the help
screen for getting further help. Otherwise same as help index.
Report a bug...
Displays a frame (as opposed to a dialog) displaying the help
screen for reporting a bug. Otherwise same as help index.
About...
About dialog appears.
-
Should show the following information:
- application name and version
- copyright message
- creation date
- web site URL
- warranty information.
- Ok button.
- Dialog close button.