unitee.server
Class DefaultTestManager

java.lang.Object
  |
  +--unitee.server.DefaultTestManager

public class DefaultTestManager
extends java.lang.Object
implements TestManager

A manager class for unitee framework. Client test developers which develop must use this class in order to work with unitee, e.g. find the root suite , save changes in it , run tests , etc.


Constructor Summary
DefaultTestManager()
           
 
Method Summary
protected  TestFactory createFactory()
           
 Test findTest(java.lang.String qualifiedName)
          Finds a test.
 TestSuite getRootTestSuite()
          Returns a built TestSuite object which is the root test suite in the system.
 TestFactory getTestFactory()
          Returns the factory with which the client can create Test related objects.
 void listTest(Test test, java.io.PrintStream output, boolean printHTML)
          Lists the test identified by qualifiedName, its subtests and parameters.
 void runTest(Test test, java.io.PrintStream output, boolean printHTML)
          Runs the test.
protected  void runTest(Test test, TestReport report)
           
 void saveChanges()
          Saves the changes made to the root test suite and its subtests to a persistent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTestManager

public DefaultTestManager()
Method Detail

createFactory

protected TestFactory createFactory()

getRootTestSuite

public TestSuite getRootTestSuite()
Returns a built TestSuite object which is the root test suite in the system.
Specified by:
getRootTestSuite in interface TestManager
Returns:
TestSuite

saveChanges

public void saveChanges()
Description copied from interface: TestManager
Saves the changes made to the root test suite and its subtests to a persistent store. The state of any of the tests could have changed by any other thread/client. The method saves the tree as it is NOW.
Specified by:
saveChanges in interface TestManager

listTest

public void listTest(Test test,
                     java.io.PrintStream output,
                     boolean printHTML)
Description copied from interface: TestManager
Lists the test identified by qualifiedName, its subtests and parameters.
Specified by:
listTest in interface TestManager
Tags copied from interface: TestManager
Parameters:
test - the test to be inspected
output - to which text will be printed to
printHTML - weather to emit output as HTML or not

runTest

public void runTest(Test test,
                    java.io.PrintStream output,
                    boolean printHTML)
Description copied from interface: TestManager
Runs the test. Called by Unitee clients. A client specifies the tests (if using a compound test objects) and the report depending on the type of the client (command prompt, servlet). Clients should not call test.test(report) directly ,as the processing of the test need to be on unitee's JVM.
Specified by:
runTest in interface TestManager
Tags copied from interface: TestManager
Parameters:
test - the test object to be tested
output - where to print the test results
printHTML - true if the output should be HTML formatted

runTest

protected void runTest(Test test,
                       TestReport report)

findTest

public Test findTest(java.lang.String qualifiedName)
Description copied from interface: TestManager
Finds a test. This method is a convenient method (mostly in terms of network traffic) that is logically equivilent to getRootTestSuite().findTest(qualifiedName).
Specified by:
findTest in interface TestManager

getTestFactory

public TestFactory getTestFactory()
Description copied from interface: TestManager
Returns the factory with which the client can create Test related objects.
Specified by:
getTestFactory in interface TestManager
Tags copied from interface: TestManager
Returns:
TestFactory
Throws:
-