Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+27
-28
@@ -29,15 +29,14 @@
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
namespace ExerciseEventManagement
|
||||
{
|
||||
EemTests::EemTests(QObject *parent)
|
||||
: QObject(parent)
|
||||
{}
|
||||
EemTests::EemTests(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
bool EemTests::init(int domainId, int exerciseId, int testId)
|
||||
{
|
||||
bool bRet = true;
|
||||
DEBUG_LOG() << "init begin";
|
||||
DEBUG_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
|
||||
@@ -63,7 +62,7 @@ bool EemTests::init(int domainId, int exerciseId, int testId)
|
||||
m_bldDts = Buildings::Interface::Dts::create(m_ddsConnector42);
|
||||
bRet &= m_bldDts->enableBuildingState();
|
||||
|
||||
DEBUG_LOG() << "bRet: " << bRet;
|
||||
DEBUG_LOG(m_logger) << "bRet: " << bRet;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -71,7 +70,7 @@ bool EemTests::init(int domainId, int exerciseId, int testId)
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
void EemTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest m_testId = " << m_testId;
|
||||
INFO_LOG(m_logger) << "startTest m_testId = " << m_testId;
|
||||
|
||||
if (m_testId == 1) // publish dynamicParticipantData
|
||||
{
|
||||
@@ -134,7 +133,7 @@ void EemTests::startTest()
|
||||
|
||||
if (m_testId <= 0 || m_testId > 6)
|
||||
{
|
||||
ERROR_LOG() << "Unknown test case: " << m_testId;
|
||||
ERROR_LOG(m_logger) << "Unknown test case: " << m_testId;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -166,10 +165,10 @@ void EemTests::tryCreateDynamicParticipantData(int participantId, ProjectDataMan
|
||||
dp.stateHistory().push_back(si);
|
||||
dp.sampleTime(esTime);
|
||||
|
||||
DEBUG_LOG() << "Publishing DynamicParticipantData for participant " << participantId ;
|
||||
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData for participant " << participantId ;
|
||||
if (!m_ppmDts->publish(dp))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create DynamicParticipantData";
|
||||
ERROR_LOG(m_logger) << "Error requesting create DynamicParticipantData";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -191,10 +190,10 @@ void EemTests::trySendFireEvent()
|
||||
|
||||
gearAssigment.gears(gears);
|
||||
|
||||
DEBUG_LOG() << "Publish EquipmentGearAssigment";
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearAssigment";
|
||||
if (!m_tabDts->publish(gearAssigment))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing EquipmentGearAssigment";
|
||||
ERROR_LOG(m_logger) << "Error while publishing EquipmentGearAssigment";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -212,10 +211,10 @@ void EemTests::trySendFireEvent()
|
||||
|
||||
gearChargeState.charge(vGearCharge);
|
||||
|
||||
DEBUG_LOG() << "Publish EquipmentGearChargeState";
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearChargeState";
|
||||
if (!m_tabDts->publish(gearChargeState))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing EquipmentGearChargeState";
|
||||
ERROR_LOG(m_logger) << "Error while publishing EquipmentGearChargeState";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -231,10 +230,10 @@ void EemTests::trySendFireEvent()
|
||||
gearEvent.chargeAmount(200);
|
||||
gearEvent.charge(gc);
|
||||
|
||||
DEBUG_LOG() << "Publish EquipmentGearEvent";
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearEvent";
|
||||
if (!m_tabDts->publish(gearEvent))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing EquipmentGearEvent";
|
||||
ERROR_LOG(m_logger) << "Error while publishing EquipmentGearEvent";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -246,10 +245,10 @@ void EemTests::trySendFireEvent()
|
||||
gearEvent.chargeAmount(100);
|
||||
gearEvent.charge(gc);
|
||||
|
||||
DEBUG_LOG() << "Publish EquipmentGearEvent";
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearEvent";
|
||||
if (!m_tabDts->publish(gearEvent))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing EquipmentGearEvent";
|
||||
ERROR_LOG(m_logger) << "Error while publishing EquipmentGearEvent";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -257,12 +256,12 @@ void EemTests::trySendFireEvent()
|
||||
|
||||
const QMap<qint64, ExerciseEventManagement::Event> events = m_dtc->events();
|
||||
|
||||
DEBUG_LOG() << "events: " << events.size();
|
||||
DEBUG_LOG(m_logger) << "events: " << events.size();
|
||||
|
||||
int noEvents = 0;
|
||||
for(const ExerciseEventManagement::Event &e : events)
|
||||
{
|
||||
INFO_LOG() << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
if (e.eventTypeId() == ProjectDataManagement::EventType_def::WeaponAssignment ||
|
||||
e.eventTypeId() == ProjectDataManagement::EventType_def::FireEvent)
|
||||
noEvents ++;
|
||||
@@ -270,7 +269,7 @@ void EemTests::trySendFireEvent()
|
||||
|
||||
if (noEvents != 5)
|
||||
{
|
||||
ERROR_LOG() << "Error number of events (" << QString::number(noEvents) << ") not as expected (5)";
|
||||
ERROR_LOG(m_logger) << "Error number of events (" << QString::number(noEvents) << ") not as expected (5)";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -306,7 +305,7 @@ void EemTests::trySendBiteMessage()
|
||||
|
||||
if (!m_tabDts->publish(bite))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing EquipmentBite";
|
||||
ERROR_LOG(m_logger) << "Error while publishing EquipmentBite";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -331,7 +330,7 @@ void EemTests::trySendBuildingState()
|
||||
|
||||
if (!m_bldDts->publish(bState))
|
||||
{
|
||||
ERROR_LOG() << "Error while publishing building state";
|
||||
ERROR_LOG(m_logger) << "Error while publishing building state";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -358,10 +357,10 @@ void EemTests::tryCreateIed(qint64 time)
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
ied.sampleTime(esTime);
|
||||
|
||||
DEBUG_LOG() << "Publishing Ied " ;
|
||||
DEBUG_LOG(m_logger) << "Publishing Ied " ;
|
||||
if (!m_gimDts->publish(ied))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting publish Ied";
|
||||
ERROR_LOG(m_logger) << "Error requesting publish Ied";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -371,12 +370,12 @@ void EemTests::checkEvents(const ProjectDataManagement::EventType &et, int expec
|
||||
{
|
||||
const QMap<qint64, ExerciseEventManagement::Event> events = m_dtc->events();
|
||||
|
||||
DEBUG_LOG() << "All published events: " << events.size();
|
||||
DEBUG_LOG(m_logger) << "All published events: " << events.size();
|
||||
int noEvents = 0;
|
||||
|
||||
for (const ExerciseEventManagement::Event &e : events)
|
||||
{
|
||||
INFO_LOG() << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
if (e.eventTypeId() == et)
|
||||
{
|
||||
QJsonObject prop = LtsUtils::JsonObject::fromJson(e.properties());
|
||||
@@ -389,11 +388,11 @@ void EemTests::checkEvents(const ProjectDataManagement::EventType &et, int expec
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "No events: " << noEvents;
|
||||
DEBUG_LOG(m_logger) << "No events: " << noEvents;
|
||||
|
||||
if (noEvents != expected)
|
||||
{
|
||||
ERROR_LOG() << "Error number of events (" << QString::number(noEvents) << ") not as expected (" << QString::number(expected) << ")";
|
||||
ERROR_LOG(m_logger) << "Error number of events (" << QString::number(noEvents) << ") not as expected (" << QString::number(expected) << ")";
|
||||
failExit();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user