/** * @RDE_HEADER@ * ISM Function Topic test executable * $Id$ * $HeadURL$ * $Author$ * Created by Iuliana Ojog, SLSE, 2016-11-28 */ #pragma once #include #include #include #include #include #include #include #include #include namespace InfrastructureManagement { using DbHandler = NGLDB::DbServiceHandler; class IsmTests : public QObject , protected InfrastructureManagement::Interface::Ftc::InstrumentationAssetModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::InstrumentationAssetRemoveReplyHandler , protected InfrastructureManagement::Interface::Ftc::MountingPointAssetModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::MountingPointAssetRemoveReplyHandler , protected InfrastructureManagement::Interface::Ftc::MainScheduleModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::MainScheduleRemoveReplyHandler , protected InfrastructureManagement::Interface::Ftc::MountingPointPlanModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::MainStructureElementModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::MainStructureElementModifyBridgeStatusReplyHandler , protected InfrastructureManagement::Interface::Ftc::MainStructureElementRemoveReplyHandler , protected InfrastructureManagement::Interface::Ftc::StructureElementModifyReplyHandler , protected InfrastructureManagement::Interface::Ftc::InstrumentationAssetSetStateReplyHandler { Q_OBJECT public: explicit IsmTests(QObject *parent = nullptr); ~IsmTests(); bool init(int domainId, int testId, int assetId, int mainStructureElementId, int structureElementId, int indexNo); bool testsSuccessful() const { return m_bTestsSuccessful; } public Q_SLOTS: void startTest(); protected Q_SLOTS: // assets void tryCreateAsset(); void tryModifyAsset(); void tryRemoveAsset(); void tryUnmountAsset(); // main structure elements void tryCreateMainStructureElement(); void tryModifyMainStructureElement(); void tryRemoveMainStructureElement(); void tryCreateBridge(); void tryChangeBridgeStatus(); // mounting point assets void tryCreateMountingPointAsset(); void tryRemoveMountingPointAsset(); // mounting point schedule void tryCreateMainSchedule(); void tryModifyMainSchedule(); void tryRemoveMainSchedule(); void tryChangeStatusSchedule(); void tryCopySchedule(); void checkSchedule(); // mounting point plan void tryCreateMountingPointPlan(); protected: // assets void onInstrumentationAssetModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } void onInstrumentationAssetRemoveReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } void onInstrumentationAssetSetStateReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } // main structure elements void onMainStructureElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } void onMainStructureElementRemoveReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } void onMainStructureElementModifyBridgeStatusReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } // structure elements void onStructureElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } // mounting point assets void onMountingPointAssetModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } void onMountingPointAssetRemoveReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } // mounting point schedule void onMainScheduleModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } void onMainScheduleRemoveReply(const Core::FunctionReplyObject &replyObject) override final { onRemoveReply(replyObject); } // mounting point plan void onMountingPointPlanModifyReply(const Core::FunctionReplyObject &replyObject) override final { onModifyReply(replyObject); } // 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(); private: std::shared_ptr m_ddsConnector; std::shared_ptr m_ftc; std::shared_ptr m_dtc; std::shared_ptr m_db; std::shared_ptr m_dbHandler; // given int m_testId; int m_assetId; // used for mounting point schedule id as well int m_mainStructureElementId; int m_structureElementId; int m_indexNo; // found per custom dtc methods int m_mountingPointAssetId; int m_mountingPointPlanId; bool m_bTestsSuccessful; bool m_replyFinished; LOGGER_T m_logger; }; } // namespace InfrastructureManagement