${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client.cpp
${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_client.cpp
${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_status_monitor.cpp
+ ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_commons.cpp
${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_env.cpp
${PROJECT_SOURCE_DIR}/tests/cynara-tests/cynara-test.cpp
${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases.cpp
+ ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_async.cpp
)
#header directories
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cynara_test_commons.h>
+#include <cynara_test_env.h>
+
+#include <dpl/exception.h>
+#include <dpl/test/test_runner.h>
+
+#include <exception>
+
+void environmentWrap(const char *testName, const std::function<void(void)> &func)
+{
+ CynaraTestEnv env(testName);
+ env.save();
+
+ try {
+ func();
+ } catch (const DPL::Test::TestRunner::TestFailed &e) {
+ env.restore();
+ throw e;
+ } catch (const DPL::Test::TestRunner::Ignored &e) {
+ env.restore();
+ throw e;
+ } catch (const DPL::Exception &e) {
+ env.restore();
+ throw e;
+ } catch (const std::exception &e) {
+ env.restore();
+ throw e;
+ } catch (...) {
+ env.restore();
+ throw std::runtime_error("Unknown exception");
+ }
+ env.restore();
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * @file cynara_test_commons.h
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @version 1.0
+ * @brief Definition of environment wrap for test cases
+ */
+
+#ifndef CYNARA_TEST_COMMONS_H_
+#define CYNARA_TEST_COMMONS_H_
+
+#include <functional>
+
+void environmentWrap(const char *testName, const std::function<void(void)> &func);
+
+#define RUN_CYNARA_TEST(Proc) \
+ RUNNER_TEST(Proc) \
+ { \
+ environmentWrap(#Proc, Proc##_func); \
+ }
+
+#endif /* CYNARA_TEST_COMMONS_H_ */
* @file test_cases.cpp
* @author Aleksander Zdyb <a.zdyb@partner.samsung.com>
* @author Marcin Niesluchowski <m.niesluchow@samsung.com>
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
* @version 1.1
* @brief Tests for libcynara-client and libcynara-admin
*/
-#include <dpl/exception.h>
+#include <cynara_test_commons.h>
+
#include <tests_common.h>
#include <cynara_test_client.h>
#include <cynara_test_admin.h>
-#include <cynara_test_env.h>
-#include <functional>
#include <climits>
-void environmentWrap(const char *testName, const std::function<void(void)> &func)
-{
- CynaraTestEnv env(testName);
- env.save();
-
- try {
- func();
- } catch (const DPL::Test::TestRunner::TestFailed &e) {
- env.restore();
- throw e;
- } catch (const DPL::Test::TestRunner::Ignored &e) {
- env.restore();
- throw e;
- } catch (const DPL::Exception &e) {
- env.restore();
- throw e;
- } catch (const std::exception &e) {
- env.restore();
- throw e;
- } catch (...) {
- env.restore();
- throw std::runtime_error("Unknown exception");
- }
- env.restore();
-}
-
-#define RUN_CYNARA_TEST(Proc) \
- RUNNER_TEST(Proc) \
- { \
- environmentWrap(#Proc, Proc##_func); \
- }
-
void tc01_cynara_initialize_func()
{
CynaraTestClient();
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * @file test_cases_async.cpp
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @version 1.0
+ * @brief Tests for libcynara-client-async
+ */
+
+#include <cynara_test_commons.h>
+#include <cynara_test_client_async_client.h>
+
+#include <dpl/test/test_runner.h>
+
+void tca01_initialize_func()
+{
+ CynaraTestClientAsync::Client client;
+}
+
+RUNNER_TEST_GROUP_INIT(cynara_async_tests)
+
+RUN_CYNARA_TEST(tca01_initialize)