org.opencms.test
Class OpenCmsThreadedTestCaseSuite

java.lang.Object
  extended by org.opencms.test.OpenCmsThreadedTestCaseSuite

public class OpenCmsThreadedTestCaseSuite
extends Object

Allows to run a specific method of an OpenCmsTestCase case concurrently.

Since:
6.5.0

Field Summary
static CmsObject PARAM_CMSOBJECT
          A not-initialized OpenCms user context.
static Integer PARAM_COUNTER
          A not-initialized OpenCms user context.
 
Constructor Summary
OpenCmsThreadedTestCaseSuite(int count, OpenCmsTestCase testCase, String method, Object[] parameters)
          Generates a new threaded test case suite with the selected test case method.
 
Method Summary
 long getAllowedRuntime()
          Returns the maximum allowed runtime of this test suite.
 long getRuntime()
          Returns the runtime of this test suite.
 Throwable getThrowable()
          Returns the error that that may have been caused while initializing or running this suite, or null in case no error was thrown.
 OpenCmsThreadedTestCase[] run()
          Runs the initialized test concurrent test cases.
 void setAllowedRuntime(long allowedRuntime)
          Sets the maximum allowed runtime of this test suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CMSOBJECT

public static final CmsObject PARAM_CMSOBJECT
A not-initialized OpenCms user context.


PARAM_COUNTER

public static final Integer PARAM_COUNTER
A not-initialized OpenCms user context.

Constructor Detail

OpenCmsThreadedTestCaseSuite

public OpenCmsThreadedTestCaseSuite(int count,
                                    OpenCmsTestCase testCase,
                                    String method,
                                    Object[] parameters)
Generates a new threaded test case suite with the selected test case method.

The parameters array may contain the following placeholders:

Parameters:
count - the number of concurrent test cases to execute
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

getAllowedRuntime

public long getAllowedRuntime()
Returns the maximum allowed runtime of this test suite.

If the given limit is exceeded, then this suite will stop waiting for the running test cases to finish and generate an internal exception.

The default is the number of threads multiplied by 100 milliseconds.

Returns:
the maximum allowed runtime of this test suite

getRuntime

public long getRuntime()
Returns the runtime of this test suite.

Returns:
the runtime of this test suite

getThrowable

public Throwable getThrowable()
Returns the error that that may have been caused while initializing or running this suite, or null in case no error was thrown.

Returns:
the error that that may have been caused while initializing or running this suite, or null in case no error was thrown

run

public OpenCmsThreadedTestCase[] run()
Runs the initialized test concurrent test cases.

Returns the array of generated OpenCmsThreadedTestCase instances, which contain information about the individual test results.

*

Returns:
the array of generated OpenCmsThreadedTestCase instances

setAllowedRuntime

public void setAllowedRuntime(long allowedRuntime)
Sets the maximum allowed runtime of this test suite.

Parameters:
allowedRuntime - the maximum allowed runtime of this test suite to set