mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Improved messages in reader UNIT test
* info about URL connected * reflect changes in global setup for airport reader
This commit is contained in:
@@ -60,7 +60,8 @@ namespace BlackCoreTest
|
|||||||
void CTestReaders::readIcaoData()
|
void CTestReaders::readIcaoData()
|
||||||
{
|
{
|
||||||
const CUrl url(sApp->getGlobalSetup().getDbIcaoReaderUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbIcaoReaderUrl());
|
||||||
if (!this->pingServer(url)) { QSKIP("Server not reachable."); }
|
qDebug() << "Reader URL" << url.toQString();
|
||||||
|
if (!this->pingServer(url)) { QSKIP("Server not reachable."); return; }
|
||||||
m_icaoReader->start();
|
m_icaoReader->start();
|
||||||
m_icaoReader->readInBackgroundThread(CEntityFlags::AllIcaoEntities, QDateTime());
|
m_icaoReader->readInBackgroundThread(CEntityFlags::AllIcaoEntities, QDateTime());
|
||||||
|
|
||||||
@@ -92,7 +93,8 @@ namespace BlackCoreTest
|
|||||||
void CTestReaders::readModelData()
|
void CTestReaders::readModelData()
|
||||||
{
|
{
|
||||||
const CUrl url(sApp->getGlobalSetup().getDbModelReaderUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbModelReaderUrl());
|
||||||
if (!this->pingServer(url)) { QSKIP("Server not reachable."); }
|
qDebug() << "Reader URL" << url.toQString();
|
||||||
|
if (!this->pingServer(url)) { QSKIP("Server not reachable."); return; }
|
||||||
m_modelReader->start();
|
m_modelReader->start();
|
||||||
m_modelReader->readInBackgroundThread(CEntityFlags::ModelEntity, QDateTime());
|
m_modelReader->readInBackgroundThread(CEntityFlags::ModelEntity, QDateTime());
|
||||||
|
|
||||||
@@ -120,8 +122,9 @@ namespace BlackCoreTest
|
|||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|
||||||
const CUrl url(sApp->getGlobalSetup().getSwiftAirportUrls().getRandomWorkingUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbAirportReaderUrl());
|
||||||
if (!this->pingServer(url)) { return; }
|
qDebug() << "Reader URL" << url.toQString();
|
||||||
|
if (!this->pingServer(url)) { QSKIP("Server not reachable."); return; }
|
||||||
m_airportReader->start();
|
m_airportReader->start();
|
||||||
m_airportReader->readInBackgroundThread(CEntityFlags::AirportEntity, QDateTime());
|
m_airportReader->readInBackgroundThread(CEntityFlags::AirportEntity, QDateTime());
|
||||||
|
|
||||||
@@ -147,12 +150,16 @@ namespace BlackCoreTest
|
|||||||
bool CTestReaders::pingServer(const CUrl &url)
|
bool CTestReaders::pingServer(const CUrl &url)
|
||||||
{
|
{
|
||||||
QString m;
|
QString m;
|
||||||
if (!CNetworkUtils::canConnect(url, m, 2500))
|
if (CNetworkUtils::canConnect(url, m, 2500))
|
||||||
{
|
{
|
||||||
qWarning() << "Skipping unit test as" << url.getFullUrl() << "cannot be connected";
|
qDebug() << "URL" << url.getFullUrl() << "connected";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "URL" << url.getFullUrl() << "cannot be connected";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user