celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-237: Fixed some testing issues. Created a working around for a sync issue
Date Tue, 13 Oct 2015 14:39:54 GMT
Repository: celix
Updated Branches:
  refs/heads/develop c6022aac2 -> 353f65790


CELIX-237: Fixed some testing issues. Created a working around for a sync issue


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

Branch: refs/heads/develop
Commit: 353f65790cd771c9262412c5d46183c35e36bcbb
Parents: c6022aa
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Tue Oct 13 16:38:58 2015 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Tue Oct 13 16:38:58 2015 +0200

----------------------------------------------------------------------
 .travis.yml                                            | 13 ++++++-------
 .../remote_service_admin_dfi/CMakeLists.txt            |  3 +--
 .../rsa/private/src/import_registration_dfi.c          |  8 +++++---
 .../rsa_tst/rsa_client_server_tests.cpp                |  8 +++++---
 .../rsa_tst/server.properties.in                       |  1 -
 utils/CMakeLists.txt                                   |  6 +++---
 6 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index f04fd92..8a2d313 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,19 +10,18 @@ matrix:
     - compiler: clang
 
 before_script:  
-    - git clone -b 3.7.2 --single-branch https://github.com/cpputest/cpputest.git cpputest-build
-    - cd cpputest-build
-    - cmake . && make
-    - sudo make install 
-    - cd ..
+    - wget https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.7.1.tar.gz?raw=true
-O /tmp/cpputest.tar.gz
+    - tar -xzvf /tmp/cpputest.tar.gz -C /tmp 
+    - if [ "$CC" = "clang" ]; then export CXX="clang++"; fi && cd /tmp/cpputest-3.7.1
&& ./configure --prefix=/usr && make && make install && cd
-
+    - mkdir build install
     - git clone -b 2.7 --single-branch https://github.com/akheron/jansson.git jansson-build
     - cd jansson-build
     - cmake -DJANSSON_BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr . && make
     - sudo make install
-    - cd ..
+    - cd -
     - mkdir build install
     - 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 -DBUILD_UTILS-TESTS=ON
-DCPPUTEST_INCLUDE_DIR=$HOME/cpputest/include -DCPPUTEST_LIBRARY=$HOME/cpputest/lib/libCppUTest.a
-DCPPUTEST_EXT_INCLUDE_DIR=$HOME/cpputest/include -DCPPUTEST_EXT_LIBRARY=$HOME/cpputest/lib/libCppUTestExt.a
-DENABLE_CODE_COVERAGE=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=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
-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=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 && make coverage
 

http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/remote_services/remote_service_admin_dfi/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/CMakeLists.txt b/remote_services/remote_service_admin_dfi/CMakeLists.txt
index 9d6db45..956b657 100644
--- a/remote_services/remote_service_admin_dfi/CMakeLists.txt
+++ b/remote_services/remote_service_admin_dfi/CMakeLists.txt
@@ -7,8 +7,6 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
     find_package(CURL REQUIRED)
     find_package(Jansson REQUIRED)
     find_package(FFI REQUIRED)
