![]() |
JSwat ProjectTesting Views |
The "views" are presently only the source view window. This window displays the Java source code being debugged. It has the option of syntax highlighting the code to make it easier to read. Here are some test cases to ensure the view is working correctly.
The source view window reads and interprets the Java source file to provide two important features. First, it parses the Java code to determine: 1) the package name, and 2) the line number range of the class definitions. This information is used by the source view popup menu in setting breakpoints. Second, the Java code is scanned lexically to identify elements to be colorized.
Because of these two operations, the Java code must be well-formed. If there are any parser errors, the source view popup menu will not be able to set any breakpoints in that Java code. By the same token, if the lexical analyzer throws an exception, the view will not open at all. However, this is an unlikely event as it seems the scanner will colorize any content at all.
Make sure the source view handles the tab characters correctly.
In particular, they should be converted to the appropriate number
of spaces. This works around a bug in JTextPane
in
which tabs throw off the text component's width calculations.
The tab width is determined in the user preferences under the
"View" category. Try changing this value and ensure open
views reflect the new value.
Whenever the debugging context is set (that is, the cuurent thread, stack frame, and location are known) the source view will display the values of variables defined by the string under the mouse pointer. That is, if the mouse pointer hoovers over the name of a variable in the Java code, a tooltip will appear, giving the value of that variable in the current stack frame.
A couple of things to try.
The source view uses the font size defined in the user preferences. Make sure that changing this value actually changes the source view.
The source view will colorize the view contents according to a set of simple rules of the Java programming language. It can colorize anything, including non-Java code. Ensure that this colorization is happening, and that it can be turned off via the option in the user preferences.
A Java language parser is employed to enable the source view popup menu to know where classes are defined. With this information, the popup will show one of the following:
Ensure that the appropriate popup menu messages are shown.
While single-stepping through Java code, the source view window should be visible and the stepping line should be indicated by a blue highlight. Ensure that this is working by setting a breakpoint and stepping for a few lines.
The source view indicates the position of breakpoints by coloring the area behind the line numbers. The line numbers are visible at the left of the source view area. The colors are as follows: