unitee.client
Class RemoteTestCaseStub

java.lang.Object
  |
  +--unitee.client.AbstractStreamable
        |
        +--unitee.client.RemoteTestStub
              |
              +--unitee.client.RemoteTestCaseStub

public class RemoteTestCaseStub
extends RemoteTestStub
implements TestCase


Fields inherited from class unitee.client.AbstractStreamable
objectID
 
Constructor Summary
RemoteTestCaseStub()
           
 
Method Summary
 void init(TestParameters params)
          Initializes the TestCase with the given test parameters.
 void test(java.io.PrintStream output)
          Runs the test.
 
Methods inherited from class unitee.client.RemoteTestStub
asSuite, asTestCase, getName, getParent, getQualifiedName, getTestParameters, init, setName, setParent, setTestParameters, test
 
Methods inherited from class unitee.client.AbstractStreamable
read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteTestCaseStub

public RemoteTestCaseStub()
Method Detail

init

public void init(TestParameters params)
          throws ParameterException
Description copied from interface: TestCase
Initializes the TestCase with the given test parameters. The framework validates any input requested by the test , and throws InvalidParameterTypeException for invalid data. The test case developer can throw any extention of the ParameterException if the test does not approve one of the parameters. Optional paramters should be implemented as follows:

 public void init(TestParameters params) throws ParameterException {
   bytes = params.getBytesArray("data");
   try {
     optionalParam = params.getString("optionalParam");
     }
   catch(MissingParameterException mpe) {
      // do nothing
      }
   }
 
 
Specified by:
init in interface TestCase
Tags copied from interface: TestCase
Parameters:
params - The object containing the test data (parameters).
Throws:
ParameterException - if a requested paramter is missing or invalid. User code can throw a ParameterException (or a subclass) to indicate inappropriate values.

test

public void test(java.io.PrintStream output)
          throws java.lang.Throwable
Description copied from interface: TestCase
Runs the test. The test can make use of the OutputStream 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. The method should throw an exception of any kind when it runs into probems. Unitee framework will catch the exception and mark the test case as failed.

The test case developer should not try to catch any exception just to print the exception stack trace. Instead , the test case should focus on the methods to be tested using the given test parameters passed in via init(). 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 TestCase
Tags copied from interface: TestCase
Parameters:
output - The output stream to which the test case should write diagnostics and informatories.
Throws:
java.lang.Throwable - If any user code fails