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.
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.
java -cp
class path [application class] [options]
-cp
option sets the class paths required to run the agent. Use the ";" or ":" separator appropriate for your test system when more than one class path is included in the command string. Refer to Class Paths below for detailed descriptions of the classes that your agent requires.
Example:
java -cp javatest.jar com.sun.javatest.agent.AgentFrame
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 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.
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. |
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 (
If you are using the GUI application class ( |
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. |