[AS3] Class r1.rpc.testing.RPCTestCase

[AS3] Class r1.rpc.testing.RPCTestCase

Client API
Packager1.rpc.testing
Classpublic class RPCTestCase

The class for an RPC test case. The R1-RPC/J test generator generates test cases and instantiate them into the test suite. You can manually write your own test case classes.



Public Properties
 PropertyDefined by
  callFacade : Function
[write-only]

This is a function with such a signature: function call_facade(facade:RPCFacade, cb:Function):void; The cb is a normal RPC callback.

In a test case generated by the R1-RPC/J test generation tool, a function is generated.

RPCTestCase
  checkResult : Function
[write-only]

This is a function with such a signature: function check_result(x: testCase:RPCTestCase):Boolean;

In a test case generated by the R1-RPC/J test generation tool, a function is generated for the content in the @ASTestResult tag.

For a manual test case, you should define this method, as it will be used by the test runner.

RPCTestCase
  comment : String
[read-only]
RPCTestCase
  displayTime : String
[read-only] The start time in the form of "hh:mm:ss".
RPCTestCase
  index : int
RPCTestCase
  lapse : int
The duration of the run, in milliseconds.
RPCTestCase
  message : String
The message that is set by the test runner or the test case code.
RPCTestCase
  name : String
[read-only]
RPCTestCase
  negative : Boolean
[read-only] If true, this test case is a negative test that expects an exception as the result of a run.
RPCTestCase
  paramsGenerator : Function
RPCTestCase
  state : int
RPCTestCase
  stateName : String
[read-only] The current test case state name, which is one of these: "not started", "in progress", "being run", "succeeded", and "failed".
RPCTestCase
  stateNameShort : String
[read-only] The current test case state name, which is one of these: "NotStarted", "InProgress", "BeingRun", "Succeeded", and "Failed".
RPCTestCase
  success : Boolean
RPCTestCase
  time : Date
The start time.
RPCTestCase
Public Methods
 MethodDefined by
  
RPCTestCase(suite:RPCTestSuite, name:String, comment:String = null, negative:Boolean = false)
RPCTestCase
  
call():void
The invocation driver
RPCTestCase
  
reset():void
Clear the internal state to get ready for a new run.
RPCTestCase
Public Constants
 ConstantDefined by
  BEING_RUN : int = 2
[static]
RPCTestCase
  FAILURE : int = 4
[static]
RPCTestCase
  IN_PROGRESS : int = 1
[static]
RPCTestCase
  NOT_STARTED : int = 0
[static]
RPCTestCase
  SUCCESS : int = 3
[static]
RPCTestCase
Property detail
callFacadeproperty
callFacade:Function  [write-only]

This is a function with such a signature: function call_facade(facade:RPCFacade, cb:Function):void; The cb is a normal RPC callback.

In a test case generated by the R1-RPC/J test generation tool, a function is generated. In the generated code, it calls paramsGenerator(), which is also generated for the content in the &at;@ASTestInput tag.

For a manual test case, you should define this method, as it will be used by the test runner, but paramsGenerator() is not necessary.

Implementation
    public function set callFacade(value:Function):void
checkResultproperty 
checkResult:Function  [write-only]

This is a function with such a signature: function check_result(x: testCase:RPCTestCase):Boolean;

In a test case generated by the R1-RPC/J test generation tool, a function is generated for the content in the @ASTestResult tag.

For a manual test case, you should define this method, as it will be used by the test runner.

Implementation
    public function set checkResult(value:Function):void
commentproperty 
comment:String  [read-only]Implementation
    public function get comment():String
displayTimeproperty 
displayTime:String  [read-only]

The start time in the form of "hh:mm:ss".

Implementation
    public function get displayTime():String
indexproperty 
index:int  [read-write]Implementation
    public function get index():int
    public function set index(value:int):void
lapseproperty 
lapse:int  [read-write]

The duration of the run, in milliseconds.

Implementation
    public function get lapse():int
    public function set lapse(value:int):void
messageproperty 
message:String  [read-write]

The message that is set by the test runner or the test case code.

Implementation
    public function get message():String
    public function set message(value:String):void
nameproperty 
name:String  [read-only]Implementation
    public function get name():String
negativeproperty 
negative:Boolean  [read-only]

If true, this test case is a negative test that expects an exception as the result of a run.

Implementation
    public function get negative():Boolean
paramsGeneratorproperty 
paramsGenerator:Function  [read-write]Implementation
    public function get paramsGenerator():Function
    public function set paramsGenerator(value:Function):void
stateproperty 
state:int  [read-write]

Implementation
    public function get state():int
    public function set state(value:int):void
stateNameproperty 
stateName:String  [read-only]

The current test case state name, which is one of these: "not started", "in progress", "being run", "succeeded", and "failed".

Implementation
    public function get stateName():String
stateNameShortproperty 
stateNameShort:String  [read-only]

The current test case state name, which is one of these: "NotStarted", "InProgress", "BeingRun", "Succeeded", and "Failed".

Implementation
    public function get stateNameShort():String
successproperty 
success:Boolean  [read-write]Implementation
    public function get success():Boolean
    public function set success(value:Boolean):void
timeproperty 
time:Date  [read-write]

The start time.

Implementation
    public function get time():Date
    public function set time(value:Date):void
Constructor detail
RPCTestCase()constructor
public function RPCTestCase(suite:RPCTestSuite, name:String, comment:String = null, negative:Boolean = false)Parameters
suite:RPCTestSuite
 
name:String
 
comment:String (default = null)
 
negative:Boolean (default = false)
Method detail
call()method
public function call():void

The invocation driver

reset()method 
public function reset():void

Clear the internal state to get ready for a new run.

Constant detail
BEING_RUNconstant
public static const BEING_RUN:int = 2
FAILUREconstant 
public static const FAILURE:int = 4
IN_PROGRESSconstant 
public static const IN_PROGRESS:int = 1
NOT_STARTEDconstant 
public static const NOT_STARTED:int = 0
SUCCESSconstant 
public static const SUCCESS:int = 3