Testing Panels
Threads panel
This panel displays the live threads in the debuggee VM. As
threads are created and destroyed, entries in this table will
appear and disappear. The thread currently being examined by JSwat
will be rendered in red. Simply clicking on a row in the table will
change JSwat's notion of the current thread. The rows are not
sorted in any particular order.
- Initially the table is empty.
- After launching a debuggee VM, several new rows should
appear. The threads will likely be called: Finalizer, Reference
Handler, Signal dispatcher, and main.
- Hitting a breakpoint should set a thread as the current one,
which paints the corresponding row in this panel as red.
- Using the '
thrdtest
' test program should
cause several threads to be created and eventually to die.
Classes panel
This panel displays the loaded classes in the debuggee VM. As
classes are loaded and unloaded, entries in this tree will appear
and disappear. Double-clicking on a class in the tree should
display the corresponding source file. The entries tend to be
sorted in alphabetical order, but that is not guaranteed.
- Initially the tree is empty, with a single node whose label
is "CLASSES".
- After launching a debuggee VM, numerous new nodes should
appear.
- When a debuggee VM starts running, this tree should rebuild
itself several times as new classes are loaded into the debuggee
VM. It is normal for the expanded branches of the tree to
collapse as the tree is rebuilt.
- Expanding a node and hovering the mouse over a class should
display a tooltip with the class' fully-qualified name.
- Hovering the mouse over empty space should show a tooltip
with the phrase "class tree" (or some translation
thereof).
Locals panel
This panel displays the local variables in the current stack
frame of the debuggee VM, when the debuggee VM is suspended. The
tree rebuilds itself as the frame, thread, or location changes in
the debuggee VM. Expanded nodes in the tree will remain expanded
even when the tree is rebuilt (unless, of course, the variable goes
out of scope).
- Initially the tree is empty, with a single node whose label
is "LOCALS".
- While the debuggee VM is running, the locals panel will
likely display "(thread not set)" to indicate that the
current thread is not set.
- When the debuggee VM is suspended and a current thread is set
(possibly by using the Threads panel), the locals panel should
display the visible variables at the current location.
- Variables in the tree have this basic format:
name
(type): value
. The type may be a primitive Java type or a
Java class name. Class names may be fully-qualified depending on
the "Trim package names" option set in the
Preferences.
- Objects are shown using a diamond-shaped box icon.
- Java objects will have their fields displayed as child nodes
in the tree.
- Object fields that refer back to the containing object,
either directly or indirectly, will be shown with a circular
icon. These nodes cannot be expanded.
- Arrays will be shown with an icon that resembles a table with
three rows. The value of the array is the size of the array in
square brackets.
- Arrays longer than six elements will have a special
"..." node. Double-clicking on this node will display
all of the elements in the array.
- Recently changed variables will be colored in red.
- Test all of this behavior rigorously with the
'
locals
' test application.
Watches panel
This panel displays any defined watches. Watches are variables
in the debuggee VM that JSwat is presently tracking for changes. As
a variable is changed, the value displayed in this panel will be
updated.
- Initially the table is empty.
- After the debuggee VM is loaded, the table will contain an
empty row.
- If any watches had been previously defined, they will be
shown.
- An empty row will exist at all times.
- Typing the name of a visible variable into the
"Name" column of the empty row will add that variable
as a watch.
- Typing the name of a local or field variable while stopped in
a static method should work. Previously this did not.
- The keyword "
this
" may be used to
refer to field variables of the 'this' object in the
current stack frame. This is only useful if a local variable of
the same name is present in the stack frame.
- Variable values are displayed simply as the
toString()
of the object.
- Clearing the name field of a row will delete the watch.
- While the debuggee VM is running, the locals panel will
likely display "(no thread)" to indicate that the
current thread is not set.
- If no variable information is available (because the classes
were not compiled using "javac -g") then the panel will
display "(no debugging info)".
Messages panel
This panel displays the messages generated by JSwat during the
program's current run. Right-clicking on the panel will display
a popup menu allowing the user to copy the selected text in the
display.
- Initially the panel will display a few startup messages.
- As the program goes through its normal operating procedures,
messages will be relayed to this panel.
- As messages are displayed to this panel, it should
automatically scroll down to the new messages.
- Commands entered into the command input field will be echoed
in this panel (prefixed with a
>
).
- Select some text from this display and right-click. A popup
menu should appear with three items - Clear, Copy, and Select
All. Test the Copy item by selecting it and pasting the text from
the clipboard into a text editor.
- Deselect the text in the panel and right-click. The popup
menu described above will appear. The Copy item will be
disabled.
Command text field
This text field appears below the Messages panel and allows the
user to enter JSwat commands. Pressing the Enter key should send
the typed input to JSwat for processing.
- Initially this field is empty.
- Typing into this field should echo all typed characters.
- Pressing Enter will send the typed input to the command
interpreter. This should also clear the input field of all
text.
- Right-clicking in the input field should display a popup menu
with two items - Copy, Paste.
- Right-click in the input field when no text is selected. A
popup menu will appear containing a "Copy" entry that
is disabled.
- Right-click in the input field when text is selected. A popup
menu will appear containing an enabled "Copy" entry.
Select this to send the selected text to the system
clipboard.
- Right-click in the input field after having copied text to
the system clipboard. The "Paste" menu item should be
enabled. Select it to paste the text to the input field.
- Using cursor up and down keys should scroll through the
command history.
- Using Ctrl-p and Ctrl-n keys should scroll through the
command history.
- Cursoring up to the top of the command history will generate
a beep sound.
- Cursoring down to the bottom of the command history will
restore whatever "in-progress" text was there
initially.
Output panel
This panel displays the output generated by debuggee VM during
the program's run. Right-clicking on the panel will display a
popup menu allowing the user to copy the selected text in the
display.
- Initially the panel will be empty.
- Each time a debuggee VM is loaded, this panel will be
cleared.
- As the debuggee VM generates output (both to
stdout
and to stderr
), that output will
be relayed to this panel.
- As output is generated, this panel should automatically
scroll down to the new output.
- Select some text from this display and right-click. A popup
menu should appear with three items - Clear, Copy, and Select
All. Test the Copy item by selecting it and pasting the text from
the clipboard into a text editor.
- Deselect the text in the panel and right-click. The popup
menu described above will appear. The Copy item will be
disabled.
Input text field
This text field appears below the Output panel and allows the
user to enter input to the debuggee VM. Pressing the Enter key
should send the typed input to the debuggee VM's
stdin
stream.
- Initially this field is empty.
- Typing into this field should echo all typed characters.
- Pressing Enter will send the typed input to the debuggee
VM's
stdin
stream. This should also clear the
input field of all text.
- Right-clicking in the input field should display a popup menu
with two items - Copy, Paste.
- Right-click in the input field when no text is selected. A
popup menu will appear containing a "Copy" entry that
is disabled.
- Right-click in the input field when text is selected. A popup
menu will appear containing an enabled "Copy" entry.
Select this to send the selected text to the system
clipboard.
- Right-click in the input field after having copied text to
the system clipboard. The "Paste" menu item should be
enabled. Select it to paste the text to the input field.
Breakpoints panel
The breakpoints panel is identical to the breakpoints dialog
(accept, of course, that it cannot be closed). See the breakpoints
checklist for testing the features
of the breakpoints panel.
Stack panel
This panel displays the stack frame at the current location in
the debuggee VM.
- Initially this panel is empty.
-
After the debuggee VM is loaded, this panel may display one of
the following messages:
- (no frame) = current stack frame is empty.
- (no thread) = no current thread set.
- The rows in the table will be numbered in ascending order
starting from one. These numbers will appear in the "#"
column.
- Native methods in the stack frame will show "native
method" in the "Source" column.
- The row colored in red indicates which frame is the current
one. This is usually the frame numbered '1'.
- Double-clicking on a row in the table will set the current
stack frame and show the corresponding source file, if available,
as well as scroll to the point in the source file that defines
that location.
- Double-clicking on a row in the table for which the method is
"native" will display the corresponding source file,
but not scroll to the appropriate location, since it is not
known.
- Double-clicking on a row in the table for which a source file
could not be found will display an appropriate error
message.
Methods panel
This panel displays the defined methods of the class that
defines the method at the current location. Each row of the table
corresponds to a method in the class.
- Initially this panel is empty.
-
After the debuggee VM is loaded, this panel may display one of
the following messages:
- (no frame) = current stack frame is empty.
- (no thread) = no current thread set.
- (bad thread state) = thread is not suspended
- (native) = current method is native and no stack frame is
available
- The line number in the source file where the method is
defined is shown in the "Line" column.
- If the method location is not defined, the line number will
be shown as "??" in the "Line" column.
- If the method is native, the line number will be shown as
"-1" in the "Line" column.
- The method modifiers, return type, name, and argument list
are shown in the "Method" column.
- As the current location is changed, the contents of this
panel will change to reflect the methods defined in the class
containing the current location.
- Double-clicking on a row in the table will show the
corresponding source file, if available, and scroll to make that
method visible in the source view.
- Double-clicking on a row in the table for which the method is
"native" will display the corresponding source file,
but not scroll to the appropriate location, since it is not
known.
- Double-clicking on a row in the table for which a source file
could not be found will display an appropriate error
message.