org.jboss.dtf.testframework.testnode
Interface TestNodeInterface

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
TestNode

public interface TestNodeInterface
extends java.rmi.Remote

The RMI interface for the TestNode. A TestNode will implement this interface.


Field Summary
static int RESULT_READY
          Task returned the string 'Ready'.
static int RESULT_TIMEOUT
          The task returned nothing within the expected timeout period.
static int WAIT_NONE
          Do not wait for the task to return anything
static int WAIT_READY
          Wait for task to return the text 'Ready' before returning
 
Method Summary
 TaskIdInterface generateTaskId(java.lang.String taskName)
          Generates a default task id.
 java.lang.String[] getActiveTaskList()
          THis method returns the list of tasks currently being run by this node.
 RemoteFileReaderInterface getDeployLogOutput(java.lang.String productName, boolean outOrErr)
          This method retrieves an InputStream for the log output for a deployment.
 java.lang.String getHostAddress()
           
 java.lang.String getName()
          Get the Name of the TestNode (specified in the XML configuration for that test node).
 TestNodeDescription getNodeDescription()
          This methods returns the description of this test node.
 void initiateTest(java.lang.String currentTestId, TaskIdInterface taskId)
           
 int performTask(java.lang.String taskType, java.util.Hashtable runnerParameters, java.lang.String className, java.lang.String classpathRef, java.lang.String taskName, java.lang.String[] parameters, java.lang.String[] jvmParameters, java.lang.String productId, int timeoutValue, TaskIdInterface taskId, RunUID runId, java.lang.String taskPermutationCode, java.lang.String testPermutationCode)
          Instructs the TestNode to run a given Java class.
 boolean ping()
          This method is called by the service register to ensure this test node is responding.
 void runTask(java.lang.String taskType, java.util.Hashtable runnerParameters, java.lang.String className, java.lang.String classpathRef, java.lang.String taskName, java.lang.String[] parameters, java.lang.String[] jvmParameters, java.lang.String product, int testType, int timeoutValue, TaskResultListener listener, TaskIdInterface taskId, RunUID runId, java.lang.String taskPermutationCode, java.lang.String testPermutationCode)
          Instructs the TestNode to run a given Java class and report back using the listener any information returned by the task.
 void shutdown(boolean restart, boolean onComplete)
          Instructs the TestNode to deregister with the ServiceRegister and shutdown
 boolean terminateAllTasks()
           
 void terminateTask(TaskIdInterface taskId, java.lang.String testPermutationCode)
           
 void testFinished(java.lang.String permutationCode, TaskIdInterface taskId, java.lang.String testId)
          Inform the test node that the test has finished and that it is now free to perform other tests.
 boolean updateSoftware()
          Instructs the testnode to update its software for all the products it supports.
 boolean updateSoftware(java.lang.String productName, boolean deploySoftware)
           
 void waitForTask(TaskIdInterface taskId)
          This method blocks until the task identified completes or until the timeoutValue elapses
 

Field Detail

WAIT_READY

static final int WAIT_READY
Wait for task to return the text 'Ready' before returning

See Also:
performTask(java.lang.String, java.util.Hashtable, java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String, int, org.jboss.dtf.testframework.testnode.TaskIdInterface, org.jboss.dtf.testframework.testnode.RunUID, java.lang.String, java.lang.String), Constant Field Values

WAIT_NONE

static final int WAIT_NONE
Do not wait for the task to return anything

See Also:
performTask(java.lang.String, java.util.Hashtable, java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String, int, org.jboss.dtf.testframework.testnode.TaskIdInterface, org.jboss.dtf.testframework.testnode.RunUID, java.lang.String, java.lang.String), Constant Field Values

RESULT_READY

static final int RESULT_READY
Task returned the string 'Ready'.

See Also:
performTask(java.lang.String, java.util.Hashtable, java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String, int, org.jboss.dtf.testframework.testnode.TaskIdInterface, org.jboss.dtf.testframework.testnode.RunUID, java.lang.String, java.lang.String), Constant Field Values

RESULT_TIMEOUT

static final int RESULT_TIMEOUT
The task returned nothing within the expected timeout period.

See Also:
performTask(java.lang.String, java.util.Hashtable, java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String, int, org.jboss.dtf.testframework.testnode.TaskIdInterface, org.jboss.dtf.testframework.testnode.RunUID, java.lang.String, java.lang.String), Constant Field Values
Method Detail

getName

java.lang.String getName()
                         throws java.rmi.RemoteException
Get the Name of the TestNode (specified in the XML configuration for that test node).

Returns:
Returns the name of the TestNode as a string.
Throws:
java.rmi.RemoteException - Thrown by the RMI implementation.

getHostAddress

java.lang.String getHostAddress()
                                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

ping

boolean ping()
             throws java.rmi.RemoteException
This method is called by the service register to ensure this test node is responding. Always return true

Throws:
java.rmi.RemoteException

performTask

int performTask(java.lang.String taskType,
                java.util.Hashtable runnerParameters,
                java.lang.String className,
                java.lang.String classpathRef,
                java.lang.String taskName,
                java.lang.String[] parameters,
                java.lang.String[] jvmParameters,
                java.lang.String productId,
                int timeoutValue,
                TaskIdInterface taskId,
                RunUID runId,
                java.lang.String taskPermutationCode,
                java.lang.String testPermutationCode)
                throws java.rmi.RemoteException,
                       TestNodeBusy,
                       UnsupportedProduct,
                       TaskRunnerNotSupported
