Unit tests, skip if DB is not reachable

This commit is contained in:
Klaus Basan
2018-04-14 06:43:01 +02:00
committed by Roland Winklmeier
parent efac4f1f27
commit 66bf45eb9c
2 changed files with 15 additions and 5 deletions

View File

@@ -12,6 +12,7 @@
#ifndef BLACKCORE_DB_NETWORKWATCHDOG_H
#define BLACKCORE_DB_NETWORKWATCHDOG_H
#include "blackcore/blackcoreexport.h"
#include "blackmisc/worker.h"
#include "blackmisc/network/url.h"
#include <atomic>
@@ -23,7 +24,7 @@ namespace BlackCore
namespace Db
{
//! Monitoring the swift DB, internet access, shared URLs
class CNetworkWatchdog : public BlackMisc::CContinuousWorker
class BLACKCORE_EXPORT CNetworkWatchdog : public BlackMisc::CContinuousWorker
{
Q_OBJECT
@@ -114,6 +115,11 @@ namespace BlackCore
//! \remark depends on BlackCore::Application::getGlobalSetup()
static bool isDbUrl(const BlackMisc::Network::CUrl &url);
//! The URL being tested
//! \remark depends on BlackCore::Application::getGlobalSetup()
//! \private primarily accessible for unit tests
static BlackMisc::Network::CUrl dbTestUrl();
signals:
//! DB was available, but not longer is and vice versa
void changedSwiftDbAccessibility(bool available, const BlackMisc::Network::CUrl &url);
@@ -139,10 +145,6 @@ namespace BlackCore
//! Received reply of client service ping
void replyPingClientService(QNetworkReply *nwReply);
//! The URL being tested
//! \remark depends on BlackCore::Application::getGlobalSetup()
static BlackMisc::Network::CUrl dbTestUrl();
//! The DB server
//! \remark depends on BlackCore::Application::getGlobalSetup()
static QString dbHost();