org.opencms.test
Class OpenCmsThreadedTestCase

java.lang.Object
  extended by java.lang.Thread
      extended by org.opencms.test.OpenCmsThreadedTestCase
All Implemented Interfaces:
Runnable

public class OpenCmsThreadedTestCase
extends Thread

Allows to run an OpenCmsTestCase in a separate Thread, for concurrent execution.

Usually this class is created by a OpenCmsThreadedTestCaseSuite.

Since:
6.5.0

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
OpenCmsThreadedTestCase(OpenCmsTestCase testCase, Method method, Object[] parameters)
          Generates a new threaded test case.
 
Method Summary
 Object getResult()
          Returns the (optional) result object of the selected test method.
 long getRuntime()
          Returns the total runtime of this thread, or -1 if the thread was not run at all.
 Throwable getThrowable()
          Returns the stored Throwable that was thrown when executing the selected test method, or null if the test method did not cause an exception.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenCmsThreadedTestCase

public OpenCmsThreadedTestCase(OpenCmsTestCase testCase,
                               Method method,
                               Object[] parameters)
Generates a new threaded test case.

Parameters:
testCase - the test case class to use
method - the method to execute on the test case
parameters - the parameter values for the method
Method Detail

getResult

public Object getResult()
Returns the (optional) result object of the selected test method.

Returns:
the (optional) result object of the selected test method

getRuntime

public long getRuntime()
Returns the total runtime of this thread, or -1 if the thread was not run at all.

Returns:
the total runtime of this thread, or -1 if the thread was not run at all

getThrowable

public Throwable getThrowable()
Returns the stored Throwable that was thrown when executing the selected test method, or null if the test method did not cause an exception.

Returns:
the stored Throwable that was thrown when executing the selected test method, or null if the test method did not cause an exception

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Runnable.run()