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

TestCasePUSFull Class Reference
[Test Case Support]

#include <TestCasePUSFull.h>

Inheritance diagram for TestCasePUSFull:

TestCaseWithFactories TestCaseWithEvtCheck TestCaseGenericSetUp TestCase TestCaseBasicPUSTcLoader_1 TestCasePUSClearDataReporting_1 TestCasePUSEventRepository_1 TestCasePUSTelemetryModeManager_1 List of all members.

Detailed Description

Base class for test cases that implement a PUS-related scenario.

The test set-up procedure creates and configures several PUS-related components:

The event repository is loaded in the CC_RootObject which is then unloaded in the shutdown procedure. All the above items are created as static instances and are accessible through getter methods defined by this class.

This class is especially useful for test cases that want to perform end-to-end tests of PUS-related functionalities (many components they require are already instantiated and configured) and generally for test cases that exercise PUS-related functionalities.

In order to facilitate the task of the test developers, this class offers utility methods to load the telecommand load area associated to the telecommand loader with data representing instances of several types of telecommand packets. The telecommand packet data are loaded in the command load area associated to the telecommand loader managed by this class. This class is responsible for managing the command load area. It updates its first byte that holds the number of telecommand packets currently stored in the command area and it maintains a command area position index that points to the location in the command area where the next telecommand packet should be written. The position index is initialized to 1 and can be reset with method resetCommandLoadArea. The utility methods write both the header and the application data part of the telecommand packet. In general, except for the acknowledge field (which is specified by the caller), all other information in the telecommand packet header is given fixed default values. The header is written by method writeTcHeader.

If there is no space left in the command load area to store the telecommand packet specified by the caller of this method, then the method returns a value of false. Otherwise, the telecommand is written to the command load area and a value of true is returned.

Author:
A. Pasetti
Version:
1.0

Definition at line 63 of file TestCasePUSFull.h.

Public Member Functions

 TestCasePUSFull (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 create and configure the components listed in the class comment.

virtual bool shutDownTestCase (void)
 Restore the old event repository that was loaded at the time this test case was started.

CC_TelecommandManagergetTelecommandManager (void) const
 Return the telecommand manager created by the initialization procedure of this test case.

CC_TelemetryManagergetTelemetryManager (void) const
 Return the telemetry manager created by the initialization procedure of this test case.

DC_PUSTelemetryModeManagergetTelemetryModeManager (void) const
 Return the telemetry mode manager created by the initialization procedure of this test case.

CC_ManoeuvreManagergetManoeuvreManager (void) const
 Return the manoeuvre manager created by the initialization procedure of this test case.

DC_BasicPUSTcLoadergetTcLoader (void) const
 Return the telecommand loader created by the initialization procedure of this test case.

DC_PUSTmLoggergetTmStream (void) const
 Return the telemetry stream created by the initialization procedure of this test case.

DC_DummyObsClockgetObsClock (void) const
 Return the OBS clock created by the initialization procedure of this test case.

DC_PUSEventRepositorygetEventRepository (void) const
 Return the PUS Event Repository created by the initialization procedure of this test case.

bool writeTestPUSTelecommand (unsigned char ackField, unsigned int execCounter, bool execCheckVal, bool valCheckVal, TD_CheckCode execCheckCode, TD_CheckCode valCheckCode, bool execOutcome, unsigned short packetSeqControl)
 Load the command load area with data representing a DC_TestPUSTelecommand telecommand packet.

bool writePUSDefineDataReporting (unsigned char ackField, TD_PUSCollectionInterval collectionInterval, TD_SID sid, TD_DataPoolId par, unsigned short packetSeqControl, TD_TelecommandSubType tcSubType)
 Load the command load area with data representing a DC_PUSDefineDataReporting telecommand packet.

bool writePUSDataReportingControl (unsigned char ackField, unsigned char NSID, TD_SID *sid, TD_TelecommandSubType tcSubType, unsigned short packetSeqControl)
 Load the command load area with data representing either a DC_PUSControlDataReporting, or a DC_PUSClearDataReporting, or a DC_PUSRequestDataReporting telecommand packet.

void resetCommandLoadArea ()
 Clear the command load area.


Protected Member Functions

void writeTcHeader (unsigned short length, unsigned short packetSeqControl)
 Helper method that writes a default telecommand packet header to the telecommand load.


Constructor & Destructor Documentation

TestCasePUSFull::TestCasePUSFull 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 47 of file TestCasePUSFull.cpp.


Member Function Documentation

DC_PUSEventRepository * TestCasePUSFull::getEventRepository void   )  const
 

Return the PUS Event Repository created by the initialization procedure of this test case.

Returns:
the PUS event repository

Definition at line 210 of file TestCasePUSFull.cpp.

CC_ManoeuvreManager * TestCasePUSFull::getManoeuvreManager void   )  const
 

Return the manoeuvre manager created by the initialization procedure of this test case.

Returns:
the manoeuvre manager

Definition at line 194 of file TestCasePUSFull.cpp.

DC_DummyObsClock * TestCasePUSFull::getObsClock void   )  const
 

Return the OBS clock created by the initialization procedure of this test case.

Returns:
the OBS clock

Definition at line 206 of file TestCasePUSFull.cpp.

DC_BasicPUSTcLoader * TestCasePUSFull::getTcLoader void   )  const
 

Return the telecommand loader created by the initialization procedure of this test case.

Returns:
the telecommand loader

Definition at line 198 of file TestCasePUSFull.cpp.

CC_TelecommandManager * TestCasePUSFull::getTelecommandManager void   )  const
 

Return the telecommand manager created by the initialization procedure of this test case.

Returns:
the telecommmand manager

Definition at line 182 of file TestCasePUSFull.cpp.

CC_TelemetryManager * TestCasePUSFull::getTelemetryManager void   )  const
 

Return the telemetry manager created by the initialization procedure of this test case.

Returns:
the telemetry manager

Definition at line 186 of file TestCasePUSFull.cpp.

DC_PUSTelemetryModeManager * TestCasePUSFull::getTelemetryModeManager void   )  const
 

Return the telemetry mode manager created by the initialization procedure of this test case.

Returns:
the telemetry mode manager

Definition at line 190 of file TestCasePUSFull.cpp.

DC_PUSTmLogger * TestCasePUSFull::getTmStream void   )  const
 

Return the telemetry stream created by the initialization procedure of this test case.

Returns:
the telemetry stream

Definition at line 202 of file TestCasePUSFull.cpp.

void TestCasePUSFull::resetCommandLoadArea  ) 
 

Clear the command load area.

The command load area position index is reset to one and the first byte of the command load area is reset to zero.

Definition at line 214 of file TestCasePUSFull.cpp.

bool TestCasePUSFull::setUpTestCase void   )  [virtual]
 

Call the test setup service of the super class and then create and configure the components listed in the class comment.

Component creation and configuration of some parameters is only performed the first time this method is executed. Configuration parameters that can updated once are instead set at every activation. This ensures that all derived test cases can rely on the same initial configuration. The values of the configuration parameters are constants that are defined in file TestConstants.h. This method also loads the PUS event repository in CC_RootObject.

Reimplemented from TestCaseWithFactories.

Definition at line 52 of file TestCasePUSFull.cpp.

bool TestCasePUSFull::writePUSDataReportingControl unsigned char  ackField,
unsigned char  NSID,
TD_SID sid,
TD_TelecommandSubType  tcSubType,
unsigned short  packetSeqControl
 

Load the command load area with data representing either a DC_PUSControlDataReporting, or a DC_PUSClearDataReporting, or a DC_PUSRequestDataReporting telecommand packet.

The telecommand content is specified by its subtype and by an array that holds the SIDs of data reporting telecommands that must be controlled, cleared, or requested.

See also:
DC_PUSDefineDataReporting
Parameters:
ackField the acknowledge field of the telecommand
NSID the number of SIDs in the telecommand
sid the array holding the SIDs
tcSubType the telecommand subtype
packetSeqControl the packet sequence control field
Returns:
true if the telecommand packet could be successfully written, false otherwise

Definition at line 268 of file TestCasePUSFull.cpp.

bool TestCasePUSFull::writePUSDefineDataReporting unsigned char  ackField,
TD_PUSCollectionInterval  collectionInterval,
TD_SID  sid,
TD_DataPoolId  par,
unsigned short  packetSeqControl,
TD_TelecommandSubType  tcSubType
 

Load the command load area with data representing a DC_PUSDefineDataReporting telecommand packet.

A simple instance of the telecommand is written that includes only one parameter to be sample at every collection interval.

See also:
DC_PUSDefineDataReporting
Parameters:
ackField the acknowledge field of the telecommand
collectionInterval the collection interval
sid the SID of the packet being defined
par the parameter to be sampled
packetSeqControl the packet sequence control field
tcSubType the subtype of the telecommand packet
Returns:
true if the telecommand packet could be successfully written, false otherwise

Definition at line 305 of file TestCasePUSFull.cpp.

void TestCasePUSFull::writeTcHeader unsigned short  length,
unsigned short  packetSeqControl
[protected]
 

Helper method that writes a default telecommand packet header to the telecommand load.

This method is called by the methods that write telecommands packets to the telecommand load area.

Parameters:
length the "packet length" field of the telecommand packet
packetSeqControl the packet sequence control field of the telecommand packet

Definition at line 219 of file TestCasePUSFull.cpp.

bool TestCasePUSFull::writeTestPUSTelecommand unsigned char  ackField,
unsigned int  execCounter,
bool  execCheckVal,
bool  valCheckVal,
TD_CheckCode  execCheckCode,
TD_CheckCode  valCheckCode,
bool  execOutcome,
unsigned short  packetSeqControl
 

Load the command load area with data representing a DC_TestPUSTelecommand telecommand packet.

See also:
DC_TestPUSTelecommand
Parameters:
ackField the acknowledge field of the telecommand
execCounter the execution counter value
execCheckVal the execution check value
valCheckVal the validity check value
execCheckCode the execution check code
valCheckCode the validity check code
execOutcome the outcome of the execution check
packetSeqControl the packet sequence control field
Returns:
true if the telecommand packet could be successfully written, false otherwise

Definition at line 228 of file TestCasePUSFull.cpp.


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