unitee.common
Interface Test

All Known Subinterfaces:
TestCaseHolder, TestSuite
All Known Implementing Classes:
DefaultTest, RemoteTestStub

public interface Test

An internal abstraction of test. This interface serves as a wrapper for all user tests.


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()
           
 TestSuite getParent()
           
 java.lang.String getQualifiedName()
           
 TestParameters getTestParameters()
           
 void init()
           
 void setName(java.lang.String newName)
           
 void setParent(TestSuite newParent)
           
 void setTestParameters(TestParameters params)
           
 void test(TestReport report)
          Runs the test.
 

Method Detail

getName

public java.lang.String getName()
Returns:
String
Throws:
Returns - the name of the test.

getQualifiedName

public java.lang.String getQualifiedName()
Returns:
String
Throws:
-  

init

public void init()
          throws ParameterException
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.
Returns:
this AbstractTest as a TestSuite on success or null on failure.

asTestCase

public TestCaseHolder asTestCase()
Tries to transform this AbstractTest into a TestCaseHolder.
Returns:
this test as a TestSuite on success or null on failure.

setName

public void setName(java.lang.String newName)
Parameters:
newName -  
Returns:
void
Throws:
Sets - the name of test to newTest.

getParent

public TestSuite getParent()
Returns:
TestSuite
Throws:
Returns - the TestSuite that holds this test.

setParent

public void setParent(TestSuite newParent)
Parameters:
newParent -  
Returns:
void
Throws:
-  

getTestParameters

public TestParameters getTestParameters()
Returns:
TestParameters
Throws:
Returns - the test parameters that are used by this test.

setTestParameters

public void setTestParameters(TestParameters params)
Parameters:
params -  
Returns:
void
Throws:
-  

test

public 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.

Parameters:
report - The report to which results will be logged.