Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+55
-55
@@ -41,7 +41,7 @@ RepTests::~RepTests()
|
||||
// ------------------------------------------------------------------
|
||||
bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int operatorId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_exerciseId = exerciseId;
|
||||
@@ -52,32 +52,32 @@ bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int
|
||||
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, m_exerciseId));
|
||||
if (!m_ddsConnector->init())
|
||||
return false;
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
// initialize database
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if(!m_dbHandler->init(m_exerciseId, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
|
||||
m_db = m_dbHandler->db();
|
||||
|
||||
DEBUG_LOG() << "create dtc";
|
||||
DEBUG_LOG(m_logger) << "create dtc";
|
||||
m_dtc = ReportManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "create ftc";
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
m_ftc = ReportManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc/dtc";
|
||||
DEBUG_LOG(m_logger) << "init ftc/dtc";
|
||||
bool bRet = m_ftc->enableAll() && m_dtc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Exercise Id = " << exerciseId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG() << "Report Id = " << reportId;
|
||||
DEBUG_LOG() << "Operator Id = " << operatorId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Report Id = " << reportId;
|
||||
DEBUG_LOG(m_logger) << "Operator Id = " << operatorId;
|
||||
|
||||
//TODO: add connects
|
||||
|
||||
@@ -87,7 +87,7 @@ bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
// create reports
|
||||
if (m_testId == 11)
|
||||
tryCreate(ReportManagement::ReportType::UnitPower);
|
||||
@@ -144,7 +144,7 @@ void RepTests::startTest()
|
||||
tryChangeStatus();
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Unknown test case!";
|
||||
ERROR_LOG(m_logger) << "Unknown test case!";
|
||||
failExit();
|
||||
}
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
@@ -153,7 +153,7 @@ void RepTests::startTest()
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
{
|
||||
INFO_LOG() << "trying to send createRequest Report";
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Report";
|
||||
CreateModifyReportRequest request;
|
||||
|
||||
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType.underlying());
|
||||
@@ -480,14 +480,14 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
}
|
||||
default:
|
||||
{
|
||||
ERROR_LOG() << "Unknown report type!";
|
||||
ERROR_LOG(m_logger) << "Unknown report type!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_ftc->createModifyReportRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(2000);
|
||||
@@ -496,7 +496,7 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::tryModify()
|
||||
{
|
||||
DEBUG_LOG() << "trying to send modify request for report Id = " << m_reportId;
|
||||
DEBUG_LOG(m_logger) << "trying to send modify request for report Id = " << m_reportId;
|
||||
|
||||
m_dtc->waitForHistoricalDataReportInfo(1000);
|
||||
ReportInfo rep = m_dtc->reportInfo(m_reportId);
|
||||
@@ -526,22 +526,22 @@ void RepTests::tryModify()
|
||||
request.fileStatus(ReportManagement::FileStatus::Valid);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
|
||||
DEBUG_LOG() << "Start modify";
|
||||
DEBUG_LOG() << "Report type = " << rep.reportType();
|
||||
DEBUG_LOG(m_logger) << "Start modify";
|
||||
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType();
|
||||
|
||||
if (!m_ftc->createModifyReportRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
DEBUG_LOG() << "AFTER modify";
|
||||
DEBUG_LOG(m_logger) << "AFTER modify";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::tryGetData()
|
||||
{
|
||||
DEBUG_LOG() << "trying to send get data request for report Id = " << m_reportId;
|
||||
DEBUG_LOG(m_logger) << "trying to send get data request for report Id = " << m_reportId;
|
||||
GetReportDataRequest request;
|
||||
|
||||
request.reportId(m_reportId);
|
||||
@@ -549,7 +549,7 @@ void RepTests::tryGetData()
|
||||
|
||||
if (!m_ftc->getReportDataRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -559,7 +559,7 @@ void RepTests::tryGetData()
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::tryChangeStatus()
|
||||
{
|
||||
DEBUG_LOG() << "trying to send change status request for report Id = " << m_reportId;
|
||||
DEBUG_LOG(m_logger) << "trying to send change status request for report Id = " << m_reportId;
|
||||
ReportChangeStatusRequest request;
|
||||
|
||||
request.id(m_reportId);
|
||||
@@ -569,7 +569,7 @@ void RepTests::tryChangeStatus()
|
||||
|
||||
if (!m_ftc->reportChangeStatusRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting change status";
|
||||
ERROR_LOG(m_logger) << "Error requesting change status";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -578,10 +578,10 @@ void RepTests::tryChangeStatus()
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::tryDelete()
|
||||
{
|
||||
INFO_LOG() << "trying to send delete request for report Id = " << m_reportId;
|
||||
INFO_LOG(m_logger) << "trying to send delete request for report Id = " << m_reportId;
|
||||
if (!m_ftc->removeReportRequest(RemoveReportRequest(m_reportId), this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -590,60 +590,60 @@ void RepTests::tryDelete()
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::onCreateModifyReportReply(const CreateModifyReportReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onCreateModifyReportReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onCreateModifyReportReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
{
|
||||
ERROR_LOG() << "Got onCreateModifyReportReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got createModifyReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::onRemoveReportReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onRemoveReportReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onRemoveReportReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onRemoveReportReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onRemoveReportReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::onGetReportDataReply(const GetReportDataReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onGetReportDataReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onGetReportDataReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
{
|
||||
ERROR_LOG() << "Got onGetReportDataReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
|
||||
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData());
|
||||
|
||||
DEBUG_LOG() << "Size reportData: " << reportData.size();
|
||||
DEBUG_LOG(m_logger) << "Size reportData: " << reportData.size();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onReportChangeStatusReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onReportChangeStatusReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onReportChangeStatusReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onReportChangeStatusReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got changeStatusReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got changeStatusReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyO
|
||||
void RepTests::addTestDataTreatmentTimeline()
|
||||
{
|
||||
// Report Treatment Timeline
|
||||
ERROR_LOG() << "START addTestDataTreatmentTimeline" ;
|
||||
ERROR_LOG(m_logger) << "START addTestDataTreatmentTimeline" ;
|
||||
|
||||
ReportManagement::Database::RepTreatmentTimelineData resData;
|
||||
resData.id = 10;
|
||||
@@ -669,7 +669,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString::fromStdString(json);
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -763,7 +763,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString();
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -774,7 +774,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString::fromStdString(json);
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -785,7 +785,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
resData.properties = QString::fromStdString(json);
|
||||
if (!m_db->insert(resData))
|
||||
{
|
||||
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ void RepTests::addTestDataTreatmentTimeline()
|
||||
// ------------------------------------------------------------------------------
|
||||
void RepTests::failExit()
|
||||
{
|
||||
ERROR_LOG() << "FAIL EXIT !";
|
||||
ERROR_LOG(m_logger) << "FAIL EXIT !";
|
||||
m_bTestsSuccessful = false;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user