This document is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License
  Previous Contents Index Next
Chapter 6

Debugging Test Problems

Tests fail to execute properly for many reasons. The JavaTest harness provides many tools that you can use to identify the cause of problems when running tests. This chapter provides some approaches for identifying the cause of these problems.

6.1 Test Manager Window

You can quickly view test information in the Test Manager window by clicking folder and test icons in the test tree.

6.1.1 Test Tree

Use the test tree to view the run and test result status of folders and tests in a test suite. The JavaTest harness uses colored icons in the test tree to indicate both the current run status and the test result status.

The goal of a test run is for the root test suite folder to become green, signifying all tests in the test suite that are not filtered out have passed. You can use the filters to specify tests or groups of tests whose results are displayed in the test tree. Using filters when browsing the tree makes it possible to easily monitor folders containing tests that have not passed.

When you click a folder icon in the test tree, the JavaTest harness displays its folder view in the Test Manager information area. The information in the folder view is changed by the view filter.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.1.2 Folder View

Click a folder icon in the test tree to display its information in the information pane. The folder view displays a Summary tab, five status tabs, and a status display.

During a test run, you can use the folder view to monitor the status of a folder and its tests. You can also use the folder view during troubleshooting to quickly locate and open individual tests that had errors or failed during the test run.

The Summary tab displays the number tests by their test results in a folder. In addition to Summary information, the folder view contains five status tabs that group and list the tests by their results.

The status display at the bottom of the pane displays messages about the selected tab. The messages might indicate that tests in the folder are loading or might provide detailed status information about a selected test.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.1.3 Test View

To display detailed information about a test, click its icon in the test tree or double-click its test name in the information pane. The information pane displays the test view. The test view contains test information in five tabs and a status message display.

  • The Test Description tab displays the name-value pairs contained in the test description.

  • The Files tab contains a drop-down list of source files from the test description. You can display the contents of a file by clicking its name in the list.

  • The Configuration tab displays a table of JavaTest harness environment values used to run a specific test. The contents are output data and only enabled if the test was run.

  • The Test Run Details tab displays the name-value pairs that were recorded when the test was run. The contents are output data and only enabled if the test was run.

  • The Test Run Messages tab contains a tree and message panel of output from sections of the test. Click a name to display its contents. The contents are output data and only enabled if the test was run.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.1.4 Test Manager Properties

You can view the properties of a test manager by choosing View- > Properties from the Test Manager menu bar. The Test Manager Properties dialog box contains Test Suite, Work Directory, Configuration, and Plug-ins information.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.1.5 Test Suite Errors

If the JavaTest harness detects test suite errors, it displays an advisory dialog box. You can view detailed information about the test suite errors by choosing View -> Test Suite Errors from the Test Manager menu bar.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.2 JavaTest Harness ResultBrowser Servlet

You can use the JavaTest harness ResultBrowser servlet included in the javatest.jar file to view the contents of a .jtr file without starting the JavaTest harness GUI by issuing the following command:

com.sun.javatest.servlets.ResultBrowser

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description.

6.3 Configuration Failures

Configuration failures are difficult to correct. They are easily recognized because many tests fail the same way. When all of your tests begin to fail, you might want to stop the run immediately and start viewing individual test output. However, in the case of full-scale launch problems when tests are not run, individual test output is not available. Also check the following for configuration errors:

  • Check your .jti file settings in the Configuration Editor to see if you launched the JavaTest harness with Specify Status set to Yes instead of No.

  • Although you might not produce an env.html report file, the JavaTest harness GUI provides the ability to view evaluated variables used by the tests. Choose Configure- > Show Test Environment from the Test manager menu bar to view the contents of the test environment.

  • The Configuration Editor generates a configuration Question Log when you complete a configuration interview. You can use the configuration Question Log to review all of the questions and your answers in the current configuration. Choose Configure -> Show Question Log from the Test Manager menu bar to view the current configuration interview.

6.4 Report Files

You can generate plain text and HTML reports from either the GUI or the command line after a test run. Report files are a good source of information.

Refer to the JavaTest Harness User's Guide: Graphical User Interface or the JavaTest harness online help for a detailed description of how to generate and view the test reports.

6.5 Debugging Agent Failures

When debugging agent failures, monitor the JavaTest harness agent during the test run to verify the following:

  • The agent is correctly configured and started.

  • The test harness is configured correctly for the agent and test system on which the agent started.

  • The map files, if required, correctly translate host-specific values into values that the agent can use.

Because active agents initiate the connection with the JavaTest harness while passive agents wait for a request from the JavaTest harness, troubleshooting each type of agent requires a different approach. Refer to the JavaTest Agent User's Guide or the JavaTest harness online help for a detailed description of the differences between troubleshooting each type of agent.

6.5.1 Monitoring JavaTest Harness Agents

If you experience problems using JavaTest harness agents to run tests, you can use the JavaTest harness Agent Monitor window to view the agents running tests. You can also use the tabbed panes in the application or applet agent GUI to monitor specific information about the agent and the tests that it runs.

The agent GUI provides a Statistics pane that displays the current status of the tests that the agent is running, a History pane that displays a list of tasks performed by the agent, and a Selected Task pane that displays details about a specific task or test chosen in the history tabbed pane.

Refer to the JavaTest Agent User's Guide or the JavaTest harness online help for a detailed description of the JavaTest harness Agent Monitor window and the agent GUI.

6.5.2 failed.html Report

The failed.html report is an important source of information when debugging test failures. Problems connecting to the JavaTest harness agent are often found in the this file, and might not be reported to a test result file (.jtr).

6.5.3 -trace Option

You can use the -trace option when you start the JavaTest harness agent. The -trace option causes the agent application to send detailed information about agent activity to the system output stream.

Refer to the JavaTest Agent User's Guide or the JavaTest harness online help for a detailed description of the options that can be used when starting a JavaTest harness agent.

Previous Contents Index Next
Company Info Contact Terms of Use Privacy Copyright 1994-2008 Sun Microsystems, Inc.