You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2015/10/13 19:48:02 UTC

[1/3] celix git commit: CELIX-274: Added test for startup/shutdown single and multiple frameworks

Repository: celix
Updated Branches:
  refs/heads/develop 0da1becf6 -> 24d6d1100


CELIX-274: Added test for startup/shutdown single and multiple frameworks


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/32b1d86f
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/32b1d86f
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/32b1d86f

Branch: refs/heads/develop
Commit: 32b1d86fe1e5096f2eee3d4ec4119d70001d4fca
Parents: 353f657
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Oct 13 17:09:31 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Oct 13 17:09:31 2015 +0200

----------------------------------------------------------------------
 framework/CMakeLists.txt                   |  8 +++
 framework/tst/CMakeLists.txt               | 30 +++++++++
 framework/tst/config.properties.in         |  2 +
 framework/tst/framework1.properties.in     |  3 +
 framework/tst/framework2.properties.in     |  3 +
 framework/tst/multiple_frameworks_test.cpp | 88 +++++++++++++++++++++++++
 framework/tst/run_tests.cpp                |  9 +++
 framework/tst/single_framework_test.cpp    | 69 +++++++++++++++++++
 8 files changed, 212 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index becc338..4ca323c 100644
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -82,6 +82,14 @@ if (FRAMEWORK)
     INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
     INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/" DESTINATION share/celix/cmake/modules COMPONENT framework) 
 
