Starting an Agent Application

Before you can start an agent application, the required classes must be installed on your test system. Refer to Installing Agent Classes on Test Systems for the location and list of classes required to start the agent directly from the command line or using the application GUI.

  1. Start the JavaTest harness and perform the following:
  1. Open the Configuration Editor and configure the JavaTest harness to use an agent. In most cases, the Configuration Editor provides detailed instructions about configuring the JavaTest harness to run tests using an agent.
  2. If you are starting an active agent, open the Agent Monitor window and enable agent pool listening. Refer to Agent Monitor Window.

    If the agent pool is not listening when an active agent starts, the agent cannot contact the harness. The agent returns an error message and then waits until its timeout period ends before recontacting the JavaTest harness.

  1. Use the following application command template to enter the appropriate agent command at the command prompt:

    java -cp class path [application class] [options]

    Example:
    java -cp javatest.jar com.sun.javatest.agent.AgentFrame

  2. If you are using the application GUI to run the agent, use the Parameters tabbed pane to verify the agent settings and start the agent:

Class Paths

The following class paths are required in the command line:

Classes Description
Agent Classes The location of the agent classes installed on your test system.

The agent classes are either located in the javatest.jar file or in the directory containing the minimum set of classes required to run the agent from the GUI.

Some test suites include additional .jar files containing classes needed for an agent to run tests. These .jar files must also be included in the command string. Refer to Installing Agent Classes on a Test System for a description of how agent classes can be installed.

Test Classes Test classes are located in the classes directory of the test suite.

The most common error in setting up a test platform to use an agent is entering the wrong class paths in the command string. Configuring your test platform to use the simplest class paths increases the reliability of the test run.

Application Classes

An application class is required in the command line to run the agent. Two application classes are available:

Mode Application Class
no GUI com.sun.javatest.agent.AgentMain [options]

Used when the GUI is not wanted or not available. In this mode, all options must be fully specified on the command line. The agent automatically starts when the Return key is pressed. Refer to Agent Options below for the [options] that are included on the command line.

with GUI com.sun.javatest.agent.AgentFrame [options]

Used to start the GUI. In this mode, options may either be given on the command line or in the GUI. The GUI is used to start and stop the agent. Refer to Agent Options below for the [options] that are included on the command line.

Agent Options

There are two types of options used in the command line:

Type of Option Description
Agent Parameters Set the parameters for the type of agent that you are using:

If you are using the command-line application class (com.sun.javatest.agent.AgentMain) to directly configure and run the agent, you must include all options in the command line that are used to run the agent.

If you are using the GUI application class (com.sun.javatest.agent.AgentFrame) you can either set the agent options in the command line or in the GUI before running the agent.

Additional Parameters Display help, run the agent, or configure other agent properties.

Refer to Specifying Additional Options for a description of the additional parameters that can be set.