mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 16:50:48 +02:00
Fix code formating
This commit is contained in:
parent
8364523839
commit
8e21275b6a
@ -27,9 +27,9 @@ int DatabaseManager::saveSubject(std::shared_ptr<Subject> subject, const QString
|
|||||||
rtn = -1;
|
rtn = -1;
|
||||||
}else{
|
}else{
|
||||||
query.prepare(QString("INSERT INTO %1 (id, description, last_update, name, pin, last_modified, deleted) "
|
query.prepare(QString("INSERT INTO %1 (id, description, last_update, name, pin, last_modified, deleted) "
|
||||||
"VALUES (:id, :description, :last_update, :name, :pin, :last_modified, :deleted)").arg(table));
|
"VALUES (:id, :description, :last_update, :name, :pin, :last_modified, :deleted)").arg(table));
|
||||||
rtn = 1;
|
rtn = 1;
|
||||||
}
|
}
|
||||||
query.bindValue(":id", id);
|
query.bindValue(":id", id);
|
||||||
query.bindValue(":description", subject->getDescription());
|
query.bindValue(":description", subject->getDescription());
|
||||||
query.bindValue(":name", subject->getName());
|
query.bindValue(":name", subject->getName());
|
||||||
@ -49,11 +49,11 @@ int DatabaseManager::saveToken(std::shared_ptr<Token> token, const QString& tabl
|
|||||||
int rtn;
|
int rtn;
|
||||||
if (checkIfExists(id, table)){
|
if (checkIfExists(id, table)){
|
||||||
query.prepare(QString("UPDATE %1 SET id = :id, auth_errors = :auth_errors, description = :description, enabled = :enabled, last_update = :last_update, name = :name, no_validity = :no_validity, time_to_live = :time_to_live, token_bits = :token_bits, token_data = :token_data, token_type = :token_type, subject_id = :subject_id, last_modified = :last_modified, deleted = :deleted "
|
query.prepare(QString("UPDATE %1 SET id = :id, auth_errors = :auth_errors, description = :description, enabled = :enabled, last_update = :last_update, name = :name, no_validity = :no_validity, time_to_live = :time_to_live, token_bits = :token_bits, token_data = :token_data, token_type = :token_type, subject_id = :subject_id, last_modified = :last_modified, deleted = :deleted "
|
||||||
"WHERE id = :id").arg(table));
|
"WHERE id = :id").arg(table));
|
||||||
rtn = -1;
|
rtn = -1;
|
||||||
}else{
|
}else{
|
||||||
query.prepare(QString("INSERT INTO %1 (id, auth_errors, description, enabled, last_update, name, no_validity, time_to_live, token_bits, token_data, token_type, subject_id, last_modified, deleted) "
|
query.prepare(QString("INSERT INTO %1 (id, auth_errors, description, enabled, last_update, name, no_validity, time_to_live, token_bits, token_data, token_type, subject_id, last_modified, deleted) "
|
||||||
"VALUES (:id, :auth_errors, :description, :enabled, :last_update, :name, :no_validity, :time_to_live, :token_bits, :token_data, :token_type, :subject_id, :last_modified, :deleted)").arg(table));
|
"VALUES (:id, :auth_errors, :description, :enabled, :last_update, :name, :no_validity, :time_to_live, :token_bits, :token_data, :token_type, :subject_id, :last_modified, :deleted)").arg(table));
|
||||||
rtn = 1;
|
rtn = 1;
|
||||||
}
|
}
|
||||||
query.bindValue(":id", id);
|
query.bindValue(":id", id);
|
||||||
@ -141,21 +141,21 @@ bool DatabaseManager::executeQuery(QSqlQuery &query, const QString &statement)
|
|||||||
QString msg = QString("Source: Database Manager, Error: %1").arg(query.lastError().text());
|
QString msg = QString("Source: Database Manager, Error: %1").arg(query.lastError().text());
|
||||||
log(QString(msg));
|
log(QString(msg));
|
||||||
emit error();
|
emit error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (dryMode){
|
if (dryMode){
|
||||||
qDebug() << statement;
|
qDebug() << statement;
|
||||||
|
}
|
||||||
|
if (!dryMode || statement.startsWith("SELECT")){
|
||||||
|
if (!query.exec(statement)){
|
||||||
|
QString msg = QString("Source: Database Manager, Error: %1").arg(query.lastError().text());
|
||||||
|
log(QString(msg));
|
||||||
|
emit error();
|
||||||
}
|
}
|
||||||
if (!dryMode || statement.startsWith("SELECT")){
|
}
|
||||||
if (!query.exec(statement)){
|
return true;
|
||||||
QString msg = QString("Source: Database Manager, Error: %1").arg(query.lastError().text());
|
|
||||||
log(QString(msg));
|
|
||||||
emit error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseManager::dropTables()
|
void DatabaseManager::dropTables()
|
||||||
@ -171,33 +171,33 @@ void DatabaseManager::createTables()
|
|||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
|
|
||||||
executeQuery(query, "CREATE TABLE colnod_subject ("
|
executeQuery(query, "CREATE TABLE colnod_subject ("
|
||||||
"id character(36) primary key NOT NULL,"
|
"id character(36) primary key NOT NULL,"
|
||||||
"description character varying(255),"
|
"description character varying(255),"
|
||||||
"last_update timestamp NOT NULL,"
|
"last_update timestamp NOT NULL,"
|
||||||
"name character varying(255),"
|
"name character varying(255),"
|
||||||
"pin character varying(255),"
|
"pin character varying(255),"
|
||||||
"last_modified timestamp,"
|
"last_modified timestamp,"
|
||||||
"deleted BOOLEAN)");
|
"deleted BOOLEAN)");
|
||||||
executeQuery(query, "CREATE TABLE colnod_token ("
|
executeQuery(query, "CREATE TABLE colnod_token ("
|
||||||
"id CHAR(36) primary key NOT NULL,"
|
"id CHAR(36) primary key NOT NULL,"
|
||||||
"auth_errors INTEGER NOT NULL,"
|
"auth_errors INTEGER NOT NULL,"
|
||||||
"description VARCHAR(255),"
|
"description VARCHAR(255),"
|
||||||
"enabled BOOLEAN NOT NULL,"
|
"enabled BOOLEAN NOT NULL,"
|
||||||
"last_update timestamp NOT NULL,"
|
"last_update timestamp NOT NULL,"
|
||||||
"name VARCHAR(255),"
|
"name VARCHAR(255),"
|
||||||
"no_validity BOOLEAN NOT NULL,"
|
"no_validity BOOLEAN NOT NULL,"
|
||||||
"time_to_live INTEGER NOT NULL,"
|
"time_to_live INTEGER NOT NULL,"
|
||||||
"token_bits INTEGER,"
|
"token_bits INTEGER,"
|
||||||
"token_data VARCHAR(255),"
|
"token_data VARCHAR(255),"
|
||||||
"token_type VARCHAR(255),"
|
"token_type VARCHAR(255),"
|
||||||
"subject_id CHAR(36),"
|
"subject_id CHAR(36),"
|
||||||
"last_modified timestamp,"
|
"last_modified timestamp,"
|
||||||
"deleted BOOLEAN)");
|
"deleted BOOLEAN)");
|
||||||
executeQuery(query, "CREATE TABLE colnod_subject_attribute ("
|
executeQuery(query, "CREATE TABLE colnod_subject_attribute ("
|
||||||
"id VARCHAR(255) primary key,"
|
"id VARCHAR(255) primary key,"
|
||||||
"attribute_key VARCHAR(255),"
|
"attribute_key VARCHAR(255),"
|
||||||
"attribute_value VARCHAR(255),"
|
"attribute_value VARCHAR(255),"
|
||||||
"subject_id CHAR(36))");
|
"subject_id CHAR(36))");
|
||||||
}
|
}
|
||||||
|
|
||||||
// return last_sync time
|
// return last_sync time
|
||||||
@ -225,7 +225,7 @@ QSqlQuery DatabaseManager::getUpdatedTokens()
|
|||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
executeQuery(query, "SELECT id, auth_errors, description, enabled, last_update, name, no_validity, time_to_live, token_bits, token_data, token_type, subject_id, last_modified, deleted "
|
executeQuery(query, "SELECT id, auth_errors, description, enabled, last_update, name, no_validity, time_to_live, token_bits, token_data, token_type, subject_id, last_modified, deleted "
|
||||||
"FROM colnod_token WHERE EXTRACT(EPOCH FROM last_modified) * 1000 > EXTRACT(EPOCH FROM last_update) * 1000");
|
"FROM colnod_token WHERE EXTRACT(EPOCH FROM last_modified) * 1000 > EXTRACT(EPOCH FROM last_update) * 1000");
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ void DataManager::fillTokensToChangeDB()
|
|||||||
tokensFromDBToDeleteFromColnod.append(token->idToStringWithoutBraces());
|
tokensFromDBToDeleteFromColnod.append(token->idToStringWithoutBraces());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
tokensToUpdateFromDBToColnod.insert(token->idToStringWithoutBraces(), token);
|
tokensToUpdateFromDBToColnod.insert(token->idToStringWithoutBraces(), token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "DB:" << tokensToUpdateFromDBToColnod.size() << "tokens to update";
|
qDebug() << "DB:" << tokensToUpdateFromDBToColnod.size() << "tokens to update";
|
||||||
@ -95,7 +95,7 @@ void DataManager::fillTokensToChangeDB()
|
|||||||
|
|
||||||
void DataManager::fillSubjectsToUpdateDB()
|
void DataManager::fillSubjectsToUpdateDB()
|
||||||
{
|
{
|
||||||
// Not needed yet
|
// Not needed yet
|
||||||
}
|
}
|
||||||
|
|
||||||
// load working set with subjest to delete from Colnod
|
// load working set with subjest to delete from Colnod
|
||||||
@ -150,18 +150,18 @@ void DataManager::pushSubjectsToDB()
|
|||||||
for (const auto& subject : subjectsToUpdateFromColnodToDB)
|
for (const auto& subject : subjectsToUpdateFromColnodToDB)
|
||||||
{
|
{
|
||||||
if (db->saveSubject(subject, "colnod_subject") > 0){
|
if (db->saveSubject(subject, "colnod_subject") > 0){
|
||||||
added++;
|
added++;
|
||||||
if (dryMode)
|
if (dryMode)
|
||||||
qInfo() << "Adding subject:" << subject->idToStringWithoutBraces() << "to DB";
|
qInfo() << "Adding subject:" << subject->idToStringWithoutBraces() << "to DB";
|
||||||
else
|
else
|
||||||
Logger::logToDb(Logger::makeSubjectMsg( subject->idToStringWithoutBraces(),"added", "DB"));
|
Logger::logToDb(Logger::makeSubjectMsg( subject->idToStringWithoutBraces(),"added", "DB"));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
updated++;
|
updated++;
|
||||||
if (dryMode)
|
if (dryMode)
|
||||||
qInfo() << "Updating subject:" << subject->idToStringWithoutBraces() << "to DB";
|
qInfo() << "Updating subject:" << subject->idToStringWithoutBraces() << "to DB";
|
||||||
else
|
else
|
||||||
Logger::logToDb(Logger::makeSubjectMsg( subject->idToStringWithoutBraces(),"updated", "DB"));
|
Logger::logToDb(Logger::makeSubjectMsg( subject->idToStringWithoutBraces(),"updated", "DB"));
|
||||||
}
|
}
|
||||||
db->saveSubjectAttributes(subject, "colnod_subject_attribute");
|
db->saveSubjectAttributes(subject, "colnod_subject_attribute");
|
||||||
}
|
}
|
||||||
@ -183,21 +183,21 @@ void DataManager::pushTokensToDB()
|
|||||||
for (const auto& token : tokensToUpdateFromColnodToDB)
|
for (const auto& token : tokensToUpdateFromColnodToDB)
|
||||||
{
|
{
|
||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
// 1 = adding token
|
// 1 = adding token
|
||||||
// -1 = updating token
|
// -1 = updating token
|
||||||
if (db->saveToken(token, "colnod_token") == 1){
|
if (db->saveToken(token, "colnod_token") == 1){
|
||||||
added++;
|
added++;
|
||||||
text = "Added";
|
text = "Added";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
updated++;
|
updated++;
|
||||||
text = "Updating";
|
text = "Updating";
|
||||||
}
|
}
|
||||||
if (dryMode)
|
if (dryMode)
|
||||||
qInfo() << text << "token:" << token->idToStringWithoutBraces() << "to DB";
|
qInfo() << text << "token:" << token->idToStringWithoutBraces() << "to DB";
|
||||||
else
|
else
|
||||||
Logger::logToDb(Logger::makeTokenMsg(token->idToStringWithoutBraces(), text, "DB"));
|
Logger::logToDb(Logger::makeTokenMsg(token->idToStringWithoutBraces(), text, "DB"));
|
||||||
}
|
}
|
||||||
qInfo() << "DB:" << added << "tokens added/edited";
|
qInfo() << "DB:" << added << "tokens added/edited";
|
||||||
qInfo() << "DB:" << updated << "tokens updated";
|
qInfo() << "DB:" << updated << "tokens updated";
|
||||||
@ -268,8 +268,8 @@ void DataManager::clear()
|
|||||||
subjectsFromColnodToDeleteFromDB.clear();
|
subjectsFromColnodToDeleteFromDB.clear();
|
||||||
tokensToUpdateFromColnodToDB.clear();
|
tokensToUpdateFromColnodToDB.clear();
|
||||||
tokensFromColnodToDeleteFromDB.clear();
|
tokensFromColnodToDeleteFromDB.clear();
|
||||||
//subjectsDB.clear(); // not need yet
|
//subjectsDB.clear(); // not need yet
|
||||||
// subjectsToDeleteDB.clear(); // not need yet
|
// subjectsToDeleteDB.clear(); // not need yet
|
||||||
tokensToUpdateFromDBToColnod.clear();
|
tokensToUpdateFromDBToColnod.clear();
|
||||||
tokensFromDBToDeleteFromColnod.clear();
|
tokensFromDBToDeleteFromColnod.clear();
|
||||||
allTokensFromColnodById.clear();
|
allTokensFromColnodById.clear();
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Entity : public QObject {
|
class Entity : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
using QObject::QObject;
|
using QObject::QObject;
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,8 @@ std::shared_ptr<Response> RequestManager::login()
|
|||||||
QString hash = encryptedPassword(this->password);
|
QString hash = encryptedPassword(this->password);
|
||||||
authHeader = getLoginHeader(this->user, hash);
|
authHeader = getLoginHeader(this->user, hash);
|
||||||
QJsonObject reqBody = {
|
QJsonObject reqBody = {
|
||||||
{"password", hash},
|
{"password", hash},
|
||||||
{"username", this->user}
|
{"username", this->user}
|
||||||
};
|
};
|
||||||
request.setUrl(this->host + "/AaaManager/authSession");
|
request.setUrl(this->host + "/AaaManager/authSession");
|
||||||
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
||||||
@ -36,7 +36,7 @@ std::shared_ptr<Response> RequestManager::login()
|
|||||||
loginStatus = true;
|
loginStatus = true;
|
||||||
emit successLogin();
|
emit successLogin();
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
});
|
});
|
||||||
connect(this, &RequestManager::successLogin, loginResponse.get(), &Response::ready);
|
connect(this, &RequestManager::successLogin, loginResponse.get(), &Response::ready);
|
||||||
connect(this, &RequestManager::successLogin, this, &RequestManager::prepareAuthHeader);
|
connect(this, &RequestManager::successLogin, this, &RequestManager::prepareAuthHeader);
|
||||||
return loginResponse;
|
return loginResponse;
|
||||||
@ -82,7 +82,7 @@ Response* RequestManager::postRequestReturnLogic(const QString& endpoint, const
|
|||||||
connect(this, &RequestManager::successLogin, [=](){
|
connect(this, &RequestManager::successLogin, [=](){
|
||||||
response->setReply(postRequest(endpoint, data));
|
response->setReply(postRequest(endpoint, data));
|
||||||
connect(response->getReply(), &QNetworkReply::finished, response, &Response::ready);
|
connect(response->getReply(), &QNetworkReply::finished, response, &Response::ready);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ QString RequestManager::getFromJson(const QString& json, const QString &member)
|
|||||||
|
|
||||||
QString RequestManager::encryptedPassword(const QString& password)
|
QString RequestManager::encryptedPassword(const QString& password)
|
||||||
{
|
{
|
||||||
return QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha512).toHex().toUpper();
|
return QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha512).toHex().toUpper();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RequestManager::getLoginHeader(const QString& username, const QString& hash)
|
QString RequestManager::getLoginHeader(const QString& username, const QString& hash)
|
||||||
@ -233,7 +233,7 @@ Response* RequestManager::getAccessGroupMembershipUpdated(uint64_t time)
|
|||||||
|
|
||||||
Response* RequestManager::getAccessGroupMembershipDeleted(uint64_t time)
|
Response* RequestManager::getAccessGroupMembershipDeleted(uint64_t time)
|
||||||
{
|
{
|
||||||
return postRequestReturnLogic("/AccessManager/getAccessGroupMembershipDeleted", makeTimestampJson(time));
|
return postRequestReturnLogic("/AccessManager/getAccessGroupMembershipDeleted", makeTimestampJson(time));
|
||||||
}
|
}
|
||||||
|
|
||||||
Response* RequestManager::setTokens(const QHash<QString, std::shared_ptr<Token>> &tokens)
|
Response* RequestManager::setTokens(const QHash<QString, std::shared_ptr<Token>> &tokens)
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
RequestManager();
|
RequestManager();
|
||||||
|
|
||||||
// this should be in ColnodAPI class BEGIN
|
// this should be in ColnodAPI class BEGIN
|
||||||
Response* getSubjects();
|
Response* getSubjects();
|
||||||
Response* getTokens();
|
Response* getTokens();
|
||||||
Response* getTokenSubject();
|
Response* getTokenSubject();
|
||||||
@ -56,10 +56,10 @@ public:
|
|||||||
|
|
||||||
Response* setTokens(const QHash<QString, std::shared_ptr<Token>> &tokens);
|
Response* setTokens(const QHash<QString, std::shared_ptr<Token>> &tokens);
|
||||||
Response* deleteTokens(const QList<QString> &ids);
|
Response* deleteTokens(const QList<QString> &ids);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// should be public
|
// should be public
|
||||||
QNetworkReply* postRequest(const QString& endpoint, const QByteArray& json = QByteArray());
|
QNetworkReply* postRequest(const QString& endpoint, const QByteArray& json = QByteArray());
|
||||||
Response* postRequestReturnLogic(const QString& endpoint, const QByteArray& data = QByteArray());
|
Response* postRequestReturnLogic(const QString& endpoint, const QByteArray& data = QByteArray());
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ private:
|
|||||||
QString encryptedPassword(const QString& password);
|
QString encryptedPassword(const QString& password);
|
||||||
QString getLoginHeader(const QString& username, const QString& hash);
|
QString getLoginHeader(const QString& username, const QString& hash);
|
||||||
|
|
||||||
// in colnod api as well
|
// in colnod api as well
|
||||||
QByteArray makeTimestampJson(uint64_t time);
|
QByteArray makeTimestampJson(uint64_t time);
|
||||||
QByteArray makeTokensJson(const QHash<QString, std::shared_ptr<Token>> &tokens); // maybe better to be in Token class
|
QByteArray makeTokensJson(const QHash<QString, std::shared_ptr<Token>> &tokens); // maybe better to be in Token class
|
||||||
QByteArray makeIdsJson(const QList<QString> &ids); // Entity class
|
QByteArray makeIdsJson(const QList<QString> &ids); // Entity class
|
||||||
|
|||||||
@ -138,5 +138,5 @@ void Token::setSubjectId(const QUuid &subjectId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString Token::subjectIdToStringWithoutBraces(){
|
QString Token::subjectIdToStringWithoutBraces(){
|
||||||
return subjectId.toString().mid(1,36);
|
return subjectId.toString().mid(1,36);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
class Token : public Entity {
|
class Token : public Entity {
|
||||||
public:
|
public:
|
||||||
// using Entity::Entity;
|
// using Entity::Entity;
|
||||||
|
|
||||||
Token() = default;
|
Token() = default;
|
||||||
Token(const QString& name, QString tokenData, const QString& decription = "mobile");
|
Token(const QString& name, QString tokenData, const QString& decription = "mobile");
|
||||||
|
|||||||
@ -342,7 +342,7 @@ void UnitTest::debugConnection()
|
|||||||
void UnitTest::saveDataToDB()
|
void UnitTest::saveDataToDB()
|
||||||
{
|
{
|
||||||
|
|
||||||
// dataMan->localSaveTokens();
|
// dataMan->localSaveTokens();
|
||||||
QVERIFY(true);
|
QVERIFY(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
void ComplexTest::initTestCase()
|
void ComplexTest::initTestCase()
|
||||||
{
|
{
|
||||||
// auto reqMan1 = new RequestManager;
|
// auto reqMan1 = new RequestManager;
|
||||||
// QList<QString> ids;
|
// QList<QString> ids;
|
||||||
// ids.append("582c982d-6fd7-4856-8548-7ce542791c7a");
|
// ids.append("582c982d-6fd7-4856-8548-7ce542791c7a");
|
||||||
// ids.append("3ff23b41-3da3-4b33-82ce-d8e2d8c9a546");
|
// ids.append("3ff23b41-3da3-4b33-82ce-d8e2d8c9a546");
|
||||||
// Response* deleteTokensResp = reqMan1->deleteTokens(ids);
|
// Response* deleteTokensResp = reqMan1->deleteTokens(ids);
|
||||||
// QSignalSpy deleteTokensRespSpy(deleteTokensResp, &Response::ready);
|
// QSignalSpy deleteTokensRespSpy(deleteTokensResp, &Response::ready);
|
||||||
// QCOMPARE(deleteTokensRespSpy.count(), 0);
|
// QCOMPARE(deleteTokensRespSpy.count(), 0);
|
||||||
// deleteTokensRespSpy.wait(timeout);
|
// deleteTokensRespSpy.wait(timeout);
|
||||||
// QTest::qWait(2500);
|
// QTest::qWait(2500);
|
||||||
// Logger *logger = Logger::getLogger();
|
// Logger *logger = Logger::getLogger();
|
||||||
start = QDateTime::currentMSecsSinceEpoch()-2000;
|
start = QDateTime::currentMSecsSinceEpoch()-2000;
|
||||||
api = new SyncManager();
|
api = new SyncManager();
|
||||||
qDebug() << start;
|
qDebug() << start;
|
||||||
@ -21,15 +21,15 @@ void ComplexTest::initTestCase()
|
|||||||
|
|
||||||
void ComplexTest::cleanupTestCase()
|
void ComplexTest::cleanupTestCase()
|
||||||
{
|
{
|
||||||
// QList<QString> ids;
|
// QList<QString> ids;
|
||||||
// ids.append("582c982d-6fd7-4856-8548-7ce542791c7a");
|
// ids.append("582c982d-6fd7-4856-8548-7ce542791c7a");
|
||||||
// ids.append("3ff23b41-3da3-4b33-82ce-d8e2d8c9a546");
|
// ids.append("3ff23b41-3da3-4b33-82ce-d8e2d8c9a546");
|
||||||
// auto reqMan = new RequestManager;
|
// auto reqMan = new RequestManager;
|
||||||
// Response* deleteTokensResp = reqMan->deleteTokens(ids);
|
// Response* deleteTokensResp = reqMan->deleteTokens(ids);
|
||||||
// QSignalSpy deleteTokensRespSpy(deleteTokensResp, &Response::ready);
|
// QSignalSpy deleteTokensRespSpy(deleteTokensResp, &Response::ready);
|
||||||
// QCOMPARE(deleteTokensRespSpy.count(), 0);
|
// QCOMPARE(deleteTokensRespSpy.count(), 0);
|
||||||
// deleteTokensRespSpy.wait(timeout);
|
// deleteTokensRespSpy.wait(timeout);
|
||||||
// QCOMPARE(deleteTokensRespSpy.count(), 1);
|
// QCOMPARE(deleteTokensRespSpy.count(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComplexTest::complexTest()
|
void ComplexTest::complexTest()
|
||||||
|
|||||||
@ -44,11 +44,11 @@ private slots:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//QString host = "http://localhost:8080"; //colnod server (ssh -L 8080:192.168.254.11:8443 penta-master)
|
//QString host = "http://localhost:8080"; //colnod server (ssh -L 8080:192.168.254.11:8443 penta-master)
|
||||||
QString host = "https://192.168.1.3:8443"; //local testing server
|
QString host = "https://192.168.1.3:8443"; //local testing server
|
||||||
QString password = "spaceti1";
|
QString password = "spaceti1";
|
||||||
QString email = "spaceti";
|
QString email = "spaceti";
|
||||||
|
|
||||||
static constexpr int timeout = 10000;
|
static constexpr int timeout = 10000;
|
||||||
static constexpr qint64 epochMS = 1568646217767;
|
static constexpr qint64 epochMS = 1568646217767;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user