summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-07-18 09:35:50 +0900
committersangwan.kwon <sangwan.kwon@samsung.com>2016-07-22 14:59:37 +0900
commit99659ec45d64234927b2fca33ad58e0648e573ca (patch)
tree22fcd8780573c887ec626e2f610515242c42098e /tests
parentf744139cf01c9f6bc19968cd728965fb874c194a (diff)
downloadcert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.tar.gz
cert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.tar.bz2
cert-checker-99659ec45d64234927b2fca33ad58e0648e573ca.zip
Replace popup architecture to systemd service
[AS-IS] * popup used to pipe for IPC [TO-BE] * use to systemd service Change-Id: Ie203c8a4dbcb071fd3896e0c7af1bb8cd7280dbf Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/popup_test.cpp34
-rw-r--r--tests/stubs_.cpp15
3 files changed, 22 insertions, 30 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c7db294..b1c65a0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -80,8 +80,7 @@ SET(CERT_CHECKER_POPUP_TEST_SOURCES
${CERT_CHECKER_TESTS_SRC_PATH}/popup_test.cpp
# cert-checker
${CERT_CHECKER_SERVICE_PATH}/app.cpp
- ${CERT_CHECKER_UI_PATH}/popup-runner.cpp
- ${CERT_CHECKER_UI_PATH}/UIBackend.cpp
+ ${CERT_CHECKER_UI_PATH}/popup-client.cpp
)
INCLUDE_DIRECTORIES(SYSTEM
diff --git a/tests/popup_test.cpp b/tests/popup_test.cpp
index 8bdff76..ea4ba3a 100644
--- a/tests/popup_test.cpp
+++ b/tests/popup_test.cpp
@@ -16,33 +16,33 @@
/*
* @file popup_test.cpp
* @author Janusz Kozerski (j.kozerski@samsung.com)
+ * @author Sangwan Kwon (sangwan.kwon@samsung.com)
* @version 1.0
* @brief Cert-checker popup test
*/
-#include <cchecker/UIBackend.h>
-
+#include "service/app.h"
#include "common/log.h"
+#include "ui/popup-client.h"
-using namespace CCHECKER;
-
-int main(int argc, char **argv)
+int main(int, char **)
{
LogDebug("Cert-checker popup-test start!");
- int timeout = 60;
+ setlocale(LC_ALL, "");
- if (argc > 1) {
- timeout = atoi(argv[1]);
- }
+ CCHECKER::app_t app(
+ std::string("test_APP_ID"),
+ std::string("test_PKG_ID"),
+ 5005,
+ {});
+
+ CCHECKER::UI::PopupClient client;
+ // TODO(sangwan.kwon) Add boost TC for output FAIL, SUCCESS
+ if (client.dispatch(app))
+ LogDebug("Success to launch popup.");
+ else
+ LogError("Failed to launch popup.");
- LogDebug("popup-test timeout: " << timeout);
- setlocale(LC_ALL, "");
- UI::UIBackend ui(timeout);
- app_t app(std::string("test_APP_ID"),
- std::string("test PKG ID"),
- 5005,
- {});
- ui.call_popup(app);
LogDebug("Cert-checker popup-test exit!");
return 0;
}
diff --git a/tests/stubs_.cpp b/tests/stubs_.cpp
index 2f46fb1..73957ce 100644
--- a/tests/stubs_.cpp
+++ b/tests/stubs_.cpp
@@ -22,9 +22,9 @@
#include "service/certs.h"
#include "service/queue.h"
+#include "ui/popup-client.h"
#include <cchecker/sql_query.h>
-#include <cchecker/UIBackend.h>
namespace CCHECKER {
@@ -98,19 +98,12 @@ void DB::SqlQuery::get_app_list(std::list<app_t> &apps_buffer)
}
// UI
-UI::UIBackend::UIBackend(int timeout) :
- m_responseTimeout(timeout)
+UI::PopupClient::PopupClient()
{}
-UI::UIBackend::~UIBackend()
-{}
-
-bool UI::UIBackend::call_popup(const app_t &app)
+bool UI::PopupClient::dispatch(const app_t &app)
{
- if (app.uid > 5000)
- return true;
-
- return false;
+ return app.uid > 5000;
}
} //CCHECKER