+
+    if (ENABLE_TESTING)
+        find_package(CppUTest REQUIRED)
+        include_directories(${CPPUTEST_INCLUDE_DIR})
+        add_subdirectory(tst)
+    endif()
+
+
 	celix_subproject(FRAMEWORK_TESTS "Option to build the framework tests" "OFF" DEPS)
     if (ENABLE_TESTING AND FRAMEWORK_TESTS)
     	find_package(CppUTest REQUIRED)

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/framework/tst/CMakeLists.txt b/framework/tst/CMakeLists.txt
new file mode 100644
index 0000000..9f6a213
--- /dev/null
+++ b/framework/tst/CMakeLists.txt
@@ -0,0 +1,30 @@
+#
+# Licensed under Apache License v2. See LICENSE for more information.
+#
+
+
+include_directories(
+    ${PROJECT_SOURCE_DIR}/framework/public/include
+    ${PROJECT_SOURCE_DIR}/utils/public/include
+    ${PROJECT_SOURCE_DIR}/utils/public/include
+)
+
+
+SET(CMAKE_SKIP_BUILD_RPATH  FALSE) #TODO needed?
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #TODO needed?
+SET(CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/framework" "${PROJECT_BINARY_DIR}/utils")
+
+add_executable(test_framework
+    run_tests.cpp
+    single_framework_test.cpp
+    multiple_frameworks_test.cpp
+)
+target_link_libraries(test_framework celix_framework celix_utils ${CURL_LIBRARIES} ${CPPUTEST_LIBRARY})
+
+configure_file(config.properties.in config.properties @ONLY)
+configure_file(framework1.properties.in framework1.properties @ONLY)
+configure_file(framework2.properties.in framework2.properties @ONLY)
+
+add_test(NAME run_test_framework COMMAND test_framework)
+SETUP_TARGET_FOR_COVERAGE(test_framework_cov test_framework ${CMAKE_BINARY_DIR}/coverage/framework)
+

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/config.properties.in
----------------------------------------------------------------------
diff --git a/framework/tst/config.properties.in b/framework/tst/config.properties.in
new file mode 100644
index 0000000..eec9144
--- /dev/null
+++ b/framework/tst/config.properties.in
@@ -0,0 +1,2 @@
+LOGHELPER_ENABLE_STDOUT_FALLBACK=true
+org.osgi.framework.storage.clean=onFirstInit
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/framework1.properties.in
----------------------------------------------------------------------
diff --git a/framework/tst/framework1.properties.in b/framework/tst/framework1.properties.in
new file mode 100644
index 0000000..a7009c5
--- /dev/null
+++ b/framework/tst/framework1.properties.in
@@ -0,0 +1,3 @@
+LOGHELPER_ENABLE_STDOUT_FALLBACK=true
+org.osgi.framework.storage.clean=onFirstInit
+org.osgi.framework.storage=.cacheFramework1

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/framework2.properties.in
----------------------------------------------------------------------
diff --git a/framework/tst/framework2.properties.in b/framework/tst/framework2.properties.in
new file mode 100644
index 0000000..029f46b
--- /dev/null
+++ b/framework/tst/framework2.properties.in
@@ -0,0 +1,3 @@
+LOGHELPER_ENABLE_STDOUT_FALLBACK=true
+org.osgi.framework.storage.clean=onFirstInit
+org.osgi.framework.storage=.cacheFramework2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/multiple_frameworks_test.cpp
----------------------------------------------------------------------
diff --git a/framework/tst/multiple_frameworks_test.cpp b/framework/tst/multiple_frameworks_test.cpp
new file mode 100644
index 0000000..b732000
--- /dev/null
+++ b/framework/tst/multiple_frameworks_test.cpp
@@ -0,0 +1,88 @@
+/*
+ * Licensed under Apache License v2. See LICENSE for more information.
+ */
+#include <CppUTest/TestHarness.h>
+#include <CppUTest/CommandLineTestRunner.h>
+
+extern "C" {
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#include "celix_launcher.h"
+#include "framework.h"
+
+    static framework_pt serverFramework = NULL;
+    static bundle_context_pt serverContext = NULL;
+
+    static framework_pt clientFramework = NULL;
+    static bundle_context_pt clientContext = NULL;
+
+    static void setupFm(void) {
+        int rc = 0;
+        bundle_pt bundle = NULL;
+
+        //server
+        rc = celixLauncher_launch("framework1.properties", &serverFramework);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        bundle = NULL;
+        rc = framework_getFrameworkBundle(serverFramework, &bundle);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        rc = bundle_getContext(bundle, &serverContext);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+
+        //client
+        rc = celixLauncher_launch("framework2.properties", &clientFramework);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        bundle = NULL;
+        rc = framework_getFrameworkBundle(clientFramework, &bundle);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        rc = bundle_getContext(bundle, &clientContext);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+    }
+
+    static void teardownFm(void) {
+        int rc = 0;
+
+        celixLauncher_stop(serverFramework);
+        celixLauncher_waitForShutdown(serverFramework);
+        celixLauncher_destroy(serverFramework);
+
+        celixLauncher_stop(clientFramework);
+        celixLauncher_waitForShutdown(clientFramework);
+        celixLauncher_destroy(clientFramework);
+
+        serverContext = NULL;
+        serverFramework = NULL;
+        clientContext = NULL;
+        clientFramework = NULL;
+    }
+
+    static void testFrameworks(void) {
+        printf("testing startup/shutdown mutiple frameworks\n");    }
+
+}
+
+
+TEST_GROUP(CelixMutipleFramworks) {
+    void setup() {
+        setupFm();
+    }
+
+    void teardown() {
+        teardownFm();
+    }
+};
+
+TEST(CelixMutipleFramworks, testFrameworks) {
+    testFrameworks();
+}

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/run_tests.cpp
----------------------------------------------------------------------
diff --git a/framework/tst/run_tests.cpp b/framework/tst/run_tests.cpp
new file mode 100644
index 0000000..c5e960c
--- /dev/null
+++ b/framework/tst/run_tests.cpp
@@ -0,0 +1,9 @@
+/*
+ * Licensed under Apache License v2. See LICENSE for more information.
+ */
+#include <CppUTest/TestHarness.h>
+#include "CppUTest/CommandLineTestRunner.h"
+
+int main(int argc, char** argv) {
+    return RUN_ALL_TESTS(argc, argv);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/32b1d86f/framework/tst/single_framework_test.cpp
----------------------------------------------------------------------
diff --git a/framework/tst/single_framework_test.cpp b/framework/tst/single_framework_test.cpp
new file mode 100644
index 0000000..5f232a6
--- /dev/null
+++ b/framework/tst/single_framework_test.cpp
@@ -0,0 +1,69 @@
+/*
+ * Licensed under Apache License v2. See LICENSE for more information.
+ */
+#include <CppUTest/TestHarness.h>
+#include <CppUTest/CommandLineTestRunner.h>
+
+extern "C" {
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "celix_launcher.h"
+#include "framework.h"
+
+
+    static framework_pt framework = NULL;
+    static bundle_context_pt context = NULL;
+
+    static void setupFm(void) {
+        int rc = 0;
+
+        rc = celixLauncher_launch("config.properties", &framework);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        bundle_pt bundle = NULL;
+        rc = framework_getFrameworkBundle(framework, &bundle);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
+        rc = bundle_getContext(bundle, &context);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+    }
+
+    static void teardownFm(void) {
+        int rc = 0;
+
+        celixLauncher_stop(framework);
+        celixLauncher_waitForShutdown(framework);
+        celixLauncher_destroy(framework);
+
+        context = NULL;
+        framework = NULL;
+    }
+
+    static void testFramework(void) {
+        //intentional empty. start/shutdown test
+        printf("testing startup/shutdown single framework\n");
+    }
+
+    //TODO test register / use service
+
+}
+
+
+TEST_GROUP(CelixFramework) {
+    void setup() {
+        setupFm();
+    }
+
+    void teardown() {
+        teardownFm();
+    }
+};
+
+TEST(CelixFramework, testFramework) {
+    testFramework();
+}


[2/3] celix git commit: CELIX-274: Merge remote-tracking branch 'remotes/origin/feature/CELIX-274_mutiple_frameworks' into develop

Posted by pn...@apache.org.
CELIX-274: Merge remote-tracking branch 'remotes/origin/feature/CELIX-274_mutiple_frameworks' into develop


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/ae8bd202
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/ae8bd202
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/ae8bd202

Branch: refs/heads/develop
Commit: ae8bd2023f7ed3aba7aedae4630ad11666dcd484
Parents: 0da1bec 32b1d86
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Oct 13 19:43:38 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Oct 13 19:43:38 2015 +0200

----------------------------------------------------------------------
 framework/CMakeLists.txt                   |  8 +++
 framework/tst/CMakeLists.txt               | 30 +++++++++
 framework/tst/config.properties.in         |  2 +
 framework/tst/framework1.properties.in     |  3 +
 framework/tst/framework2.properties.in     |  3 +
 framework/tst/multiple_frameworks_test.cpp | 88 +++++++++++++++++++++++++
 framework/tst/run_tests.cpp                |  9 +++
 framework/tst/single_framework_test.cpp    | 69 +++++++++++++++++++
 8 files changed, 212 insertions(+)
----------------------------------------------------------------------



[3/3] celix git commit: CELIX-237: Disableling rsa dfi in the travis config for now. Seem to have an issue with dfi and ubuntu based systems

Posted by pn...@apache.org.
CELIX-237: Disableling rsa dfi in the travis config for now. Seem to have an issue with dfi and ubuntu based systems


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/24d6d110
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/24d6d110
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/24d6d110

Branch: refs/heads/develop
Commit: 24d6d1100d629484b900f3e44b8f070d2f92d492
Parents: ae8bd20
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Oct 13 19:44:32 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Oct 13 19:44:32 2015 +0200

----------------------------------------------------------------------
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/24d6d110/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 5fbfde2..f91ab76 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ before_script:
 
 script:
     - cd build
-    - cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=../install ..
+    - cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=../install ..
     - make all && make deploy && make install-all
     - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage