remoteTester.runner
Class TestRunner

java.lang.Object
  extended byremoteTester.runner.TestRunner

public class TestRunner
extends java.lang.Object

This testRunner allows to execute runner TestCase on server side, even if the TestCase class is only available on runner side.
This is done by uploading the class codebyte on the server

To be able to locate the server a jndi.properties file must be available in the client classpath


Field Summary
static java.lang.String JNDI_TESTRUNNER
          the JNDI name of the TestRunner SB Service
 
Constructor Summary
TestRunner()
           
 
Method Summary
protected static TestRunnerRemote getTestRunnerRemoteService()
          retrieve the TestRunner Service on the server
static void main(java.lang.String[] args)
           
static boolean run(java.lang.String className)
          runTC the class on server side (class must be accessible to server classloader)
static boolean uploadAndRun(java.lang.Class classToTest)
          upload the class from runner on server side and run it
static boolean uploadAndRun(java.lang.Class classToTest, java.lang.Class[] helperClasses)
          upload the class from runner on server side and run it
static boolean uploadAndRun(java.lang.String className)
          upload the class from runner on server side and run it
static boolean uploadAndRun(java.lang.String className, java.lang.String[] helperClassNames)
          upload the class and its helper classes from client to server side and run it
static TestResultSerializable uploadAndRunWithResult(java.lang.Class clazz, java.lang.Class[] helperClasses, java.lang.String testMethodName)
          upload the class from runner on server side and run a test method on it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JNDI_TESTRUNNER

public static final java.lang.String JNDI_TESTRUNNER
the JNDI name of the TestRunner SB Service

See Also:
Constant Field Values
Constructor Detail

TestRunner

public TestRunner()
Method Detail

uploadAndRunWithResult

public static TestResultSerializable uploadAndRunWithResult(java.lang.Class clazz,
                                                            java.lang.Class[] helperClasses,
                                                            java.lang.String testMethodName)
                                                     throws java.lang.Exception
upload the class from runner on server side and run a test method on it

Parameters:
clazz - the name of a class accessible on runner classloader
helperClasses -
testMethodName - the method to test
Returns:
a TestResultSerializable
Throws:
java.lang.Exception - can be thrown by the execution of the TestCase

run

public static boolean run(java.lang.String className)
                   throws java.lang.Exception
runTC the class on server side (class must be accessible to server classloader)

Parameters:
className - name of the class to test
Throws:
java.lang.Exception - can be thrown by the execution of the TestCase

uploadAndRun

public static boolean uploadAndRun(java.lang.String className)
                            throws java.lang.Exception
upload the class from runner on server side and run it

Parameters:
className - the name of a class accessible on runner classloader
Throws:
java.lang.Exception - can be thrown by the execution of the TestCase

uploadAndRun

public static boolean uploadAndRun(java.lang.Class classToTest)
                            throws java.lang.Exception
upload the class from runner on server side and run it

Parameters:
classToTest - the class accessible on runner classloader
Throws:
java.lang.Exception - can be thrown by the execution of the TestCase

uploadAndRun

public static boolean uploadAndRun(java.lang.Class classToTest,
                                   java.lang.Class[] helperClasses)
                            throws java.lang.Exception
upload the class from runner on server side and run it

Parameters:
classToTest - the class accessible on runner classloader
helperClasses - helper classes
Throws:
java.lang.Exception - can be thrown by the execution of the TestCase

uploadAndRun

public static boolean uploadAndRun(java.lang.String className,
                                   java.lang.String[] helperClassNames)
                            throws java.lang.Exception
upload the class and its helper classes from client to server side and run it

Parameters:
className - the name of a class accessible on runner classloader
helperClassNames - full qualified helper class name
Throws:
java.lang.Exception

getTestRunnerRemoteService

protected static TestRunnerRemote getTestRunnerRemoteService()
                                                      throws java.lang.Exception
retrieve the TestRunner Service on the server

Returns:
Throws:
javax.ejb.CreateException
java.rmi.RemoteException
java.lang.Exception

main

public static void main(java.lang.String[] args)
Parameters:
args - indique le nom de la classe à tester.


Copyright © 2003-2004 Nicolas FRANK. All Rights Reserved.