Skip to content
Snippets Groups Projects

Add initial version of the integration testing class

Merged m.marn requested to merge 106-integration-test into master
2 files
+ 19
31
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -6,6 +6,8 @@
#include <AllTypesFESA/GeneratedCode/ServiceLocator.h>
#include <fesa-core/Core/AbstractEvent.h>
#include <AllTypesFESA/Common/AllTypesFESA.h>
#include <cmw-log/Logger.h>
#include <string>
@@ -30,6 +32,7 @@ RTDeviceClass::RTDeviceClass () :
RTDeviceClass::~RTDeviceClass()
{
AllTypesFESA::cleanup();
}
RTDeviceClass* RTDeviceClass::getInstance()
@@ -54,23 +57,24 @@ void RTDeviceClass::releaseInstance()
// You can write code that initializes devices in the loop below.
void RTDeviceClass::specificInit()
{
const Devices& deviceCol = AllTypesFESAServiceLocator_->getDeviceCollection();
for (Devices::const_iterator it = deviceCol.begin(); it != deviceCol.end(); ++it)
try
{
try
{
Device* device = *it;
static_cast<void>(device); // This line prevents an "unused variable" warning, it can be removed safely.
// Write here some code to initialize devices
}
catch (const fesa::FesaException& exception)
if (!AllTypesFESA::isInitialized())
{
LOG_ERROR_IF(logger, exception.getMessage());
// Re-throwing the exception prevents the process from starting up.
throw;
AllTypesFESA::setup(this->AllTypesFESAServiceLocator_);
}
}
}
catch(std::exception& ex)
{
// required to trace failures on logstash.acc.gsi.de
LOG_ERROR_IF(logger, ex.what());
throw;
}
catch(...)
{
LOG_ERROR_IF(logger, "Unexpected error. Please notify support");
throw;
}
}
void RTDeviceClass::specificShutDown()
Loading