qat.common
Class TestObject

java.lang.Object
  extended byqat.common.TestObject
All Implemented Interfaces:
java.io.Serializable

public class TestObject
extends java.lang.Object
implements java.io.Serializable

The TestObject class represents all the information required to execute a single test on a single agent.

See Also:
Serialized Form

Constructor Summary
TestObject()
          This constructor creates a blank TestObject.
TestObject(java.lang.String instanceId, java.lang.String[] executeCommand, java.util.Properties executeEnvironment, java.lang.String workDirectory, int timeOut)
           
 
Method Summary
 void addProperty(java.lang.Object key, java.lang.Object value)
          This method adds a property to the TestObject properties.
 java.io.File getEnvFileName()
          This method returns the name and path of the file used to store this test object's.
 java.lang.String[] getExecuteCommand()
          This method returns the execute command of this TestObject.
 java.util.Properties getExecuteEnvironment()
          This method returns the execute environment of this TestObject.
 java.io.File getStdErrFileName()
          This method returns the name and path of the file used to store this test object's.
 java.io.File getStdOutFileName()
          This method returns the name and path of the file used to store this test object's.
 java.lang.String getTestID()
           
 int getTimeout()
          This method sets the length of time this TestObject is allowed to run before it will be forcibly killed.
 java.lang.String getWorkDirectory()
          This method returns the work directory of this TestObject.
 void readObject(java.io.DataInputStream in)
           
 void setExecuteCommand(java.lang.String[] c)
          This method sets the execute command for this TestObject.
 void setExecuteEnvironment(java.util.Properties p)
          This method sets the execute enviroment to be used when the execute command is executed..
 void setTimeout(int t)
          This method sets the length of time this TestObject is allowed to run before it will be forcibly killed.
 void setWorkDirectory(java.lang.String w)
          This method sets the path of the work directory for agent to unzip any sent zip files into, and to create/delete test directories.
 void writeObject(java.io.DataOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestObject

public TestObject()
This constructor creates a blank TestObject.


TestObject

public TestObject(java.lang.String instanceId,
                  java.lang.String[] executeCommand,
                  java.util.Properties executeEnvironment,
                  java.lang.String workDirectory,
                  int timeOut)
Method Detail

getTestID

public java.lang.String getTestID()

addProperty

public void addProperty(java.lang.Object key,
                        java.lang.Object value)
This method adds a property to the TestObject properties.

Parameters:
key - the name of the key to be added or modified.
value - the value of the key to be added or modified.

setExecuteCommand

public void setExecuteCommand(java.lang.String[] c)
This method sets the execute command for this TestObject.

Parameters:
c - the command which will be executed when this TestObject is run.

setExecuteEnvironment

public void setExecuteEnvironment(java.util.Properties p)
This method sets the execute enviroment to be used when the execute command is executed..

Parameters:
p - a Property object containing the relevant environment settings.

setWorkDirectory

public void setWorkDirectory(java.lang.String w)
This method sets the path of the work directory for agent to unzip any sent zip files into, and to create/delete test directories.

Parameters:
w - the absolute path of the work directory, on the agent.

setTimeout

public void setTimeout(int t)
This method sets the length of time this TestObject is allowed to run before it will be forcibly killed. The value is calculated as a value in seconds since the TestObject was executed. A timeout of 0 will allow the test to run indefinitely. Defaults to zero if not explicitly set.


getExecuteCommand

public java.lang.String[] getExecuteCommand()
This method returns the execute command of this TestObject.

Returns:
a String object representing the execute command of this TestObject.

getExecuteEnvironment

public java.util.Properties getExecuteEnvironment()
This method returns the execute environment of this TestObject.

Returns:
a Properties object representing the execute environment of this TestObject.

getEnvFileName

public java.io.File getEnvFileName()
This method returns the name and path of the file used to store this test object's. environment. WARNING: this method is only valid if called on the agent machine.

Returns:
name and path of the stderr file.

getStdOutFileName

public java.io.File getStdOutFileName()
This method returns the name and path of the file used to store this test object's. std error output. WARNING: this method is only valid if called on the agent machine.

Returns:
name and path of the stderr file.

getStdErrFileName

public java.io.File getStdErrFileName()
This method returns the name and path of the file used to store this test object's. std output. WARNING: this method is only valid if called on the agent machine.

Returns:
name and path of the stdout file.

getWorkDirectory

public java.lang.String getWorkDirectory()
This method returns the work directory of this TestObject.

Returns:
a String object representing the work directory of this TestObject. All files unzipped or created during execution will/should be placed in the directory to allow for easy cleaning of tests.

getTimeout

public int getTimeout()
This method sets the length of time this TestObject is allowed to run before it will be forcibly killed. The value is calculated as a value in seconds since the TestObject was executed.

Returns:
the timeout value in seconds.

writeObject

public void writeObject(java.io.DataOutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

readObject

public void readObject(java.io.DataInputStream in)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException


See QAT project for licensing details