Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+14
-15
@@ -22,8 +22,7 @@
|
||||
|
||||
|
||||
|
||||
DataTopicTests::DataTopicTests()
|
||||
: m_domainParticipantPub(nullptr)
|
||||
DataTopicTests::DataTopicTests() : m_domainParticipantPub(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_ddsPublisher(nullptr)
|
||||
@@ -33,12 +32,12 @@ DataTopicTests::DataTopicTests()
|
||||
, m_subscriberListenerBinder(nullptr)
|
||||
, m_dtcExercise(nullptr)
|
||||
, m_mainThreadId(QThread::currentThreadId())
|
||||
.getNGLLogger("UnitTests.DataTopicTests"))
|
||||
{
|
||||
.getNGLLogger("UnitTests.DataTopicTests")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
if (!DDS::QosProfile::setDefault())
|
||||
ERROR_LOG() << "Error setting default QoS from xml-file ";
|
||||
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
||||
|
||||
DEBUG_LOG() << "Main thread ID is " << m_mainThreadId;
|
||||
DEBUG_LOG(m_logger) << "Main thread ID is " << m_mainThreadId;
|
||||
}
|
||||
|
||||
DataTopicTests::~DataTopicTests()
|
||||
@@ -79,7 +78,7 @@ bool DataTopicTests::initPublisher()
|
||||
partitionQos.name( { partition } );
|
||||
publisherQos << partitionQos;
|
||||
|
||||
DEBUG_LOG() << "Publish on partition " << partition;
|
||||
DEBUG_LOG(m_logger) << "Publish on partition " << partition;
|
||||
|
||||
m_ddsPublisher = dds::pub::Publisher(m_domainParticipantPub, publisherQos);
|
||||
|
||||
@@ -91,8 +90,8 @@ bool DataTopicTests::initPublisher()
|
||||
|
||||
bool DataTopicTests::write(const ExerciseManagement::Exercise &data)
|
||||
{
|
||||
INFO_LOG() << "Publish topic Exercise ";
|
||||
DEBUG_LOG() << "ExeId: " << data.id() << ", state: " << data.state()
|
||||
INFO_LOG(m_logger) << "Publish topic Exercise ";
|
||||
DEBUG_LOG(m_logger) << "ExeId: " << data.id() << ", state: " << data.state()
|
||||
<< ", partitionName: " << data.partitionName();
|
||||
|
||||
return m_dtsExercise->write(data);
|
||||
@@ -105,7 +104,7 @@ bool DataTopicTests::write(const ExerciseManagement::Exercise &data)
|
||||
|
||||
bool DataTopicTests::initSubscriber()
|
||||
{
|
||||
DEBUG_LOG() << "Initialisation DDS (Subscriber/Reader)";
|
||||
DEBUG_LOG(m_logger) << "Initialisation DDS (Subscriber/Reader)";
|
||||
|
||||
m_domainParticipantSub =
|
||||
dds::domain::DomainParticipant(m_domainId,
|
||||
@@ -126,7 +125,7 @@ bool DataTopicTests::initSubscriber()
|
||||
partitionQos.name( partitions );
|
||||
subscriberQos << partitionQos;
|
||||
|
||||
DEBUG_LOG() << "Initialise DTC::SubscriberListener";
|
||||
DEBUG_LOG(m_logger) << "Initialise DTC::SubscriberListener";
|
||||
m_subscriberListener = new DDSGeneric::SubscriberListener();
|
||||
|
||||
m_ddsSubscriber = dds::sub::Subscriber(m_domainParticipantSub,
|
||||
@@ -145,11 +144,11 @@ bool DataTopicTests::initSubscriber()
|
||||
void DataTopicTests::processData(const ExerciseManagement::Exercise &instance, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
INFO_LOG() << "process Lts_Exercise";
|
||||
INFO_LOG(m_logger) << "process Lts_Exercise";
|
||||
|
||||
DEBUG_LOG() << "exerciseId: " << instance.id();
|
||||
DEBUG_LOG() << "name: " << instance.name();
|
||||
DEBUG_LOG() << "state: " << instance.state();
|
||||
DEBUG_LOG(m_logger) << "exerciseId: " << instance.id();
|
||||
DEBUG_LOG(m_logger) << "name: " << instance.name();
|
||||
DEBUG_LOG(m_logger) << "state: " << instance.state();
|
||||
|
||||
m_receivedExerciseData = instance;
|
||||
|
||||
|
||||
+1
@@ -42,6 +42,7 @@ public:
|
||||
ExerciseManagement::Exercise getReceivedExerciseData() const { return m_receivedExerciseData; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// Subscriber Methods
|
||||
void processData(const ExerciseManagement::Exercise& instance, DataModification modType);
|
||||
|
||||
|
||||
+4
-4
@@ -40,7 +40,7 @@ DataTopicTestsMain::DataTopicTestsMain()
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
void DataTopicTestsMain::initTestCase()
|
||||
{
|
||||
DEBUG_LOG() <<"DataTopicTestsMain: initTestCase";
|
||||
DEBUG_LOG(m_logger) <<"DataTopicTestsMain: initTestCase";
|
||||
|
||||
m_dtTest = new DataTopicTests();
|
||||
QVERIFY2(m_dtTest, "Initialisation of DataTopicTest failed");
|
||||
@@ -53,7 +53,7 @@ void DataTopicTestsMain::initTestCase()
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
void DataTopicTestsMain::publishTestCase()
|
||||
{
|
||||
DEBUG_LOG() <<"DataTopicTestsMain: publish data";
|
||||
DEBUG_LOG(m_logger) <<"DataTopicTestsMain: publish data";
|
||||
|
||||
// Topic Exercise
|
||||
m_sentExerciseData.id(222);
|
||||
@@ -68,7 +68,7 @@ void DataTopicTestsMain::publishTestCase()
|
||||
|
||||
void DataTopicTestsMain::subscribeTestCase()
|
||||
{
|
||||
DEBUG_LOG() << "IN subscribeTestCase";
|
||||
DEBUG_LOG(m_logger) << "IN subscribeTestCase";
|
||||
QTRY_COMPARE(m_exerciseDataArrivedSpy->count(), 1);
|
||||
|
||||
ExerciseManagement::Exercise recvExercise = m_dtTest->getReceivedExerciseData();
|
||||
@@ -82,7 +82,7 @@ void DataTopicTestsMain::subscribeTestCase()
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
void DataTopicTestsMain::cleanupTestCase()
|
||||
{
|
||||
DEBUG_LOG() <<"DataTopicTestsMain: cleanupTestCase";
|
||||
DEBUG_LOG(m_logger) <<"DataTopicTestsMain: cleanupTestCase";
|
||||
delete m_dtTest; m_dtTest = nullptr;
|
||||
delete m_exerciseDataArrivedSpy; m_exerciseDataArrivedSpy = nullptr;
|
||||
}
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ private Q_SLOTS:
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
ExerciseManagement::Exercise m_sentExerciseData;
|
||||
QSignalSpy *m_exerciseDataArrivedSpy = nullptr;
|
||||
|
||||
+6
-8
@@ -14,22 +14,20 @@
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
|
||||
|
||||
Initialisation::Initialisation()
|
||||
: m_domainParticipant(nullptr)
|
||||
Initialisation::Initialisation() : m_domainParticipant(nullptr)
|
||||
, m_domainParticipantSub(nullptr)
|
||||
, m_domainId(0)
|
||||
, m_partitionId(-1)
|
||||
, m_ddsPublisher(nullptr)
|
||||
, m_ddsSubscriber(nullptr)
|
||||
, m_subListener(new DTC::SubscriberListener)
|
||||
.getNGLLogger("UnitTests.Initialisation"))
|
||||
|
||||
{
|
||||
.getNGLLogger("UnitTests.Initialisation")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
DDS::DefaultQos defaultQos;
|
||||
|
||||
//if (!defaultQos.setDefaultQos(QStringList("/shd/CTC/SV/.default_dds_profile.xml")))
|
||||
if (!defaultQos.setDefaultQos())
|
||||
ERROR_LOG() << "Error setting default QoS from xml-file ";
|
||||
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
||||
|
||||
}
|
||||
|
||||
@@ -62,7 +60,7 @@ bool Initialisation::initDDS(int domainId, int partitionId, PubSub pubsub)
|
||||
{
|
||||
dds::pub::qos::PublisherQos publisherQos = m_domainParticipant.default_publisher_qos();
|
||||
|
||||
DEBUG_LOG() << "Publish on partition " << IDL::getPartitionString(partitionId);
|
||||
DEBUG_LOG(m_logger) << "Publish on partition " << IDL::getPartitionString(partitionId);
|
||||
|
||||
// use only selected partition
|
||||
dds::core::policy::Partition partitionQos;
|
||||
@@ -84,7 +82,7 @@ bool Initialisation::initDDS(int domainId, int partitionId, PubSub pubsub)
|
||||
|
||||
dds::sub::qos::SubscriberQos subscriberQos = domainPart.default_subscriber_qos();
|
||||
|
||||
DEBUG_LOG() << "Subsribing on partition " << IDL::getPartitionString(partitionId);
|
||||
DEBUG_LOG(m_logger) << "Subsribing on partition " << IDL::getPartitionString(partitionId);
|
||||
|
||||
// use only selected partition
|
||||
dds::core::policy::Partition partitionQos;
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ public:
|
||||
DTC::SubscriberListener *getSubscriberListener() { return m_subListener; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
dds::domain::DomainParticipant m_domainParticipant;
|
||||
dds::domain::DomainParticipant m_domainParticipantSub;
|
||||
int m_domainId;
|
||||
|
||||
Reference in new issue
Block a user