unitee.server
Class DefaultTestCaseHolder

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

public class DefaultTestCaseHolder
extends DefaultTest
implements TestCaseHolder

A wrapper over TestCase. ParameterizedTestCase is responsible to provide parameters to the TestCase's init() method. The class keeps the class name of the test case in order to lower memory usage. The test case is created on demand for init().


Constructor Summary
DefaultTestCaseHolder(java.lang.String name, TestCase testCase, TestFactory factory)
          The constructor stores the TestCase's class name , and not the given TestCase object , to save space.
 
Method Summary
 TestCaseHolder asTestCase()
          Tries to transform this AbstractTest into a TestCaseHolder.
 java.lang.String getTestCaseName()
           
 void init()
          Initializes the test.
 void test(TestReport report)
          Tests the TestCase.
 
Methods inherited from class unitee.server.DefaultTest
asSuite, 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

DefaultTestCaseHolder

public DefaultTestCaseHolder(java.lang.String name,
                             TestCase testCase,
                             TestFactory factory)
The constructor stores the TestCase's class name , and not the given TestCase object , to save space. With the testCaseFactory , it creates a new TestCase when init() is required.
Method Detail

asTestCase

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

getTestCaseName

public java.lang.String getTestCaseName()
Specified by:
getTestCaseName in interface TestCaseHolder

init

public void init()
          throws ParameterException
Description copied from class: DefaultTest
Initializes the test. If the test needs parameters , the framework is responsible to deliver them , but not through this method.
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.

test

public void test(TestReport report)
Tests the TestCase. Before forwarding the call to testCase.test(report) The method notifies the report that a new test is running in the following way:

the method calls report.setCurrentTest(testCase), and then testStarted() on start , testFinished() on finish.

In both cases , any exception thrown from the test case should be reported by report.testFailed(throwable).

Overrides:
test in class DefaultTest
Tags copied from interface: Test
Parameters:
report - The report to which results will be logged.