unitee.server
Class DefaultTest

java.lang.Object
  |
  +--unitee.server.DefaultTest
Direct Known Subclasses:
DefaultTestCaseHolder, DefaultTestSuite

public abstract class DefaultTest
extends java.lang.Object
implements Test


Constructor Summary
protected DefaultTest()
           
protected DefaultTest(java.lang.String name)
           
protected DefaultTest(java.lang.String name, TestSuite parent)
           
 
Method Summary
 TestSuite asSuite()
          Tries to transform this AbstractTest into a TestSuite.
 TestCaseHolder asTestCase()
          Tries to transform this AbstractTest into a TestCaseHolder.
 java.lang.String getName()
          Returns the name of the test.
 TestSuite getParent()
          Returns the TestSuite that holds this test.
 java.lang.String getQualifiedName()
           
 TestParameters getTestParameters()
          Returns the test parameters that are used by this test.
abstract  void init()
          Initializes the test.
 void setName(java.lang.String newName)
          Sets the name of test to newTest.
 void setParent(TestSuite newParent)
           
 void setTestParameters(TestParameters params)
           
abstract  void test(TestReport report)
          Runs the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTest

protected DefaultTest()

DefaultTest

protected DefaultTest(java.lang.String name)

DefaultTest

protected DefaultTest(java.lang.String name,
                      TestSuite parent)
Method Detail

getName

public java.lang.String getName()
Returns the name of the test.
Specified by:
getName in interface Test
Tags copied from interface: Test
Returns:
String
Throws:
Returns - the name of the test.

getQualifiedName

public java.lang.String getQualifiedName()
Specified by:
getQualifiedName in interface Test
Tags copied from interface: Test
Returns:
String
Throws:
-  

init

public abstract void init()
                   throws ParameterException
Initializes the test. If the test needs parameters , the framework is responsible to deliver them , but not through this method.
Specified by:
init in interface Test
Tags copied from interface: Test
Returns:
void
Throws:
ParameterException - Initializes the test. If the test needs parameters , the framework is responsible to deliver them , but not through this method.

asSuite

public TestSuite asSuite()
Tries to transform this AbstractTest into a TestSuite.
Specified by:
asSuite in interface Test
Returns:
this AbstractTest as a TestSuite on success or null on failure.

asTestCase

public TestCaseHolder asTestCase()
Description copied from interface: Test
Tries to transform this AbstractTest into a TestCaseHolder.
Specified by:
asTestCase in interface Test
Tags copied from interface: Test
Returns:
this test as a TestSuite on success or null on failure.

setName

public void setName(java.lang.String newName)
Sets the name of test to newTest.
Specified by:
setName in interface Test
Tags copied from interface: Test
Parameters:
newName -  
Returns:
void
Throws:
Sets - the name of test to newTest.

getParent

public TestSuite getParent()
Returns the TestSuite that holds this test.
Specified by:
getParent in interface Test
Tags copied from interface: Test
Returns:
TestSuite
Throws:
Returns - the TestSuite that holds this test.

setParent

public void setParent(TestSuite newParent)
Specified by:
setParent in interface Test
Tags copied from interface: Test
Parameters:
newParent -  
Returns:
void
Throws:
-  

getTestParameters

public TestParameters getTestParameters()
Returns the test parameters that are used by this test.
Specified by:
getTestParameters in interface Test
Tags copied from interface: Test
Returns:
TestParameters
Throws:
Returns - the test parameters that are used by this test.

setTestParameters

public void setTestParameters(TestParameters params)
Specified by:
setTestParameters in interface Test
Tags copied from interface: Test
Parameters:
params -  
Returns:
void
Throws:
-  

test

public abstract void test(TestReport report)
Runs the test. The test can make use of the TestReport object to log interactions with the tested software or log test results.
The method should exit normally if it executed well -- all results are as expected and no exceptions of any kind were generated. test() should catch all unchecked exceptions (like AssertionException) and notify the framework using report.testFailed().

Every exception wether it is a system/fatal exception , internal test errors (due to bad programming , etc.) , failed assertions or exceptions thrown from the tested unit must be logged , so the test user can be notified.

If the test developer developes pesimistic test cases (which are recommanded) , any exception that is expected to be raised under these conditions , may be logged , but it must not fail the Test.

Specified by:
test in interface Test
Tags copied from interface: Test
Parameters:
report - The report to which results will be logged.