|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.dtf.testframework.unittest.Test
public abstract class Test
This class must be extended to implement a unit test. It contains various methods that are used by the test to report information, e.g. logInformation, logResult, etc.
Field Summary | |
---|---|
protected java.lang.String[] |
_parameters
|
static int |
FAILURE
|
static int |
SUCCESS
|
static int |
UNCERTAIN
|
Constructor Summary | |
---|---|
Test()
|
Method Summary | |
---|---|
protected static java.lang.String[] |
appendServerNames(java.lang.String[] args,
java.lang.String[] serverNames)
Utility method for taking two string arrays and concatenating them |
void |
assertFailure()
This method is called to indicate that the test has failed. |
void |
assertReady()
This method is called by Servers to indicate to the testframework they are now in a state where they are ready to receive requests. |
void |
assertSuccess()
This method is called to indicate that the test has been successful i.e. |
void |
assertSuccessOrFailue(int result)
This method evaluates the result and asserts the necessary result. |
boolean |
assertTrue(boolean value)
This method evaluates the value - if it is false then the test is presumed to have failed. |
void |
assertUncertain()
This method is called to indicate that the test cannot determine whether it passed or failed. |
protected java.lang.String[] |
getParameters()
Used to retrieve the parameters passed to the test. |
java.lang.String |
getResultText()
|
static java.lang.String |
getResultText(int result)
|
java.lang.String |
getService(java.lang.String name)
|
java.lang.String |
getTaskName()
|
java.lang.String |
getTestName()
Accessor for the name of this test |
int |
getTestResult()
This method returns the result of this test. |
void |
initialise(java.lang.String testName,
java.lang.String taskName,
java.lang.String[] parameters,
HarnessInterface harness)
Initialisation routine which is called by the test framework passing the parameters for the test. |
void |
logInformation(java.lang.String information)
This method logs textual information to the logger. |
protected void |
logResult(java.lang.String result)
This method makes a call to LoggingService.logResult() which sets the result of the task in the database table TestTaskResults |
void |
logTestRunInformation(java.lang.String information)
This method logs textual information to the logger. |
boolean |
registerService(java.lang.String name,
java.lang.String ior)
|
abstract void |
run(java.lang.String[] args)
The main test method which must assert either a pass or a fail. |
void |
runTest()
Called by the framework to run the test and log the results |
void |
testComplete()
This method is called by the testframework when the test has complete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FAILURE
public static final int SUCCESS
public static final int UNCERTAIN
protected java.lang.String[] _parameters
Constructor Detail |
---|
public Test()
Method Detail |
---|
public final void initialise(java.lang.String testName, java.lang.String taskName, java.lang.String[] parameters, HarnessInterface harness)
initialise
in interface TestInterface
taskName
- The task name of this test class.testName
- The unqiue identifier for this test.parameters
- An array of string parameters.harness
- A reference to the harness which initiated this testprotected final java.lang.String[] getParameters()
public final void runTest()
runTest
in interface TestInterface
public abstract void run(java.lang.String[] args)
public final java.lang.String getTestName()
public final java.lang.String getTaskName()
public final void logInformation(java.lang.String information)
logInformation
in interface TestInterface
information
- The textual information to be logged.public final void logTestRunInformation(java.lang.String information)
information
- The textual information to be logged.public final void assertReady()
assertReady
in interface TestInterface
public final void assertSuccess()
assertSuccess
in interface TestInterface
public final void assertFailure()
assertFailure
in interface TestInterface
public final void assertUncertain()
assertUncertain
in interface TestInterface
public final boolean assertTrue(boolean value)
assertTrue
in interface TestInterface
value
- If this boolean is false the test is assumed to have failed.
public final void assertSuccessOrFailue(int result)
result
- The result to assert SUCCESS, FAILUREpublic static final java.lang.String getResultText(int result)
public final int getTestResult()
public final java.lang.String getResultText()
public final void testComplete()
testComplete
in interface TestInterface
protected final void logResult(java.lang.String result)
public boolean registerService(java.lang.String name, java.lang.String ior)
registerService
in interface TestInterface
public java.lang.String getService(java.lang.String name) throws ServiceLookupException
getService
in interface TestInterface
ServiceLookupException
protected static final java.lang.String[] appendServerNames(java.lang.String[] args, java.lang.String[] serverNames)
args
- The first string arrayserverNames
- The second string array
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |