net.sourceforge.groboutils.junit.v1
Class TestRunnable

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--net.sourceforge.groboutils.junit.v1.TestRunnable
All Implemented Interfaces:
java.lang.Runnable

public abstract class TestRunnable
extends junit.framework.Assert
implements java.lang.Runnable

Instances are executed in the runTestRunnables method of the MultiThreadedTestRunner class. TestCases should define inner classes as a subclass of this, implement the runTest() method, and pass in the instantiated class as part of an array to the runTestRunnables method. Call delay to easily include a waiting period. This class allows for all assertions to be invoked, so that subclasses can be static or defined outside a TestCase. If an exception is thrown from the runTest() method, then all other test threads will terminate due to the error.

Since:
March 28, 2002
Version:
$Date: 2003/02/10 22:52:20 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
TestRunnable()
           
 
Method Summary
 void delay(long millis)
          Sleep for millis milliseconds.
 void run()
          Unable to make this a "final" method due to JDK 1.1 compatibility.
abstract  void runTest()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRunnable

public TestRunnable()
Method Detail

runTest

public abstract void runTest()
                      throws java.lang.Throwable
java.lang.Throwable

delay

public void delay(long millis)
           throws java.lang.InterruptedException
Sleep for millis milliseconds. A convenience method.

Throws:
java.lang.InterruptedException - if an interrupt occured during the 8 sleep.

run

public void run()
Unable to make this a "final" method due to JDK 1.1 compatibility. However, implementations should not override this method.

Specified by:
run in interface java.lang.Runnable


Copyright © 2001-2003 by The GroboUtils Project