Instructs the TestNode to run a given Java class.

Parameters:
className - The fully qualified name of the class to be run.
parameters - The parameters to be passed to this class.
productId - The string identifier for the product that this test should be run under.
taskType - The type of test to be run.
timeoutValue - The amount of time the class is given to produce the expected output. If it doesn't then the value RESULT_TIMEOUT is returned.
Returns:
Returns the information that was returned from the server.
Throws:
java.rmi.RemoteException - Thrown by the RMI implementation.
TestNodeBusy
UnsupportedProduct
TaskRunnerNotSupported

runTask

void runTask(java.lang.String taskType,
             java.util.Hashtable runnerParameters,
             java.lang.String className,
             java.lang.String classpathRef,
             java.lang.String taskName,
             java.lang.String[] parameters,
             java.lang.String[] jvmParameters,
             java.lang.String product,
             int testType,
             int timeoutValue,
             TaskResultListener listener,
             TaskIdInterface taskId,
             RunUID runId,
             java.lang.String taskPermutationCode,
             java.lang.String testPermutationCode)
             throws java.rmi.RemoteException,
                    TestNodeBusy,
                    UnsupportedProduct,
                    TaskRunnerNotSupported
Instructs the TestNode to run a given Java class and report back using the listener any information returned by the task.

Parameters:
className - The fully qualified name of the class to be run.
parameters - The parameters to be passed to this class.
timeoutValue - The amount of time the class is given to produce the expected output. If it doesn't then the value RESULT_TIMEOUT is returned.
listener - A class which should be informed when the task returns information.
Throws:
java.rmi.RemoteException - Thrown by the RMI implementation.
TestNodeBusy
UnsupportedProduct
TaskRunnerNotSupported

terminateTask

void terminateTask(TaskIdInterface taskId,
                   java.lang.String testPermutationCode)
                   throws java.rmi.RemoteException,
                          NoSuchTaskId
Throws:
java.rmi.RemoteException
NoSuchTaskId

terminateAllTasks

boolean terminateAllTasks()
                          throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

updateSoftware

boolean updateSoftware()
                       throws java.rmi.RemoteException,
                              TestNodeBusy
Instructs the testnode to update its software for all the products it supports. Using the ProductRepository it can check to ensure it has the latest versions of any product it supports.

Returns:
True if the software update was successfull, otherwise false.
Throws:
java.rmi.RemoteException
TestNodeBusy

updateSoftware

boolean updateSoftware(java.lang.String productName,
                       boolean deploySoftware)
                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

shutdown

void shutdown(boolean restart,
              boolean onComplete)
              throws java.rmi.RemoteException
Instructs the TestNode to deregister with the ServiceRegister and shutdown

Parameters:
restart - If true the testnode will request to be restarted once it has shutdown this will be used after a software update.
onComplete - If true the testnode will wait until it has completed it's current test before shutting down.
Throws:
java.rmi.RemoteException

generateTaskId

TaskIdInterface generateTaskId(java.lang.String taskName)
                               throws java.rmi.RemoteException,
                                      TestNodeBusy
Generates a default task id.

Parameters:
taskName - A name given to this task.
Returns:
The TaskId
Throws:
java.rmi.RemoteException
TestNodeBusy

initiateTest

void initiateTest(java.lang.String currentTestId,
                  TaskIdInterface taskId)
                  throws java.rmi.RemoteException,
                         TestNodeBusy
Throws:
java.rmi.RemoteException
TestNodeBusy

testFinished

void testFinished(java.lang.String permutationCode,
                  TaskIdInterface taskId,
                  java.lang.String testId)
                  throws java.rmi.RemoteException,
                         TasksStillRunning
Inform the test node that the test has finished and that it is now free to perform other tests. This also initiates the upload of results generated by the tasks to the coordinator.

Parameters:
taskId - The taskId indentifying the test which has finished.
testId - A string identifier for this test used to report back the results to the Coordinator
Throws:
java.rmi.RemoteException
TasksStillRunning

waitForTask

void waitForTask(TaskIdInterface taskId)
                 throws java.rmi.RemoteException,
                        NoSuchTaskId,
                        java.lang.InterruptedException
This method blocks until the task identified completes or until the timeoutValue elapses

Parameters:
taskId - The taskId identifying the task which must complete.
Throws:
NoSuchTaskId - This is thrown if a task isn't running with this task id.
java.rmi.RemoteException
java.lang.InterruptedException

getActiveTaskList

java.lang.String[] getActiveTaskList()
                                     throws java.rmi.RemoteException
THis method returns the list of tasks currently being run by this node.

Returns:
An array of task names currently being run.
Throws:
java.rmi.RemoteException

getNodeDescription

TestNodeDescription getNodeDescription()
                                       throws java.rmi.RemoteException
This methods returns the description of this test node.

Returns:
Throws:
java.rmi.RemoteException

getDeployLogOutput

RemoteFileReaderInterface getDeployLogOutput(java.lang.String productName,
                                             boolean outOrErr)
                                             throws java.io.IOException,
                                                    java.rmi.RemoteException
This method retrieves an InputStream for the log output for a deployment.

Parameters:
productName -
outOrErr - True indicates the output stream and False indicates the error stream
Returns:
An input stream to the data
Throws:
java.rmi.RemoteException
java.io.IOException