org.jboss.jrunit.harness
Class TestDriver

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.jboss.jrunit.harness.TestDriver
All Implemented Interfaces:
MessageBusListener, RemoteMemberListener, junit.framework.Test
Direct Known Subclasses:
BenchmarkTestDriver

public abstract class TestDriver
extends junit.framework.TestCase
implements MessageBusListener, RemoteMemberListener

Author:
Tom Elrod

Field Summary
static org.apache.log4j.Level DEFAULT_TEST_HARNESS_LOG_LEVEL
          The default log level for the test harness for each test case being run.
static org.apache.log4j.Level DEFAULT_TEST_LOG_LEVEL
          The default log level for the test case being run.
static long RESULTS_TIMEOUT
          The default timeout for how long to wait for test results from test clients.
static long RUN_TEST_TIMEOUT
          The default timeout for how long to wait for the test cases to run.
static long TEARDOWN_TIMEOUT
          The default timeout for how long to wait for the server test case to wait for teardown message before timing out and throwing an exception.
 
Constructor Summary
TestDriver()
           
 
Method Summary
abstract  void declareTestClasses()
          This method should call the addTestClasses() method with the client class to run, number of clients to run and the server class to run.
 void handleRemoteDataMessage(java.lang.Object message)
          Used to transfer benchmark data between VMs
 void handleRemoteTestMessage(RemoteTestMessage message)
           
 void memberChange(int numberOfMembers)
           
 void run(junit.framework.TestResult result)
           
 void setUp()
           
 void testStart()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESULTS_TIMEOUT

public static final long RESULTS_TIMEOUT
The default timeout for how long to wait for test results from test clients. The default value is 60 seconds.

See Also:
Constant Field Values

TEARDOWN_TIMEOUT

public static final long TEARDOWN_TIMEOUT
The default timeout for how long to wait for the server test case to wait for teardown message before timing out and throwing an exception. The default value is 3 mintues.

See Also:
Constant Field Values

RUN_TEST_TIMEOUT

public static final long RUN_TEST_TIMEOUT
The default timeout for how long to wait for the test cases to run. If exceeds the timeout, will throw an exception and kill all test runs. The default value is 30 seconds.

See Also:
Constant Field Values

DEFAULT_TEST_LOG_LEVEL

public static final org.apache.log4j.Level DEFAULT_TEST_LOG_LEVEL
The default log level for the test case being run. The default value is DEBUG.


DEFAULT_TEST_HARNESS_LOG_LEVEL

public static final org.apache.log4j.Level DEFAULT_TEST_HARNESS_LOG_LEVEL
The default log level for the test harness for each test case being run. The default value is ERROR.

Constructor Detail

TestDriver

public TestDriver()
Method Detail

setUp

public void setUp()

declareTestClasses

public abstract void declareTestClasses()
This method should call the addTestClasses() method with the client class to run, number of clients to run and the server class to run.


run

public void run(junit.framework.TestResult result)
Specified by:
run in interface junit.framework.Test

testStart

public void testStart()
               throws java.lang.Exception
Throws:
java.lang.Exception

handleRemoteDataMessage

public void handleRemoteDataMessage(java.lang.Object message)
Description copied from interface: MessageBusListener
Used to transfer benchmark data between VMs

Specified by:
handleRemoteDataMessage in interface MessageBusListener

handleRemoteTestMessage

public void handleRemoteTestMessage(RemoteTestMessage message)
Specified by:
handleRemoteTestMessage in interface MessageBusListener

memberChange

public void memberChange(int numberOfMembers)
Specified by:
memberChange in interface RemoteMemberListener


JRunit, a JUnit extension for distributed client/server tests.