-    #TODO if test check
-    find_package(CppUTest REQUIRED)
 
     include_directories(
         ${CURL_INCLUDE_DIRS}
@@ -24,6 +22,7 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
     add_subdirectory(rsa)
 
     if (ENABLE_TESTING)
+        find_package(CppUTest REQUIRED)
         include_directories(${CPPUTEST_INCLUDE_DIR})
         add_subdirectory(dynamic_function_interface_tst)
         add_subdirectory(rsa_tst)

http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
index f0530b0..50b50f5 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
@@ -87,7 +87,8 @@ static void importRegistration_clearProxies(import_registration_pt import)
{
         if (import->proxies != NULL) {
             hash_map_iterator_pt iter = hashMapIterator_create(import->proxies);
             while (hashMapIterator_hasNext(iter)) {
-                struct service_proxy *proxy = hashMapIterator_nextEntry(iter);
+                hash_map_entry_pt  entry = hashMapIterator_nextEntry(iter);
+                struct service_proxy *proxy = hashMapEntry_getValue(entry);
                 importRegistration_destroyProxy(proxy);
             }
             hashMapIterator_destroy(iter);
@@ -126,12 +127,13 @@ celix_status_t importRegistration_start(import_registration_pt import)
{
 
 celix_status_t importRegistration_stop(import_registration_pt import) {
     celix_status_t status = CELIX_SUCCESS;
+
+    importRegistration_clearProxies(import);
+
     if (import->factoryReg != NULL) {
         serviceRegistration_unregister(import->factoryReg);
     }
 
-    importRegistration_clearProxies(import);
-
     return status;
 }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
b/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
index c1b9b91..836e4ed 100644
--- a/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
+++ b/remote_services/remote_service_admin_dfi/rsa_tst/rsa_client_server_tests.cpp
@@ -64,8 +64,9 @@ extern "C" {
         celixLauncher_destroy(serverFramework);
 
         celixLauncher_stop(clientFramework);
-        celixLauncher_waitForShutdown(clientFramework);
-        celixLauncher_destroy(clientFramework);
+        //TODO, FIXME, hangs on second wait for shutdown.. investigate
+        // celixLauncher_waitForShutdown(clientFramework);
+        //celixLauncher_destroy(clientFramework);
 
         serverContext = NULL;
         serverFramework = NULL;
@@ -91,7 +92,8 @@ extern "C" {
         rc = tst->test(tst->handle);
         CHECK_EQUAL(0, rc);
 
-        bundleContext_ungetService(clientContext, ref, NULL);
+        bool result;
+        bundleContext_ungetService(clientContext, ref, &result);
         bundleContext_ungetServiceReference(clientContext, ref);
     }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/remote_services/remote_service_admin_dfi/rsa_tst/server.properties.in
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa_tst/server.properties.in b/remote_services/remote_service_admin_dfi/rsa_tst/server.properties.in
index ea02519..85a029b 100644
--- a/remote_services/remote_service_admin_dfi/rsa_tst/server.properties.in
+++ b/remote_services/remote_service_admin_dfi/rsa_tst/server.properties.in
@@ -2,7 +2,6 @@ cosgi.auto.start.1=@rsa_bundle_file@ @calc_bundle_file@ @discovery_configured_bu
 LOGHELPER_ENABLE_STDOUT_FALLBACK=true
 RSA_PORT=50882
 DISCOVERY_CFG_SERVER_PORT=50992
-DISCOVERY_CFG_POLL_ENDPOINTS=http://127.0.0.1:50991/org.apache.celix.discovery.configured
 org.osgi.framework.storage.clean=onFirstInit
 org.osgi.framework.storage=.cacheServer
 DISCOVERY_CFG_POLL_INTERVAL=1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/353f6579/utils/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index dfdb56b..4d4b013 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -54,8 +54,8 @@ if (UTILS)
     
     celix_subproject(UTILS-TESTS "Option to build the utilities library tests" "OFF")
 
-    if (UTILS-TESTS)
-    	find_package(CppUTest REQUIRED)
+	if (ENABLE_TESTING)
+		find_package(CppUTest REQUIRED)
 
 	    include_directories(${CUNIT_INCLUDE_DIRS})
 	    include_directories(${CPPUTEST_INCLUDE_DIR})
@@ -94,5 +94,5 @@ if (UTILS)
 		add_test(NAME run_linked_list_test COMMAND linked_list_test)
        	SETUP_TARGET_FOR_COVERAGE(linked_list linked_list_test ${CMAKE_BINARY_DIR}/coverage/linked_list_test/linked_list_test)
 
-   endif(UTILS-TESTS)
+   endif(ENABLE_TESTING)
 endif (UTILS)


Mime
View raw message