Jtest logo




Contents  Previous  Next  Index

Jcontract's Monitors


Jcontract's monitors report contract violations detected at runtime and program progress (i.e. the number of contract checked).

Currently there are two types of monitors available with Jcontract: a TEXT mode monitor and a GUI mode monitor.

The GUI Monitor is used by default. You can specify which type of monitor you would like to use by modifying the Jcontract Preferences. See Jcontract Preferences for information about how to set monitor preferences.

GUI Monitor

If Jcontract's "Monitor.Type" option is set to the value "GUI", the Jcontract GUI Monitor will start as soon as the program under execution loads a class with instrumented contracts on it.

The GUI Monitor consists of the following elements:

The Report Area

The Report Area of the Jcontract GUI Monitor displays:

  • Runtime Progress: Reports the number of instrumented classes loaded and the number of contracts executed.
  • Contract Violations: Each time a contract violation occurs, the Jcontract GUI Monitor reports it in the Contract Violations area. If you expand the violation report, the monitor will display the stack trace where the violation occurred.

    To view the violating file's source code, with the stack trace line highlighted, double-click the node which represents the stack trace line that you want highlighted.

    To edit the source code, right-click any line of the stack trace information, then choose Edit Source from the shortcut menu. This opens the code in the default editor.

    Note: The source viewer looks for source files in the CLASSPATH environment variable. To specify additional directory where to look for source, set the SOURCEPATH environment variable.

If you would like to hide either the Runtime Progress information or the Contract Violations information, clear the appropriate button on the left side of the GUI.


The Menu Bar

The menu bar lets you access commands related to monitor functionality.

File Menu

  • Exit: Closes that monitor GUI.

Edit Menu

  • Find: Opens a dialog box that allows you to search for items in the monitor.
  • Preferences: Opens a dialog box that allows you to modify Jcontract preferences. For information on available preference options, see Jcontract Preferences.

Help Menu

  • Contents: Opens the Jcontract User's Guide.
  • Feedback: Displays information about how to send feedback about Jcontract to ParaSoft.
  • Support: Opens the Jcontract online support page.
  • About: Displays the Jcontract version number and logo.

The Tool Bar

Button

Name

Action

Reset

Resets all monitor counters and lists to 0.

Log

Opens the Jcontract log file (this file is discussed in The Log File).

The Status Bar

The status bar reports Jcontract messages.

TEXT Monitor

If the Monitor.Type preference in <jcontract_install_dir>\u\<username>jcontract.preferences is set to the value Text, the Jcontract TEXT Monitor will start as soon as the program under execution loads a class that contains instrumented contracts.

The TEXT Jcontract Monitor sends all messages to the console (stdout) by default. Use the Monitor.LINEOutputFile preferences in <jcontract_install_dir>\u\<username>jcontract.preferences to send the output to a file or to stderr.

When the instrumented program exits, the runtime progress at the point of exit is displayed (this feature requires running with JDK 1.3 or higher).


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft