Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TestCaseWithFactories Class Reference
[Test Case Support]

#include <TestCaseWithFactories.h>

Inheritance diagram for TestCaseWithFactories:

TestCaseWithEvtCheck TestCaseGenericSetUp TestCase TestCaseBasicPUSTmStream_1 TestCasePUSControlDataReporting_1 TestCasePUSFull TestCaseBasicPUSTcLoader_1 TestCasePUSClearDataReporting_1 TestCasePUSEventRepository_1 TestCasePUSTelemetryModeManager_1 List of all members.

Detailed Description

Base class for test cases that need to access the dynamic factories.

In the test set-up procedure, the dynamic factories for the telemetry packets, telecommands and manouvres are initialized and are loaded. The type of the items that are loaded are defined by the structure of the factories. Any change in the structure of the factories should be reflected by a corresponding change in this class. Test cases that need to access the dynamic factories should be constructed as subclasses of this class. <p/> The factory initialization and loading is only done the first time the test case is executed. <p/> This test case also defines a shut down procedure where all items in the factories have their status set to "item not in use". This ensures that all test cases that inherit from this class can start with all the items in the factories being available for their use.

Todo:
Use this class as base class for test cases that use items that could be provided by a dynamic factory
See also:
CC_TelemetryPacketFactory

CC_TelecommandFactory

CC_ManoeuvreFactory

Author:
A. Pasetti
Version:
1.0

Definition at line 45 of file TestCaseWithFactories.h.

Public Member Functions

 TestCaseWithFactories (int testId, char *testName)
 Set the identifier and the name of the test case.

virtual bool setUpTestCase (void)
 Call the test setup service of the super class and then initialize the dynamic factories.

virtual bool shutDownTestCase (void)
 All the items loaded in the factories in the setUpTestCase method are marked as "not in use".


Constructor & Destructor Documentation

TestCaseWithFactories::TestCaseWithFactories int  testId,
char *  testName
 

Set the identifier and the name of the test case.

Parameters:
testId the test identifier
testName the name of the test

Definition at line 67 of file TestCaseWithFactories.cpp.


Member Function Documentation

bool TestCaseWithFactories::setUpTestCase void   )  [virtual]
 

Call the test setup service of the super class and then initialize the dynamic factories.

A pseudo-code implementation of this method is as follows:

   if ( !TestCaseWithEvtCheck::setUpTestCase() )
      return false;
   else {
    if (first activation of this method) {
      retrieve the telemetry packet factory
      create telemetry packets for the telemetry packet factory
      configure telemetry packets 
      load telemetry packets in the telemetry packet factory

      retrieve the telecommand factory
      create telecommand components for the telecommand factory
      load telecommands in the telecommand factory

      retrieve the manoeuvre factory
      create manoeuvre components for the manoeuvre factory
      load manoeuvres in the manoeuvre factory

      return true;
    }
   } 
Note that the dynamic factories are implemented as singletons that are created and initialized by simply calling their getInstance method.

Reimplemented from TestCaseWithEvtCheck.

Reimplemented in TestCasePUSFull.

Definition at line 72 of file TestCaseWithFactories.cpp.

bool TestCaseWithFactories::shutDownTestCase void   )  [virtual]
 

All the items loaded in the factories in the setUpTestCase method are marked as "not in use".

The change in the "in use" status is performed by calling their setInUse method with argument NOT_IN_USE. This relieves concrete subclasses of the need to releases components that they have retrieved from a factory at the end of the test. Note that, if a concrete test case also releases the factory components by calling their setInUse method, this does not give rise to an error.

Reimplemented from TestCaseGenericSetUp.

Reimplemented in TestCasePUSFull.

Definition at line 185 of file TestCaseWithFactories.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved