Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+16
-17
@@ -19,12 +19,11 @@
|
||||
//---------------------------------------------------------------------------------
|
||||
namespace SituationReplay
|
||||
{
|
||||
SrpDtTests::SrpDtTests(QObject *parent)
|
||||
: QObject(parent)
|
||||
SrpDtTests::SrpDtTests(QObject *parent) : QObject(parent)
|
||||
, m_replayPartitionId(0)
|
||||
, m_situationReplayId(0)
|
||||
, m_bTestsSuccessful(true)
|
||||
{
|
||||
, m_bTestsSuccessful(true),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
|
||||
@@ -35,7 +34,7 @@ SrpDtTests::~SrpDtTests()
|
||||
//---------------------------------------------------------------------------------
|
||||
bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
{
|
||||
DEBUG_LOG() << "init begin";
|
||||
DEBUG_LOG(m_logger) << "init begin";
|
||||
m_replayPartitionId = replayPartitionId;
|
||||
|
||||
// initialize DDS
|
||||
@@ -51,11 +50,11 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
// DdsInterface Publisher
|
||||
//m_ddsConnector->setPublisher(new Publisher(domainId, m_ddsConnector->getPartition(), m_ddsConnector->getDomainParticipant()));
|
||||
|
||||
DEBUG_LOG() << "Create dtc";
|
||||
DEBUG_LOG(m_logger) << "Create dtc";
|
||||
m_dtc = SituationReplay::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "Init dtc";
|
||||
DEBUG_LOG(m_logger) << "Init dtc";
|
||||
bool bRet = m_dtc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
connect(m_dtc.get(), &SituationReplay::Interface::Dtc::sitReplayChanged,
|
||||
this, &SrpDtTests::onReceiveSituationReplayData);
|
||||
@@ -66,26 +65,26 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
QTimer::singleShot(1000, this, &SrpDtTests::tryGetAllSituationReplays);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetAllSituationReplays()
|
||||
{
|
||||
INFO_LOG() << "trying to get all situationReplays";
|
||||
INFO_LOG(m_logger) << "trying to get all situationReplays";
|
||||
const QMap<qint32, SituationReplay::SitReplay> map = m_dtc->sitReplays();
|
||||
if (map.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting all situation replay data";
|
||||
ERROR_LOG(m_logger) << "Error requesting all situation replay data";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "Amout of existing situation replays = " << map.size();
|
||||
INFO_LOG(m_logger) << "Amout of existing situation replays = " << map.size();
|
||||
m_situationReplayId = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
INFO_LOG() << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
INFO_LOG(m_logger) << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
}
|
||||
|
||||
QTimer::singleShot(10, this, &SrpDtTests::tryGetSituationReplay);
|
||||
@@ -94,17 +93,17 @@ void SrpDtTests::tryGetAllSituationReplays()
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetSituationReplay()
|
||||
{
|
||||
INFO_LOG() << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
INFO_LOG(m_logger) << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
SituationReplay::SitReplay data = m_dtc->sitReplay(m_situationReplayId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
ERROR_LOG(m_logger) << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
INFO_LOG(m_logger) << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
<< ", on exercise " << data.exerciseId();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -114,7 +113,7 @@ void SrpDtTests::tryGetSituationReplay()
|
||||
void SrpDtTests::onReceiveSituationReplayData(const SituationReplay::SitReplay &data)
|
||||
{
|
||||
if (m_situationReplayId == data.id())
|
||||
INFO_LOG() << "##################### Data for id = " << data.id() << " received";
|
||||
INFO_LOG(m_logger) << "##################### Data for id = " << data.id() << " received";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
+16
-16
@@ -36,7 +36,7 @@ SrpFtTests::~SrpFtTests()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int srpId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_replayPartitionId = replayPartitionId;
|
||||
@@ -53,11 +53,11 @@ bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int sr
|
||||
// Publish/Subscribe on replayPartition
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc";
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
m_ftc = SituationReplay::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc";
|
||||
DEBUG_LOG(m_logger) << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ bool SrpFtTests::init(int domainId, TestId testId, int replayPartitionId, int sr
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
|
||||
if (m_testId <= TryStart)
|
||||
QTimer::singleShot(0, this, &SrpFtTests::tryStart);
|
||||
@@ -82,7 +82,7 @@ void SrpFtTests::startTest()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryStart()
|
||||
{
|
||||
INFO_LOG() << "trying to send startReplay";
|
||||
INFO_LOG(m_logger) << "trying to send startReplay";
|
||||
m_currentTestId = TryStart;
|
||||
|
||||
qint64 beginTime = 1468401389668;
|
||||
@@ -99,7 +99,7 @@ void SrpFtTests::tryStart()
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error starting replay for srp " << m_replayPartitionId;
|
||||
ERROR_LOG(m_logger) << "Error starting replay for srp " << m_replayPartitionId;
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void SrpFtTests::tryStart()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryNotAllowedChange()
|
||||
{
|
||||
INFO_LOG() << "trying to send changeReplayState (start) => should fail (not possible with this method)";
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (start) => should fail (not possible with this method)";
|
||||
m_currentTestId = TryNotAllowedChange;
|
||||
switchToState(SituationReplay::SrpState::Started);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void SrpFtTests::tryNotAllowedChange()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryChangePaused()
|
||||
{
|
||||
INFO_LOG() << "trying to send changeReplayState (Paused)";
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (Paused)";
|
||||
m_currentTestId = TryChangePaused;
|
||||
switchToState(SituationReplay::SrpState::Paused);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void SrpFtTests::tryChangePaused()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryChangeResumed()
|
||||
{
|
||||
INFO_LOG() << "trying to send changeReplayState (Resumed)";
|
||||
INFO_LOG(m_logger) << "trying to send changeReplayState (Resumed)";
|
||||
m_currentTestId = TryChangeResumed;
|
||||
switchToState(SituationReplay::SrpState::Resumed);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void SrpFtTests::tryChangeResumed()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::tryStop()
|
||||
{
|
||||
INFO_LOG() << "trying to send stopReplay";
|
||||
INFO_LOG(m_logger) << "trying to send stopReplay";
|
||||
m_currentTestId = TryStop;
|
||||
switchToState(SituationReplay::SrpState::Stopped);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ void SrpFtTests::tryStop()
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::startReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got startReplayReply with id " << replyObject.id();
|
||||
INFO_LOG(m_logger) << "Got startReplayReply with id " << replyObject.id();
|
||||
m_situationReplayId = replyObject.id();
|
||||
if (m_testId == 0 && !replyObject.error())
|
||||
QTimer::singleShot(0, this, &SrpFtTests::tryNotAllowedChange);
|
||||
@@ -150,9 +150,9 @@ void SrpFtTests::startReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::changeReplayStateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got changeReplayStateReply with id " << replyObject.id();
|
||||
INFO_LOG(m_logger) << "Got changeReplayStateReply with id " << replyObject.id();
|
||||
if (replyObject.error())
|
||||
INFO_LOG() << ", string: " << replyObject.translated();
|
||||
INFO_LOG(m_logger) << ", string: " << replyObject.translated();
|
||||
if (m_testId == 0 && !replyObject.error())
|
||||
{
|
||||
if (m_currentTestId == TryNotAllowedChange)
|
||||
@@ -169,7 +169,7 @@ void SrpFtTests::changeReplayStateReply(const Core::FunctionReplyObject &replyOb
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
void SrpFtTests::stopReplayReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got stopReplayReply with id " << replyObject.id() ;
|
||||
INFO_LOG(m_logger) << "Got stopReplayReply with id " << replyObject.id() ;
|
||||
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -213,7 +213,7 @@ void SrpFtTests::switchToState(SrpState state)
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error changing replay state for srp " << m_situationReplayId << "(" << m_replayPartitionId << ")";
|
||||
ERROR_LOG(m_logger) << "Error changing replay state for srp " << m_situationReplayId << "(" << m_replayPartitionId << ")";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user