SpaceshipObject Unit Test Procedures for SpacePort

EventHelix.com/EventStudio 2.0
Generated on 05-Jul-03 16:41

Code Reviewed By:

Unit Tested By:

Successful Spacecraft Docking and Undocking

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object spaceship_obj (Created by spaceship_obj_mgr)
  1. Check if object spaceship_obj has been initialized correctly
  2. spaceship_obj should change state to "Idle"

CR:

UT:

2.Send DockingRequest to spaceship_obj (Message from spaceship_obj_mgr) with parameters spacecraft_num
  1. DockingRequest message handler should be called
  2. spaceship_obj should change state to "Checking Resources"
  3. spaceship_obj should send OrbitAvailabilityCheck to orbit_allocator

CR:

UT:

3.Send OrbitAvailabilityStatus to spaceship_obj (Message from orbit_allocator) with parameters status = ORBIT_AVAILABLE
  1. OrbitAvailabilityStatus message handler should be called
  2. spaceship_obj should send DockingPortAvailabilityCheck to docking_allocator
  3. spaceship_obj should send DockingPermitted to auto_dock with fields spacecraft_num
  4. spaceship_obj should change state to "Awaiting Orbit Request"

CR:

UT:

4.Send OrbitRequest to spaceship_obj (Message from auto_dock)
  1. OrbitRequest message handler should be called
  2. spaceship_obj should change state to "Allocating Orbit"
  3. spaceship_obj should send OrbitAllocRequest to orbit_allocator

CR:

UT:

5.Send OrbitAllocResponse to spaceship_obj (Message from orbit_allocator) with parameters orbit_location
  1. OrbitAllocResponse message handler should be called
  2. spaceship_obj should send OrbitAssign to auto_dock with fields orbit_location
  3. spaceship_obj should change state to "Awaiting Docking"

CR:

UT:

6.Send ReadyForDocking to spaceship_obj (Message from auto_dock)
  1. ReadyForDocking message handler should be called
  2. spaceship_obj should change state to "Docking in Progress"
  3. spaceship_obj should start timer tawait_docking_finished
  4. spaceship_obj should create object docking
  5. spaceship_obj should send ReadyForDocking to docking

CR:

UT:

7.Send DockingFinished to spaceship_obj (Message from docking) with parameters status = SUCCESS
  1. DockingFinished message handler should be called
  2. spaceship_obj should stop timer tawait_docking_finished
  3. spaceship_obj should delete object docking
  4. spaceship_obj should change state to "Freeing Orbit"
  5. spaceship_obj should send OrbitDeallocRequest to orbit_allocator

CR:

UT:

8.Send OrbitDeallocResponse to spaceship_obj (Message from orbit_allocator)
  1. OrbitDeallocResponse message handler should be called
  2. spaceship_obj should change state to "Docked"

CR:

UT:

9.Send UndockingRequest to spaceship_obj (Message from auto_dock)
  1. UndockingRequest message handler should be called
  2. spaceship_obj should take action "Finish docking or undocking that is in progress"
  3. spaceship_obj should change state to "Undocking in Progress"
  4. spaceship_obj should start timer tawait_undocking_finished
  5. spaceship_obj should create object undocking
  6. spaceship_obj should send UndockingRequest to undocking

CR:

UT:

10.Send UndockingFinished to spaceship_obj (Message from undocking) with parameters status = SUCCESS
  1. UndockingFinished message handler should be called
  2. spaceship_obj should stop timer tawait_undocking_finished
  3. spaceship_obj should delete object undocking
  4. spaceship_obj should change state to "Freeing Docking Port"
  5. spaceship_obj should send DockingPortDeallocRequest to docking_allocator

CR:

UT:

11.Send DockingPortDeallocAck to spaceship_obj (Message from docking_allocator)
  1. DockingPortDeallocAck message handler should be called

CR:

UT:

12.Send OrbitDeassign to spaceship_obj (Message from auto_dock)
  1. OrbitDeassign message handler should be called
  2. spaceship_obj should change state to "Freeing Orbit"
  3. spaceship_obj should send OrbitDeallocRequest to orbit_allocator

CR:

UT:

13.Send OrbitDeallocResponse to spaceship_obj (Message from orbit_allocator)
  1. OrbitDeallocResponse message handler should be called
  2. spaceship_obj should send OrbitDeassignAck to auto_dock
  3. spaceship_obj should send UndockingFinished to spaceship_obj_mgr with fields status = SUCCESS

CR:

UT:

14.Delete object spaceship_obj (Deleted by spaceship_obj_mgr)
  1. Verify that object spaceship_obj has released all resources

CR:

UT:

Orbit Resource not Available

Leg Taken:

Test Procedures:

NumActionResultStatus
1.Create object spaceship_obj (Created by spaceship_obj_mgr)
  1. Check if object spaceship_obj has been initialized correctly
  2. spaceship_obj should change state to "Idle"

CR:

UT:

2.Send DockingRequest to spaceship_obj (Message from spaceship_obj_mgr) with parameters spacecraft_num
  1. DockingRequest message handler should be called
  2. spaceship_obj should change state to "Checking Resources"
  3. spaceship_obj should send OrbitAvailabilityCheck to orbit_allocator

CR:

UT:

3.Send OrbitAvailabilityStatus to spaceship_obj (Message from orbit_allocator) with parameters status = NO_ORBIT_AVAILABLE
  1. OrbitAvailabilityStatus message handler should be called
  2. spaceship_obj should send DockingRejected to spaceship_obj_mgr with fields spacecraft_num, reason = NO_ORBIT_AVAILABLE

CR:

UT:

4.Delete object spaceship_obj (Deleted by spaceship_obj_mgr)
  1. Verify that object spaceship_obj has released all resources

CR:

UT:

Docking Resource not Available

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object spaceship_obj (Created by spaceship_obj_mgr)
  1. Check if object spaceship_obj has been initialized correctly
  2. spaceship_obj should change state to "Idle"

CR:

UT:

2.Send DockingRequest to spaceship_obj (Message from spaceship_obj_mgr) with parameters spacecraft_num
  1. DockingRequest message handler should be called
  2. spaceship_obj should change state to "Checking Resources"
  3. spaceship_obj should send OrbitAvailabilityCheck to orbit_allocator

CR:

UT:

3.Send OrbitAvailabilityStatus to spaceship_obj (Message from orbit_allocator) with parameters status = ORBIT_AVAILABLE
  1. OrbitAvailabilityStatus message handler should be called
  2. spaceship_obj should send DockingPortAvailabilityCheck to docking_allocator

CR:

UT:

4.Send PortAvailabilityStatus to spaceship_obj (Message from docking_allocator) with parameters status = NO_PORT_AVAILABLE
  1. PortAvailabilityStatus message handler should be called
  2. spaceship_obj should send DockingRejected to spaceship_obj_mgr with fields spacecraft_num, reason = NO_PORT_AVAILABLE

CR:

UT:

5.Delete object spaceship_obj (Deleted by spaceship_obj_mgr)
  1. Verify that object spaceship_obj has released all resources

CR:

UT: