Files
qt5-legatus-legacy/Lts/Services/ParticipantManagement/ModuleTests/ppm_tests.h
T
2026-08-13 18:33:10 +02:00

107 lines
4.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
*
* PPM Function Topic test executable
*
* ModuleTests for PPM function topics
* ---------------------------------------------------
*
* => (!) Preconditons:
* - Service svcParticipantManagement -e 0 running
*
* -------------------------------------------------
*
* $Id$
* $HeadURL$
* $Author$
*
* Created by Hannes Baeuerle, SLSE, 2015-07-18
*/
#pragma once
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <ParticipantManagement/ppm_ftc_types.h>
#include <DDS/DDSConnector/dds_connector.h>
#include <ParticipantManagement/logger.h>
//----------------------------------------------------------------------------------
namespace ParticipantManagement
{
class PpmTests : public QObject
, protected ParticipantManagement::Interface::Ftc::ModifyTypeReplyHandler
, protected ParticipantManagement::Interface::Ftc::RemoveTypeReplyHandler
, protected ParticipantManagement::Interface::Ftc::ModifyEquipmentTypeDataReplyHandler
, protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler
, protected ParticipantManagement::Interface::Ftc::ModifyPartyDataReplyHandler
, protected ParticipantManagement::Interface::Ftc::ModifyTemplateDataReplyHandler
, protected ParticipantManagement::Interface::Ftc::RemovePartyReplyHandler
, protected ParticipantManagement::Interface::Ftc::SyncPartiesReplyHandler
, protected ParticipantManagement::Interface::Ftc::ChangePartyUsedStateReplyHandler
, protected ParticipantManagement::Interface::Ftc::RegisterParticipantReplyHandler
{
Q_OBJECT
public:
explicit PpmTests(QObject *parent = nullptr);
~PpmTests();
bool init(int domainId, int exerciseId, int testId, int partyId, int typeId, int equipmentId, int participantId);
bool testsSuccessful() const { return m_bTestsSuccessful; }
public Q_SLOTS:
void startTest();
protected Q_SLOTS:
void tryCreateEquipmentType();
void tryCreateType();
void tryModifyType();
void tryRemoveType();
void tryCreateParticipant();
void tryCreateParty();
void tryModifyParty();
void tryRemoveParty();
void trySyncParties();
void tryChangeUsed();
void tryCreateTemplate();
void tryUpdateInfoParticipant();
void tryRegisterParticipant();
protected:
void onModifyTypeReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onRemoveTypeReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); }
void onModifyEquipmentTypeDataReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onRemovePartyReply(const Core::FunctionReplyObject &replyObject) override final;
void onSyncPartiesReply(const Core::FunctionReplyObject &replyObject) override final;
void onChangePartyUsedStateReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); }
void onRegisterParticipantReply(const RegisterReply &reply) override final;
// general
void onError(const QString &reason);
void onCreateReply(const Core::FunctionReplyObject &replyObject);
void onModifyReply(const Core::FunctionReplyObject &replyObject);
void onRemoveReply(const Core::FunctionReplyObject &replyObject);
void failExit();
void successExit();
private:
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
int m_testId;
int m_partyId;
int m_typeId;
int m_equipmentId;
int m_participantId;
bool m_bTestsSuccessful;
LOGGER_T m_logger;
};
} // namespace ParticipantManagement