unitee.server
Class DefaultTestSuite

java.lang.Object
  |
  +--unitee.server.DefaultTest
        |
        +--unitee.server.DefaultTestSuite

public class DefaultTestSuite
extends DefaultTest
implements TestSuite

Test suite is testable too. Testing a TestSuite means to run all test cases and nested TestSuites of the test suite. The test suite has two states: construction time and production time. Construction time is when the suite is being built (on system start up) and production is thereafter. Most of the suite data is managed by the states.


Constructor Summary
DefaultTestSuite()
           
DefaultTestSuite(java.lang.String name)
           
 
Method Summary
 void addTest(Test test)
          Adds a test into this suite.
 TestSuite asSuite()
          Tries to transform this class into TestSuite.
 void endConstructionMode()
          Ends construction mode.
 Test findTest(java.lang.String qualifiedName)
          Searches for a test in this test suite and in the child suites.
 Test[] getTests()
          Returns all tests (both test case holders and test suites).
 void init()
          Initializes all tests within this suite.
 void relocate(int oldIndex, int newIndex)
          Relocates a test within this test suite and shrinks the array.
 void removeTest(Test test)
          Deletes a test from this suite.
 void test(TestReport report)
          Calls test() for every test within this suite.
 
Methods inherited from class unitee.server.DefaultTest
asTestCase, getName, getParent, getQualifiedName, getTestParameters, setName, setParent, setTestParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTestSuite

public DefaultTestSuite()

DefaultTestSuite

public DefaultTestSuite(java.lang.String name)
Method Detail

endConstructionMode

public void endConstructionMode()
Ends construction mode. This method is called after the suite was loaded and set up (by calling addTest()s) from persistent storage.

addTest

public void addTest(Test test)
Adds a test into this suite.
Specified by:
addTest in interface TestSuite

removeTest

public void removeTest(Test test)
Deletes a test from this suite.
Specified by:
removeTest in interface TestSuite

getTests

public Test[] getTests()
Returns all tests (both test case holders and test suites).
Specified by:
getTests in interface TestSuite

init

public void init()
          throws ParameterException
Initializes all tests within this suite.
Specified by:
init in interface TestSuite
Overrides:
init in class DefaultTest
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 class into TestSuite.
Specified by:
asSuite in interface TestSuite
Overrides:
asSuite in class DefaultTest
Tags copied from interface: TestSuite
Throws:
Tries - to transform this class into TestSuite.

test

public void test(TestReport report)
Calls test() for every test within this suite. Deprecated behavior: This method should capture all subtests (both TestCaseHolders and TestSuites) and create a clone on which the tests will be run. By this , clients of the test suite can add or remove tests while a test() is in progress. Or , better yet , any requests to the suite will be logged and executed when the test finishes.
Specified by:
test in interface TestSuite
Overrides:
test in class DefaultTest
Tags copied from interface: Test
Parameters:
report - The report to which results will be logged.

relocate

public void relocate(int oldIndex,
                     int newIndex)
Relocates a test within this test suite and shrinks the array. If your array is - [ a b c d e f ] , and you run relocate(2,5) You will get --> [ a c d e b f ]. If your array is - [ a b c d e f ] , and you run relocate(5,2) You will get --> [ a e b c d f ]. do nothing.
Specified by:
relocate in interface TestSuite
Tags copied from interface: TestSuite
Throws:
-  

findTest

public Test findTest(java.lang.String qualifiedName)
Searches for a test in this test suite and in the child suites.
Specified by:
findTest in interface TestSuite
Returns:
the found test , or null if the qualified name does not exist in this suite.