113 lines
3.1 KiB
C++
Executable File
113 lines
3.1 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
*
|
|
* EXM Function Topic test executable
|
|
*
|
|
* ModuleTests for create/modify/remove marker
|
|
* ---------------------------------------------------
|
|
* Client FTC is implemented
|
|
*
|
|
* => (!) Preconditon:
|
|
* - Service svcMarkerManagent running
|
|
*
|
|
* -------------------------------------------------
|
|
*
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2016-04-18
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <MarkerManagement/mrk_ftc.h>
|
|
#include <MarkerManagement/mrk_ftc_types.h>
|
|
#include <MarkerManagement/mrk_dtc.h>
|
|
#include <MarkerManagement/mrk_dtc_types.h>
|
|
#include <MarkerManagement/logger.h>
|
|
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
|
|
namespace MarkerManagement
|
|
{
|
|
class MrkTests : public QObject
|
|
, protected MarkerManagement::Interface::Ftc::MarkerModifyReplyHandler
|
|
, protected MarkerManagement::Interface::Ftc::MarkerRemoveReplyHandler
|
|
, protected MarkerManagement::Interface::Ftc::SnapshotModifyReplyHandler
|
|
, protected MarkerManagement::Interface::Ftc::SnapshotRemoveReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit MrkTests(QObject *parent = nullptr);
|
|
~MrkTests();
|
|
|
|
bool init(int domainId, int exerciseId, int testId, int markerId, int snapshotId);
|
|
bool testsSuccessful() const { return m_bTestsSuccessful; }
|
|
|
|
public Q_SLOTS:
|
|
void startTest();
|
|
|
|
protected Q_SLOTS:
|
|
// used to check FTC
|
|
void tryCreate();
|
|
void tryModify();
|
|
void tryRemove();
|
|
|
|
void tryCreateSnapshot();
|
|
void tryModifySnapshot();
|
|
void tryRemoveSnapshot();
|
|
|
|
// used to check DTC
|
|
void tryGetAllMarkers();
|
|
void tryGetMarker();
|
|
|
|
// used to check DTC signal/slot connection
|
|
void onReceiveMarkerChanged(const Marker &data, DataModification modType);
|
|
|
|
protected:
|
|
// Callbackfunctions for FTC
|
|
void onMarkerCreateReply(const Core::FunctionReplyObject &replyObject);
|
|
void onMarkerModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
void onMarkerRemoveReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
|
|
void onSnapshotCreateReply(const Core::FunctionReplyObject &replyObject);
|
|
void onSnapshotModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
void onSnapshotRemoveReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
|
|
private Q_SLOTS:
|
|
bool onCompareCreatedData(Marker &data);
|
|
bool onCompareModifiedData(Marker &data);
|
|
|
|
private:
|
|
void getMarkerCreateRequestData(MarkerModifyRequest &data);
|
|
void getMarkerModifyRequestData(MarkerModifyRequest &data);
|
|
void getMarkerDescriptionCreateRequestData(MarkerModifyRequest &data);
|
|
void failExit();
|
|
|
|
private:
|
|
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
|
std::shared_ptr<MarkerManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<MarkerManagement::Interface::Dtc> m_dtc;
|
|
|
|
qint32 m_exerciseId;
|
|
int m_testId;
|
|
int m_markerId;
|
|
int m_snapshotId;
|
|
|
|
enum TestStep
|
|
{
|
|
eUnknown,
|
|
eCreate,
|
|
eModify,
|
|
eRemove,
|
|
eGetAllMarkers,
|
|
eGetMarker
|
|
} m_eTestStep;
|
|
|
|
bool m_bTestsSuccessful;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
|
|
} // namespace MarkerManagement
|