celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1528394 [1/4] - in /incubator/celix/trunk: cmake/ framework/ framework/private/mock/ framework/private/resources-test/ framework/private/test/ framework/public/include/
Date Wed, 02 Oct 2013 09:16:55 GMT
Author: abroekhuis
Date: Wed Oct  2 09:16:54 2013
New Revision: 1528394

URL: http://svn.apache.org/r1528394
Log:
CELIX-55: Added unit tests and mocks. Also setup coverage

Added:
    incubator/celix/trunk/cmake/CodeCoverage.cmake
    incubator/celix/trunk/framework/private/mock/
    incubator/celix/trunk/framework/private/mock/attribute_mock.c
    incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c
    incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c
    incubator/celix/trunk/framework/private/mock/bundle_context_mock.c
    incubator/celix/trunk/framework/private/mock/bundle_mock.c
    incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c
    incubator/celix/trunk/framework/private/mock/capability_mock.c
    incubator/celix/trunk/framework/private/mock/filter_mock.c
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/mock/framework_mock.c
    incubator/celix/trunk/framework/private/mock/manifest_mock.c
    incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c
    incubator/celix/trunk/framework/private/mock/miniunz_mock.c
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/mock/module_mock.c
    incubator/celix/trunk/framework/private/mock/properties_mock.c
    incubator/celix/trunk/framework/private/mock/requirement_mock.c
    incubator/celix/trunk/framework/private/mock/resolver_mock.c
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/mock/service_reference_mock.c
    incubator/celix/trunk/framework/private/mock/service_registration_mock.c
    incubator/celix/trunk/framework/private/mock/service_registry_mock.c
    incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c
    incubator/celix/trunk/framework/private/mock/version_mock.c
    incubator/celix/trunk/framework/private/mock/version_range_mock.c
    incubator/celix/trunk/framework/private/mock/wire_mock.c
    incubator/celix/trunk/framework/private/resources-test/
    incubator/celix/trunk/framework/private/resources-test/properties.txt
    incubator/celix/trunk/framework/private/test/attribute_test.cpp
    incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp
    incubator/celix/trunk/framework/private/test/bundle_context_test.cpp
    incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp
    incubator/celix/trunk/framework/private/test/bundle_test.cpp
    incubator/celix/trunk/framework/private/test/capability_test.cpp
    incubator/celix/trunk/framework/private/test/filter_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/framework_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/manifest_parser_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/manifest_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/module_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/properties_test.cpp
    incubator/celix/trunk/framework/private/test/requirement_test.cpp
    incubator/celix/trunk/framework/private/test/resolver_test.cpp
      - copied, changed from r1528390, incubator/celix/trunk/framework/public/include/service_event.h
    incubator/celix/trunk/framework/private/test/service_reference_test.cpp
    incubator/celix/trunk/framework/private/test/service_registration_test.cpp
    incubator/celix/trunk/framework/private/test/service_registry_test.cpp
    incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp
    incubator/celix/trunk/framework/private/test/service_tracker_test.cpp
    incubator/celix/trunk/framework/private/test/utils_test.cpp
Modified:
    incubator/celix/trunk/framework/CMakeLists.txt
    incubator/celix/trunk/framework/private/test/version_range_test.cpp
    incubator/celix/trunk/framework/public/include/service_event.h

Added: incubator/celix/trunk/cmake/CodeCoverage.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/CodeCoverage.cmake?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/CodeCoverage.cmake (added)
+++ incubator/celix/trunk/cmake/CodeCoverage.cmake Wed Oct  2 09:16:54 2013
@@ -0,0 +1,81 @@
+# - Enable Code Coverage
+#
+# 2012-01-31, Lars Bilke
+#
+# USAGE:
+# 1. Copy this file into your cmake modules path
+# 2. Add the following line to your CMakeLists.txt:
+#      INCLUDE(CodeCoverage)
+# 
+# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
+#    which runs your test executable and produces a lcov code coverage report.
+#
+
+# Check prereqs
+FIND_PROGRAM( GCOV_PATH gcov )
+FIND_PROGRAM( LCOV_PATH lcov )
+FIND_PROGRAM( GENHTML_PATH genhtml )
+FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+IF(NOT GCOV_PATH)
+	MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
+ENDIF() # NOT GCOV_PATH
+
+#IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+#	MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+#ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
+
+IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
+  MESSAGE( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" )
+ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+
+
+# Setup compiler options
+ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
+LINK_LIBRARIES(profile_rt)
+
+
+add_custom_target(coverage
+	COMMAND ${CMAKE_COMMAND} -E make_directory coverage_results
+	COMMAND ${GENHTML_PATH} -o coverage_results coverage/*.info.cleaned
+	COMMAND ${CMAKE_COMMAND} -E remove_directory coverage
+	
+	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+	COMMENT "Generating report.\nOpen ./${_outputname}/index.html in your browser to view the coverage report."
+)
+
+# Param _targetname     The name of new the custom make target
+# Param _testrunner     The name of the target which runs the tests
+# Param _outputname     lcov output is generated as _outputname.info
+#                       HTML report is generated in _outputname/index.html
+# Optional fourth parameter is passed as arguments to _testrunner
+#   Pass them in list form, e.g.: "-j;2" for -j 2
+FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
+
+	IF(NOT LCOV_PATH)
+		MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
+	ENDIF() # NOT LCOV_PATH
+
+	IF(NOT GENHTML_PATH)
+		MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
+	ENDIF() # NOT GENHTML_PATH
+
+	# Setup target
+	ADD_CUSTOM_TARGET(${_targetname}
+		
+		# Cleanup lcov
+		${LCOV_PATH} --directory . --zerocounters
+		
+		# Run tests
+		COMMAND ${_testrunner} ${ARGV3}
+		
+		# Capturing lcov counters and generating report
+		COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
+		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
+		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'mock/*' 'test/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+		
+		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+		COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+	)
+	ADD_DEPENDENCIES(coverage ${_targetname})
+ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE

Modified: incubator/celix/trunk/framework/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/CMakeLists.txt?rev=1528394&r1=1528393&r2=1528394&view=diff
==============================================================================
--- incubator/celix/trunk/framework/CMakeLists.txt (original)
+++ incubator/celix/trunk/framework/CMakeLists.txt Wed Oct  2 09:16:54 2013
@@ -1,28 +1,29 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-
-celix_subproject(FRAMEWORK "Option to build the framework shared library" "ON" DEPS UTILS)
-if (FRAMEWORK) 
-    cmake_minimum_required(VERSION 2.6)
-    
-    find_package(ZLIB REQUIRED)
-    
-    include(CPackComponent)
-    
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+celix_subproject(FRAMEWORK "Option to build the framework shared library" "ON" DEPS UTILS)
+if (FRAMEWORK) 
+    cmake_minimum_required(VERSION 2.6)
+    
+    find_package(ZLIB REQUIRED)
+    
+    include(CPackComponent)
+    include(${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake)
+    
     #cpack_add_component(framework
     #	DISPLAY_NAME Framework
     #    DESCRIPTION "The Apache Celix framework library"
@@ -33,59 +34,252 @@ if (FRAMEWORK) 
     	DISPLAY_NAME Framework
         DESCRIPTION "The Apache Celix framework library"
         GROUP all
-    )
-    
-    add_definitions(-DUSE_FILE32API)
-    include_directories(${ZLIB_INCLUDE_DIR})
-    include_directories("private/include")
-    include_directories("public/include")
-    include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-
-	if(WIN32)
-	  set(IO private/src/iowin32.c)
-	endif(WIN32)
-
-    add_library(celix_framework SHARED
-	 private/src/attribute.c private/src/bundle.c private/src/bundle_archive.c private/src/bundle_cache.c
-	 private/src/bundle_context.c private/src/bundle_revision.c private/src/capability.c private/src/celix_errorcodes.c
-	 private/src/filter.c private/src/framework.c private/src/manifest.c private/src/ioapi.c
-	 private/src/manifest_parser.c private/src/miniunz.c private/src/module.c private/src/properties.c 
-	 private/src/requirement.c private/src/resolver.c private/src/service_reference.c private/src/service_registration.c 
-	 private/src/service_registry.c private/src/service_tracker.c private/src/service_tracker_customizer.c
-	 private/src/unzip.c private/src/utils.c private/src/version.c private/src/version_range.c private/src/wire.c
-
-	 private/include/attribute.h public/include/framework_exports.h
-
-	 public/include/framework.h public/include/properties.h public/include/bundle_context.h public/include/bundle.h
-	 public/include/bundle_activator.h public/include/service_registration.h public/include/service_reference.h
-	 public/include/bundle_archive.h public/include/utils.h public/include/module.h public/include/service_tracker.h
-	 public/include/service_tracker_customizer.h
-	 
-		${IO}
-	 
-	)
-    target_link_libraries(celix_framework celix_utils ${ZLIB_LIBRARY} ${APR_LIBRARY} ${APRUTIL_LIBRARY})
-    
-    install(TARGETS celix_framework DESTINATION lib COMPONENT framework)
-    FILE(GLOB files "public/include/*.h")
-    INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
-    
-    include_directories(${CUNIT_INCLUDE_DIRS})
+    )
+    
+    add_definitions(-DUSE_FILE32API)
+    include_directories(${ZLIB_INCLUDE_DIR})
+    include_directories("private/include")
+    include_directories("public/include")
+    include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+
+	if(WIN32)
+	  set(IO private/src/iowin32.c)
+	endif(WIN32)
+
+    add_library(celix_framework SHARED
+	 private/src/attribute.c private/src/bundle.c private/src/bundle_archive.c private/src/bundle_cache.c
+	 private/src/bundle_context.c private/src/bundle_revision.c private/src/capability.c private/src/celix_errorcodes.c
+	 private/src/filter.c private/src/framework.c private/src/manifest.c private/src/ioapi.c
+	 private/src/manifest_parser.c private/src/miniunz.c private/src/module.c private/src/properties.c 
+	 private/src/requirement.c private/src/resolver.c private/src/service_reference.c private/src/service_registration.c 
+	 private/src/service_registry.c private/src/service_tracker.c private/src/service_tracker_customizer.c
+	 private/src/unzip.c private/src/utils.c private/src/version.c private/src/version_range.c private/src/wire.c
+
+	 private/include/attribute.h public/include/framework_exports.h
+
+	 public/include/framework.h public/include/properties.h public/include/bundle_context.h public/include/bundle.h
+	 public/include/bundle_activator.h public/include/service_registration.h public/include/service_reference.h
+	 public/include/bundle_archive.h public/include/utils.h public/include/module.h public/include/service_tracker.h
+	 public/include/service_tracker_customizer.h
+	 
+		${IO}
+	 
+	)
+    target_link_libraries(celix_framework celix_utils ${ZLIB_LIBRARY} ${APR_LIBRARY} ${APRUTIL_LIBRARY})
+    
+    install(TARGETS celix_framework DESTINATION lib COMPONENT framework)
+    FILE(GLOB files "public/include/*.h")
+    INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
+    
+    #include_directories(${CUNIT_INCLUDE_DIRS})
     include_directories(${CPPUTEST_INCLUDE_DIR})
     include_directories(${CPPUTEST_EXT_INCLUDE_DIR})
     
-    add_executable(framework_test private/test/framework_test)
-    target_link_libraries(framework_test celix_utils celix_framework ${CUNIT_LIBRARIES})
+    #add_executable(framework_test private/test/framework_test)
+    #target_link_libraries(framework_test celix_utils celix_framework ${CUNIT_LIBRARIES})
     
     add_executable(version_test private/test/version_test.cpp private/src/version.c)
 	target_link_libraries(version_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY})
 	
 	add_executable(version_range_test private/test/version_range_test.cpp private/src/version_range.c)
-	target_link_libraries(version_range_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
-    
-    run_test(framework_test)
+	target_link_libraries(version_range_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
+	
+	add_executable(utils_test private/test/utils_test.cpp private/src/utils.c)
+	target_link_libraries(utils_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
+	
+	add_executable(service_tracker_test 
+		private/test/service_tracker_test.cpp 
+		private/mock/bundle_context_mock.c
+		private/mock/service_reference_mock.c 
+		private/mock/service_tracker_customizer_mock.c
+		private/src/service_tracker.c)
+	target_link_libraries(service_tracker_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(service_tracker_customizer_test 
+		private/test/service_tracker_customizer_test.cpp
+		private/mock/service_reference_mock.c
+		private/src/service_tracker_customizer.c) 
+	target_link_libraries(service_tracker_customizer_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(service_registry_test 
+		private/test/service_registry_test.cpp
+		private/mock/framework_mock.c
+		private/mock/bundle_mock.c
+		private/mock/filter_mock.c
+		private/mock/service_reference_mock.c
+		private/mock/service_registration_mock.c
+		private/mock/properties_mock.c
+		private/src/service_registry.c) 
+	target_link_libraries(service_registry_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(service_registration_test 
+		private/test/service_registration_test.cpp
+		private/mock/properties_mock.c
+		private/mock/service_registry_mock.c
+		private/src/service_registration.c)
+	target_link_libraries(service_registration_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(service_reference_test 
+		private/test/service_reference_test.cpp
+		private/mock/service_registration_mock.c
+		private/mock/service_registry_mock.c
+		private/src/service_reference.c)
+	target_link_libraries(service_reference_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(resolver_test 
+		private/test/resolver_test.cpp
+		private/mock/bundle_mock.c
+		private/mock/requirement_mock.c
+		private/mock/capability_mock.c
+		private/mock/module_mock.c
+		private/mock/wire_mock.c
+		private/src/resolver.c)
+	target_link_libraries(resolver_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+    
+	add_executable(requirement_test 
+		private/test/requirement_test.cpp
+		private/mock/attribute_mock.c
+		private/mock/capability_mock.c
+		private/mock/version_range_mock.c
+		private/src/requirement.c)
+	target_link_libraries(requirement_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(properties_test 
+		private/test/properties_test.cpp
+		private/src/utils.c
+		private/src/properties.c)
+	target_link_libraries(properties_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(module_test 
+		private/test/module_test.cpp
+		private/mock/bundle_mock.c
+		private/mock/version_mock.c
+		private/mock/manifest_mock.c
+		private/mock/manifest_parser_mock.c
+		private/mock/capability_mock.c
+		private/mock/wire_mock.c
+		private/src/module.c)
+	target_link_libraries(module_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(manifest_test 
+		private/test/manifest_test.cpp
+		private/mock/properties_mock.c
+		private/src/utils.c
+		private/src/manifest.c)
+	target_link_libraries(manifest_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(manifest_parser_test 
+		private/test/manifest_parser_test.cpp
+		private/mock/attribute_mock.c
+		private/mock/manifest_mock.c
+		private/mock/capability_mock.c
+		private/mock/requirement_mock.c
+		private/mock/version_mock.c
+		private/src/utils.c
+		private/src/manifest_parser.c)
+	target_link_libraries(manifest_parser_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(framework_test 
+		private/test/framework_test.cpp
+		private/mock/properties_mock.c
+		private/mock/resolver_mock.c
+		private/mock/service_reference_mock.c
+		private/mock/service_registry_mock.c
+		private/mock/service_registration_mock.c
+		private/mock/filter_mock.c
+		private/mock/bundle_mock.c
+		private/mock/bundle_context_mock.c
+		private/mock/module_mock.c
+		private/mock/bundle_archive_mock.c
+		private/mock/bundle_revision_mock.c
+		private/mock/bundle_cache_mock.c
+		private/mock/manifest_mock.c
+		private/src/utils.c
+		private/src/framework.c)
+	target_link_libraries(framework_test ${APR_LIBRARY} ${APRUTIL_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(filter_test 
+		private/test/filter_test.cpp
+		private/mock/properties_mock.c
+		private/src/filter.c)
+	target_link_libraries(filter_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(capability_test 
+		private/test/capability_test.cpp
+		private/mock/attribute_mock.c
+		private/mock/version_mock.c
+		private/src/capability.c)
+	target_link_libraries(capability_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(bundle_test 
+		private/test/bundle_test.cpp
+		private/mock/framework_mock.c
+		private/mock/module_mock.c
+		private/mock/bundle_archive_mock.c
+		private/mock/resolver_mock.c
+		private/mock/version_mock.c
+		private/src/utils.c
+		private/src/bundle.c)
+	target_link_libraries(bundle_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(bundle_revision_test 
+		private/test/bundle_revision_test.cpp
+		private/mock/miniunz_mock.c
+		private/src/bundle_revision.c)
+	target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(bundle_context_test 
+		private/test/bundle_context_test.cpp
+		private/mock/bundle_mock.c
+		private/mock/framework_mock.c
+		private/src/bundle_context.c)
+	target_link_libraries(bundle_context_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(bundle_cache_test 
+		private/test/bundle_cache_test.cpp
+		private/mock/bundle_archive_mock.c
+		private/mock/properties_mock.c
+		private/src/bundle_cache.c)
+	target_link_libraries(bundle_cache_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(bundle_archive_test 
+		private/test/bundle_archive_test.cpp
+		private/mock/bundle_revision_mock.c
+		private/src/bundle_archive.c)
+	target_link_libraries(bundle_archive_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+	add_executable(attribute_test 
+		private/test/attribute_test.cpp
+		private/src/attribute.c)
+	target_link_libraries(attribute_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
+	
+    #run_test(framework_test)
+    
+    #add_test(framework_test framework_test -ojunit)
+    #add_test(version_test version_test -ojunit)
+    #add_test(version_range_test version_range_test -ojunit)
     
-    add_test(framework_test framework_test -ojunit)
-    add_test(version_test version_test -ojunit)
-    add_test(version_range_test version_range_test -ojunit)
+	SETUP_TARGET_FOR_COVERAGE(version_test_c version_test ${CMAKE_BINARY_DIR}/coverage/version_test)
+	SETUP_TARGET_FOR_COVERAGE(version_range_test_c version_range_test ${CMAKE_BINARY_DIR}/coverage/version_range_test)
+	SETUP_TARGET_FOR_COVERAGE(service_tracker_test_c service_tracker_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_test)
+	SETUP_TARGET_FOR_COVERAGE(service_tracker_customizer_test_c service_tracker_customizer_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_customizer_test)
+	SETUP_TARGET_FOR_COVERAGE(service_registry_test_c service_registry_test ${CMAKE_BINARY_DIR}/coverage/service_registry_test)
+	SETUP_TARGET_FOR_COVERAGE(service_registration_test_c service_registration_test ${CMAKE_BINARY_DIR}/coverage/service_registration_test)
+	SETUP_TARGET_FOR_COVERAGE(service_reference_test_c service_reference_test ${CMAKE_BINARY_DIR}/coverage/service_reference_test)
+	SETUP_TARGET_FOR_COVERAGE(resolver_test_c resolver_test ${CMAKE_BINARY_DIR}/coverage/resolver_test)
+	SETUP_TARGET_FOR_COVERAGE(requirement_test_c requirement_test ${CMAKE_BINARY_DIR}/coverage/requirement_test)
+	SETUP_TARGET_FOR_COVERAGE(properties_test_c properties_test ${CMAKE_BINARY_DIR}/coverage/properties_test)
+	SETUP_TARGET_FOR_COVERAGE(module_test_c module_test ${CMAKE_BINARY_DIR}/coverage/module_test)
+	SETUP_TARGET_FOR_COVERAGE(manifest_test_c manifest_test ${CMAKE_BINARY_DIR}/coverage/manifest_test)
+	SETUP_TARGET_FOR_COVERAGE(manifest_parser_test_c manifest_parser_test ${CMAKE_BINARY_DIR}/coverage/manifest_parser_test)
+	SETUP_TARGET_FOR_COVERAGE(framework_test_c framework_test ${CMAKE_BINARY_DIR}/coverage/framework_test)
+	SETUP_TARGET_FOR_COVERAGE(filter_test_c filter_test ${CMAKE_BINARY_DIR}/coverage/filter_test)
+	SETUP_TARGET_FOR_COVERAGE(capability_test_c capability_test ${CMAKE_BINARY_DIR}/coverage/capability_test)
+	SETUP_TARGET_FOR_COVERAGE(bundle_test_c bundle_test ${CMAKE_BINARY_DIR}/coverage/bundle_test)
+	SETUP_TARGET_FOR_COVERAGE(bundle_revision_test_c bundle_revision_test ${CMAKE_BINARY_DIR}/coverage/bundle_revision_test)
+	SETUP_TARGET_FOR_COVERAGE(bundle_context_test_c bundle_context_test ${CMAKE_BINARY_DIR}/coverage/bundle_context_test)
+	SETUP_TARGET_FOR_COVERAGE(bundle_cache_test_c bundle_cache_test ${CMAKE_BINARY_DIR}/coverage/bundle_cache_test)
+	SETUP_TARGET_FOR_COVERAGE(bundle_archive_test_c bundle_archive_test ${CMAKE_BINARY_DIR}/coverage/bundle_archive_test)
+	SETUP_TARGET_FOR_COVERAGE(attribute_test_c attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test)
+	
 endif (FRAMEWORK)

Added: incubator/celix/trunk/framework/private/mock/attribute_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/attribute_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/attribute_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/attribute_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,54 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * attribute_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "attribute.h"
+
+celix_status_t attribute_create(apr_pool_t *memory_pool, char * key, char * value, attribute_pt *attribute) {
+	mock_c()->actualCall("attribute_create")
+			->withPointerParameters("pool", memory_pool)
+			->withStringParameters("key", key)
+			->withStringParameters("value", value)
+			->_andPointerOutputParameters("attribute", attribute);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t attribute_getKey(attribute_pt attribute, char **key) {
+	mock_c()->actualCall("attribute_getKey")
+			->withPointerParameters("attribute", attribute)
+			->_andStringOutputParameters("key", key);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t attribute_getValue(attribute_pt attribute, char **value) {
+	mock_c()->actualCall("attribute_getValue")
+			->withPointerParameters("attribute", attribute)
+			->_andStringOutputParameters("value", value);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+

Added: incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,139 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * bundle_archive_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "bundle_archive.h"
+
+celix_status_t bundleArchive_create(char * archiveRoot, long id, char * location, char *inputFile, apr_pool_t *mp, bundle_archive_pt *bundle_archive) {
+	mock_c()->actualCall("bundleArchive_create")
+			->withStringParameters("archiveRoot", archiveRoot)
+			->withIntParameters("id", id)
+			->withStringParameters("location", location)
+			->withStringParameters("inputFile", inputFile)
+			->withPointerParameters("mp", mp)
+			->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_createSystemBundleArchive(apr_pool_t *mp, bundle_archive_pt *bundle_archive) {
+	mock_c()->actualCall("bundleArchive_createSystemBundleArchive")
+			->withPointerParameters("pool", mp)
+			->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_recreate(char * archiveRoot, apr_pool_t *mp, bundle_archive_pt *bundle_archive) {
+	mock_c()->actualCall("bundleArchive_recreate")
+			->withStringParameters("archiveRoot", archiveRoot)
+			->withPointerParameters("mp", mp)
+			->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getId(bundle_archive_pt archive, long *id) {
+	mock_c()->actualCall("bundleArchive_getId")
+			->withPointerParameters("archive", archive)
+			->_andIntOutputParameters("id", id);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getLocation(bundle_archive_pt archive, char **location) {
+	mock_c()->actualCall("bundleArchive_getLocation");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getArchiveRoot(bundle_archive_pt archive, char **archiveRoot) {
+	mock_c()->actualCall("bundleArchive_getArchiveRoot");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_revise(bundle_archive_pt archive, char * location, char *inputFile) {
+	mock_c()->actualCall("bundleArchive_revise");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_rollbackRevise(bundle_archive_pt archive, bool *rolledback) {
+	mock_c()->actualCall("bundleArchive_rollbackRevise");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getRevision(bundle_archive_pt archive, long revNr, bundle_revision_pt *revision) {
+	mock_c()->actualCall("bundleArchive_getRevision");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getCurrentRevision(bundle_archive_pt archive, bundle_revision_pt *revision) {
+	mock_c()->actualCall("bundleArchive_getCurrentRevision");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getCurrentRevisionNumber(bundle_archive_pt archive, long *revisionNumber) {
+	mock_c()->actualCall("bundleArchive_getCurrentRevisionNumber");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getRefreshCount(bundle_archive_pt archive, long *refreshCount) {
+	mock_c()->actualCall("bundleArchive_getRefreshCount");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_setRefreshCount(bundle_archive_pt archive) {
+	mock_c()->actualCall("bundleArchive_setRefreshCount");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_close(bundle_archive_pt archive) {
+	mock_c()->actualCall("bundleArchive_close");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_closeAndDelete(bundle_archive_pt archive) {
+	mock_c()->actualCall("bundleArchive_closeAndDelete");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_setLastModified(bundle_archive_pt archive, time_t lastModifiedTime) {
+	mock_c()->actualCall("bundleArchive_setLastModified");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getLastModified(bundle_archive_pt archive, time_t *lastModified) {
+	mock_c()->actualCall("bundleArchive_getLastModified");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_setPersistentState(bundle_archive_pt archive, bundle_state_e state) {
+	mock_c()->actualCall("bundleArchive_setPersistentState")
+			->withPointerParameters("archive", archive)
+			->withIntParameters("state", state);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleArchive_getPersistentState(bundle_archive_pt archive, bundle_state_e *state) {
+	mock_c()->actualCall("bundleArchive_getPersistentState");
+	return mock_c()->returnValue().value.intValue;
+}
+

Added: incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,52 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * bundle_cache_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "bundle_cache.h"
+
+celix_status_t bundleCache_create(properties_pt configurationMap, apr_pool_t *mp, bundle_cache_pt *bundle_cache) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleCache_getArchives(bundle_cache_pt cache, apr_pool_t *pool, array_list_pt *archives) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleCache_createArchive(bundle_cache_pt cache, apr_pool_t *bundlePool, long id, char * location, char *inputFile, bundle_archive_pt *archive) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleCache_delete(bundle_cache_pt cache) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+
+

Added: incubator/celix/trunk/framework/private/mock/bundle_context_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_context_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_context_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/bundle_context_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,180 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * bundle_context_mock.c
+ *
+ *  \date       Feb 6, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "bundle_context.h"
+
+celix_status_t bundleContext_create(framework_pt framework, bundle_pt bundle, bundle_context_pt *bundle_context) {
+	mock_c()->actualCall("bundleContext_create")
+			->withPointerParameters("framework", framework)
+			->withPointerParameters("bundle", bundle)
+			->_andPointerOutputParameters("bundle_context", (void **) bundle_context);
+	return mock_c()->returnValue().value.intValue;
+}
+celix_status_t bundleContext_destroy(bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleContext_getBundle(bundle_context_pt context, bundle_pt *bundle) {
+	mock_c()->actualCall("bundleContext_getBundle")
+			->withPointerParameters("context", context)
+			->_andPointerOutputParameters("bundle", (void **) bundle);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_getFramework(bundle_context_pt context, framework_pt *framework) {
+	mock_c()->actualCall("bundleContext_getFramework")
+			->withPointerParameters("context", context)
+			->_andPointerOutputParameters("framework", (void **) framework);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_getMemoryPool(bundle_context_pt context, apr_pool_t **memory_pool) {
+	mock_c()->actualCall("bundleContext_getMemoryPool")
+			->withPointerParameters("context", context)
+			->_andPointerOutputParameters("memory_pool", (void **) memory_pool);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_installBundle(bundle_context_pt context, char * location, bundle_pt *bundle) {
+	mock_c()->actualCall("bundleContext_installBundle")
+			->withPointerParameters("context", context)
+			->withStringParameters("location", location)
+			->_andPointerOutputParameters("bundle", (void **) bundle);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_installBundle2(bundle_context_pt context, char * location, char *inputFile, bundle_pt *bundle) {
+	mock_c()->actualCall("bundleContext_installBundle2")
+			->withPointerParameters("context", context)
+			->withStringParameters("location", location)
+			->withStringParameters("inputFile", inputFile)
+			->_andPointerOutputParameters("bundle", (void **) bundle);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_registerService(bundle_context_pt context, char * serviceName, void * svcObj,
+        properties_pt properties, service_registration_pt *service_registration) {
+	mock_c()->actualCall("bundleContext_registerService")
+			->withPointerParameters("context", context)
+			->withStringParameters("serviceName", serviceName)
+			->withPointerParameters("svcObj", svcObj)
+			->withPointerParameters("properties", properties)
+			->_andPointerOutputParameters("service_registration", (void **) service_registration);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, char * serviceName, service_factory_pt factory,
+        properties_pt properties, service_registration_pt *service_registration) {
+	mock_c()->actualCall("bundleContext_registerServiceFactory")
+			->withPointerParameters("context", context)
+			->withStringParameters("serviceName", serviceName)
+			->withPointerParameters("factory", factory)
+			->withPointerParameters("properties", properties)
+			->_andPointerOutputParameters("service_registration", (void **) service_registration);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_getServiceReferences(bundle_context_pt context, const char * serviceName, char * filter, array_list_pt *service_references) {
+	mock_c()->actualCall("bundleContext_getServiceReferences")
+			->withPointerParameters("context", context)
+			->withStringParameters("serviceName", serviceName)
+			->withStringParameters("filter", filter)
+			->_andPointerOutputParameters("service_references", (void **) service_references);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_getServiceReference(bundle_context_pt context, char * serviceName, service_reference_pt *service_reference) {
+	mock_c()->actualCall("bundleContext_getServiceReference")
+			->withPointerParameters("context", context)
+			->withStringParameters("serviceName", serviceName)
+			->_andPointerOutputParameters("service_reference", (void **) service_reference);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void **service_instance) {
+	mock_c()->actualCall("bundleContext_getService")
+			->withPointerParameters("context", context)
+			->withPointerParameters("reference", reference)
+			->_andPointerOutputParameters("service_instance", (void **) service_instance);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_ungetService(bundle_context_pt context, service_reference_pt reference, bool *result) {
+	mock_c()->actualCall("bundleContext_ungetService")
+			->withPointerParameters("context", context)
+			->withPointerParameters("reference", reference)
+			->_andIntOutputParameters("result", (int *) result);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_getBundles(bundle_context_pt context, array_list_pt *bundles) {
+	mock_c()->actualCall("bundleContext_getBundles");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, bundle_pt *bundle) {
+	mock_c()->actualCall("bundleContext_getBundleById");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, char * filter) {
+	mock_c()->actualCall("bundleContext_addServiceListener")
+		->withPointerParameters("context", context)
+		->withPointerParameters("listener", listener)
+		->withStringParameters("filter", filter);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_removeServiceListener(bundle_context_pt context, service_listener_pt listener) {
+	mock_c()->actualCall("bundleContext_removeServiceListener")
+		->withPointerParameters("context", context)
+		->withPointerParameters("listener", listener);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_addBundleListener(bundle_context_pt context, bundle_listener_pt listener) {
+	mock_c()->actualCall("bundleContext_addBundleListener");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleContext_removeBundleListener(bundle_context_pt context, bundle_listener_pt listener) {
+	mock_c()->actualCall("bundleContext_removeBundleListener");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundleContext_getProperty(bundle_context_pt context, const char *name, char **value) {
+	mock_c()->actualCall("bundleContext_getProperty");
+	return mock_c()->returnValue().value.intValue;
+}

Added: incubator/celix/trunk/framework/private/mock/bundle_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/bundle_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,228 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * bundle_mock.c
+ *
+ *  \date       Feb 7, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "bundle_private.h"
+
+celix_status_t bundle_create(bundle_pt * bundle, apr_pool_t *mp) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive, apr_pool_t *bundlePool) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_destroy(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_isSystemBundle(bundle_pt bundle, bool *systemBundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getArchive(bundle_pt bundle, bundle_archive_pt *archive) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getCurrentModule(bundle_pt bundle, module_pt *module) {
+	mock_c()->actualCall("bundle_getCurrentModule")
+		->withPointerParameters("bundle", bundle)
+		->_andPointerOutputParameters("module", (void **) module);
+	return mock_c()->returnValue().value.intValue;
+}
+
+array_list_pt bundle_getModules(bundle_pt bundle) {
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void * bundle_getHandle(bundle_pt bundle) {
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void bundle_setHandle(bundle_pt bundle, void * handle) {
+}
+
+activator_pt bundle_getActivator(bundle_pt bundle) {
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+celix_status_t bundle_setActivator(bundle_pt bundle, activator_pt activator) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getManifest(bundle_pt bundle, manifest_pt *manifest) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_setManifest(bundle_pt bundle, manifest_pt manifest) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getContext(bundle_pt bundle, bundle_context_pt *context) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_setContext(bundle_pt bundle, bundle_context_pt context) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getEntry(bundle_pt bundle, char * name, apr_pool_t *pool, char **entry) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_start(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_startWithOptions(bundle_pt bundle, int options) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_update(bundle_pt bundle, char *inputFile) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_stop(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_stopWithOptions(bundle_pt bundle, int options) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_uninstall(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_setState(bundle_pt bundle, bundle_state_e state) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_setPersistentStateInactive(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_setPersistentStateUninstalled(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+void uninstallBundle(bundle_pt bundle) {
+}
+
+
+celix_status_t bundle_revise(bundle_pt bundle, char * location, char *inputFile) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_addModule(bundle_pt bundle, module_pt module) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_closeModules(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+// Service Reference Functions
+array_list_pt getUsingBundles(service_reference_pt reference) {
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+
+int compareTo(service_reference_pt a, service_reference_pt b) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_getState(bundle_pt bundle, bundle_state_e *state) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_isLockable(bundle_pt bundle, bool *lockable) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getLockingThread(bundle_pt bundle, apr_os_thread_t *thread) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_lock(bundle_pt bundle, bool *locked) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_unlock(bundle_pt bundle, bool *unlocked) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_closeAndDelete(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_close(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_refresh(bundle_pt bundle) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getBundleId(bundle_pt bundle, long *id) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_getRegisteredServices(bundle_pt bundle, apr_pool_t *pool, array_list_pt *list) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getServicesInUse(bundle_pt bundle, array_list_pt *list) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_getMemoryPool(bundle_pt bundle, apr_pool_t **pool) {
+	mock_c()->actualCall("bundle_getMemoryPool")
+			->withPointerParameters("bundle", bundle)
+			->_andPointerOutputParameters("pool", (void **) pool);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t bundle_setFramework(bundle_pt bundle, framework_pt framework) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundle_getFramework(bundle_pt bundle, framework_pt *framework) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+

Added: incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,51 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * bundle_revision_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "bundle_revision.h"
+
+celix_status_t bundleRevision_create(apr_pool_t *pool, char *root, char *location, long revisionNr, char *inputFile, bundle_revision_pt *bundle_revision) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleRevision_getNumber(bundle_revision_pt revision, long *revisionNr) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleRevision_getLocation(bundle_revision_pt revision, char **location) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t bundleRevision_getRoot(bundle_revision_pt revision, char **root) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+

Added: incubator/celix/trunk/framework/private/mock/capability_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/capability_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/capability_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/capability_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,53 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * capability_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "capability.h"
+
+celix_status_t capability_create(apr_pool_t *pool, module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability) {
+	mock_c()->actualCall("capability_create");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t capability_getServiceName(capability_pt capability, char **serviceName) {
+	mock_c()->actualCall("capability_getServiceName");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t capability_getVersion(capability_pt capability, version_pt *version) {
+	mock_c()->actualCall("capability_getVersion")
+			->withPointerParameters("capability", capability)
+			->_andPointerOutputParameters("version", (void **) version);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t capability_getModule(capability_pt capability, module_pt *module) {
+	mock_c()->actualCall("capability_getModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+

Copied: incubator/celix/trunk/framework/private/mock/filter_mock.c (from r1528390, incubator/celix/trunk/framework/public/include/service_event.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/filter_mock.c?p2=incubator/celix/trunk/framework/private/mock/filter_mock.c&p1=incubator/celix/trunk/framework/public/include/service_event.h&r1=1528390&r2=1528394&rev=1528394&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_event.h (original)
+++ incubator/celix/trunk/framework/private/mock/filter_mock.c Wed Oct  2 09:16:54 2013
@@ -1,4 +1,4 @@
-/*
+/**
  *Licensed to the Apache Software Foundation (ASF) under one
  *or more contributor license agreements.  See the NOTICE file
  *distributed with this work for additional information
@@ -16,41 +16,29 @@
  *specific language governing permissions and limitations
  *under the License.
  */
-/**
- *
- * @defgroup ServiceListener Service Listener
- * @ingroup framework
- * @{
+/*
+ * filter_mock.c
  *
- *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
- *  \date      	January 11, 2012
- *  \copyright	Apache License, Version 2.0
+ *  \date       Feb 7, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
  */
-#ifndef SERVICE_EVENT_H_
-#define SERVICE_EVENT_H_
+#include "CppUTestExt/MockSupport_c.h"
 
-typedef enum serviceEventType service_event_type_e;
-typedef struct serviceEvent *service_event_pt;
+#include "filter.h"
 
-#include "service_reference.h"
+filter_pt filter_create(char * filterString, apr_pool_t *pool) {
+	return mock_c()->returnValue().value.pointerValue;
+}
 
-enum serviceEventType
-{
-	SERVICE_EVENT_REGISTERED = 0x00000001,
-	SERVICE_EVENT_MODIFIED = 0x00000002,
-	SERVICE_EVENT_UNREGISTERING = 0x00000004,
-	SERVICE_EVENT_MODIFIED_ENDMATCH = 0x00000008,
-};
-
-#include "service_reference.h"
-
-struct serviceEvent {
-	service_reference_pt reference;
-	service_event_type_e type;
-};
+void filter_destroy(filter_pt filter) {
 
-#endif /* SERVICE_EVENT_H_ */
+}
 
-/**
- * @}
- */
+celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *result) {
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t filter_getString(filter_pt filter, char **filterStr) {
+	return mock_c()->returnValue().value.intValue;
+}

Added: incubator/celix/trunk/framework/private/mock/framework_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/framework_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/framework_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/framework_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,296 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * framework_mock.c
+ *
+ *  \date       Feb 7, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "framework.h"
+
+celix_status_t framework_create(framework_pt *framework, apr_pool_t *memoryPool, properties_pt config) {
+	mock_c()->actualCall("framework_create");
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t framework_destroy(framework_pt framework) {
+	mock_c()->actualCall("framework_destroy");
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_init(framework_pt framework) {
+	mock_c()->actualCall("fw_init");
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t framework_start(framework_pt framework) {
+	mock_c()->actualCall("framework_start");
+		return mock_c()->returnValue().value.intValue;
+}
+
+void framework_stop(framework_pt framework) {
+	mock_c()->actualCall("framework_stop");
+}
+
+celix_status_t fw_getProperty(framework_pt framework, const char *name, char **value) {
+	mock_c()->actualCall("fw_getProperty")
+			->withPointerParameters("framework", framework)
+			->withStringParameters("name", name)
+			->_andStringOutputParameters("value", (const char **) value);
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_installBundle(framework_pt framework, bundle_pt * bundle, char * location, char *inputFile) {
+	mock_c()->actualCall("fw_installBundle")
+			->withPointerParameters("framework", framework)
+			->withStringParameters("location", location)
+			->withStringParameters("inputFile", inputFile)
+			->_andPointerOutputParameters("bundle", (void **) bundle);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_uninstallBundle(framework_pt framework, bundle_pt bundle) {
+	mock_c()->actualCall("fw_uninstallBundle")
+			->withPointerParameters("framework", framework)
+			->withPointerParameters("bundle", bundle);
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, apr_pool_t *pool, char **entry) {
+	mock_c()->actualCall("framework_getBundleEntry")
+			->withPointerParameters("framework", framework)
+			->withPointerParameters("bundle", bundle)
+			->withStringParameters("name", name)
+			->withPointerParameters("pool", pool)
+			->_andStringOutputParameters("entry", entry);
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t fw_startBundle(framework_pt framework, bundle_pt bundle, int options) {
+	mock_c()->actualCall("fw_startBundle")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withIntParameters("options", options);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t framework_updateBundle(framework_pt framework, bundle_pt bundle, char *inputFile) {
+	mock_c()->actualCall("framework_updateBundle")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withStringParameters("inputFile", inputFile);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_stopBundle(framework_pt framework, bundle_pt bundle, bool record) {
+	mock_c()->actualCall("fw_stopBundle")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withIntParameters("record", record);
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t fw_registerService(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, char * serviceName, void * svcObj, properties_pt properties) {
+	mock_c()->actualCall("fw_registerService")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withStringParameters("serviceName", serviceName)
+		->withPointerParameters("service", svcObj)
+		->withPointerParameters("properties", properties)
+		->_andPointerOutputParameters("registration", (void **) registration);
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, char * serviceName, service_factory_pt factory, properties_pt properties) {
+	mock_c()->actualCall("fw_registerServiceFactory")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withStringParameters("serviceName", serviceName)
+		->withPointerParameters("serviceFactory", factory)
+		->withPointerParameters("properties", properties)
+		->_andPointerOutputParameters("registration", (void **) registration);
+		return mock_c()->returnValue().value.intValue;
+}
+
+void fw_unregisterService(service_registration_pt registration) {
+	mock_c()->actualCall("fw_unregisterService");
+}
+
+
+celix_status_t fw_getServiceReferences(framework_pt framework, array_list_pt *references, bundle_pt bundle, const char * serviceName, char * filter) {
+	mock_c()->actualCall("fw_getServiceReferences")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withStringParameters("serviceName", serviceName)
+		->withStringParameters("filter", filter)
+		->_andPointerOutputParameters("references", (void **) references);
+		return mock_c()->returnValue().value.intValue;
+}
+
+void * fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference) {
+	mock_c()->actualCall("fw_getService")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withPointerParameters("reference", reference);
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+bool framework_ungetService(framework_pt framework, bundle_pt bundle, service_reference_pt reference) {
+	mock_c()->actualCall("framework_ungetService")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withPointerParameters("reference", reference);
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_getBundleRegisteredServices(framework_pt framework, apr_pool_t *pool, bundle_pt bundle, array_list_pt *services) {
+	mock_c()->actualCall("fw_getBundleRegisteredServices");
+		return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_getBundleServicesInUse(framework_pt framework, bundle_pt bundle, array_list_pt *services) {
+	mock_c()->actualCall("fw_getBundleServicesInUse");
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, char * filter) {
+	mock_c()->actualCall("fw_addServiceListener")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withPointerParameters("listener", listener)
+		->withStringParameters("filter", filter);
+}
+
+void fw_removeServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener) {
+	mock_c()->actualCall("fw_removeServiceListener")
+		->withPointerParameters("framework", framework)
+		->withPointerParameters("bundle", bundle)
+		->withPointerParameters("listener", listener);
+}
+
+
+celix_status_t fw_addBundleListener(framework_pt framework, bundle_pt bundle, bundle_listener_pt listener) {
+	mock_c()->actualCall("fw_addBundleListener")
+			->withPointerParameters("framework", framework)
+			->withPointerParameters("bundle", bundle)
+			->withPointerParameters("listener", listener);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t fw_removeBundleListener(framework_pt framework, bundle_pt bundle, bundle_listener_pt listener) {
+	mock_c()->actualCall("fw_removeBundleListener")
+			->withPointerParameters("framework", framework)
+			->withPointerParameters("bundle", bundle)
+			->withPointerParameters("listener", listener);
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+void fw_serviceChanged(framework_pt framework, service_event_type_e eventType, service_registration_pt registration, properties_pt oldprops) {
+	mock_c()->actualCall("fw_serviceChanged");
+}
+
+
+celix_status_t fw_isServiceAssignable(framework_pt fw, bundle_pt requester, service_reference_pt reference, bool *assignable) {
+	mock_c()->actualCall("fw_isServiceAssignable");
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+//bundle_archive_t fw_createArchive(long id, char * location) {
+
+//void revise(bundle_archive_t archive, char * location) {
+
+celix_status_t getManifest(bundle_archive_pt archive, apr_pool_t *pool, manifest_pt *manifest) {
+	mock_c()->actualCall("getManifest")
+			->withPointerParameters("archive", archive)
+			->withPointerParameters("pool", pool)
+			->_andPointerOutputParameters("manifest", (void **) manifest);
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+bundle_pt findBundle(bundle_context_pt context) {
+	mock_c()->actualCall("findBundle");
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+service_registration_pt findRegistration(service_reference_pt reference) {
+	mock_c()->actualCall("findRegistration");
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+
+service_reference_pt listToArray(array_list_pt list) {
+	mock_c()->actualCall("listToArray");
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+celix_status_t framework_markResolvedModules(framework_pt framework, hash_map_pt wires) {
+	mock_c()->actualCall("framework_markResolvedModules");
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+celix_status_t framework_waitForStop(framework_pt framework) {
+	mock_c()->actualCall("framework_waitForStop");
+		return mock_c()->returnValue().value.intValue;
+}
+
+
+array_list_pt framework_getBundles(framework_pt framework) {
+	mock_c()->actualCall("framework_getBundles")
+			->withPointerParameters("framework", framework);
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+bundle_pt framework_getBundle(framework_pt framework, char * location) {
+	mock_c()->actualCall("framework_getBundle");
+		return mock_c()->returnValue().value.pointerValue;
+}
+
+bundle_pt framework_getBundleById(framework_pt framework, long id) {
+	mock_c()->actualCall("framework_getBundleById")
+		->withPointerParameters("framework", framework)
+		->withIntParameters("id", id);
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+
+celix_status_t framework_getMemoryPool(framework_pt framework, apr_pool_t **pool) {
+	mock_c()->actualCall("framework_getMemoryPool")
+			->withPointerParameters("framework", framework)
+			->_andPointerOutputParameters("pool", (void **) pool);
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t framework_getFrameworkBundle(framework_pt framework, bundle_pt *bundle) {
+	mock_c()->actualCall("framework_getFrameworkBundle");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+
+

Added: incubator/celix/trunk/framework/private/mock/manifest_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/manifest_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/manifest_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/manifest_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,68 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * manifest_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "manifest.h"
+
+celix_status_t manifest_create(apr_pool_t *pool, manifest_pt *manifest) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifest_createFromFile(apr_pool_t *pool, char *filename, manifest_pt *manifest) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+void manifest_clear(manifest_pt manifest) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+}
+
+properties_pt manifest_getMainAttributes(manifest_pt manifest) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+celix_status_t manifest_getEntries(manifest_pt manifest, hash_map_pt *map) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifest_read(manifest_pt manifest, char *filename) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+void manifest_write(manifest_pt manifest, char * filename) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+}
+
+char * manifest_getValue(manifest_pt manifest, const char * name) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return (char *) mock_c()->returnValue().value.stringValue;
+}
+
+

Added: incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,57 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * manifest_parser_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "manifest_parser.h"
+
+celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, apr_pool_t *memory_pool, manifest_parser_pt *manifest_parser) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, apr_pool_t *pool, char **symbolicName) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, apr_pool_t *pool, version_pt *version) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *capabilities) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *requirements) {
+	mock_c()->actualCall("bundle_getCurrentModule");
+	return mock_c()->returnValue().value.intValue;
+}
+
+
+
+

Copied: incubator/celix/trunk/framework/private/mock/miniunz_mock.c (from r1528390, incubator/celix/trunk/framework/public/include/service_event.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/miniunz_mock.c?p2=incubator/celix/trunk/framework/private/mock/miniunz_mock.c&p1=incubator/celix/trunk/framework/public/include/service_event.h&r1=1528390&r2=1528394&rev=1528394&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_event.h (original)
+++ incubator/celix/trunk/framework/private/mock/miniunz_mock.c Wed Oct  2 09:16:54 2013
@@ -1,4 +1,4 @@
-/*
+/**
  *Licensed to the Apache Software Foundation (ASF) under one
  *or more contributor license agreements.  See the NOTICE file
  *distributed with this work for additional information
@@ -16,41 +16,23 @@
  *specific language governing permissions and limitations
  *under the License.
  */
-/**
- *
- * @defgroup ServiceListener Service Listener
- * @ingroup framework
- * @{
+/*
+ * miniunz_mock.c
  *
- *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
- *  \date      	January 11, 2012
- *  \copyright	Apache License, Version 2.0
+ *  \date       Feb 12, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
  */
-#ifndef SERVICE_EVENT_H_
-#define SERVICE_EVENT_H_
+#include "CppUTestExt/MockSupport_c.h"
 
-typedef enum serviceEventType service_event_type_e;
-typedef struct serviceEvent *service_event_pt;
+#include "archive.h"
 
-#include "service_reference.h"
+celix_status_t extractBundle(char * bundleName, char * revisionRoot) {
+	mock_c()->actualCall("extractBundle")
+			->withStringParameters("bundleName", bundleName)
+			->withStringParameters("revisionRoot", revisionRoot);
+	return mock_c()->returnValue().value.intValue;
+}
 
-enum serviceEventType
-{
-	SERVICE_EVENT_REGISTERED = 0x00000001,
-	SERVICE_EVENT_MODIFIED = 0x00000002,
-	SERVICE_EVENT_UNREGISTERING = 0x00000004,
-	SERVICE_EVENT_MODIFIED_ENDMATCH = 0x00000008,
-};
 
-#include "service_reference.h"
 
-struct serviceEvent {
-	service_reference_pt reference;
-	service_event_type_e type;
-};
-
-#endif /* SERVICE_EVENT_H_ */
-
-/**
- * @}
- */

Added: incubator/celix/trunk/framework/private/mock/module_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/module_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/module_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/module_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,147 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * module_mock.c
+ *
+ *  \date       Feb 11, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "module.h"
+
+module_pt module_create(manifest_pt headerMap, char * moduleId, bundle_pt bundle) {
+	mock_c()->actualCall("module_create")
+			->withPointerParameters("headerMap", headerMap)
+			->withStringParameters("moduleId", moduleId)
+			->withPointerParameters("bundle", bundle);
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+module_pt module_createFrameworkModule(bundle_pt bundle) {
+	mock_c()->actualCall("module_createFrameworkModule")
+			->withPointerParameters("bundle", bundle);
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void module_destroy(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+}
+
+unsigned int module_hash(void * module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.intValue;
+}
+
+int module_equals(void * module, void * compare) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.intValue;
+}
+
+wire_pt module_getWire(module_pt module, char * serviceName) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+version_pt module_getVersion(module_pt module) {
+	mock_c()->actualCall("module_getVersion")
+		->withPointerParameters("module", module);
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+celix_status_t module_getSymbolicName(module_pt module, char **symbolicName) {
+	mock_c()->actualCall("module_getSymbolicName")
+		->withPointerParameters("module", module)
+		->_andStringOutputParameters("symbolicName", symbolicName);
+	return mock_c()->returnValue().value.intValue;
+}
+
+char * module_getId(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return (char *) mock_c()->returnValue().value.stringValue;
+}
+
+linked_list_pt module_getWires(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void module_setWires(module_pt module, linked_list_pt wires) {
+	mock_c()->actualCall("requirement_create");
+}
+
+bool module_isResolved(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.intValue;
+}
+
+void module_setResolved(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+}
+
+bundle_pt module_getBundle(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+linked_list_pt module_getRequirements(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+linked_list_pt module_getCapabilities(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+array_list_pt module_getDependentImporters(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void module_addDependentImporter(module_pt module, module_pt importer) {
+	mock_c()->actualCall("requirement_create");
+}
+
+void module_removeDependentImporter(module_pt module, module_pt importer) {
+	mock_c()->actualCall("requirement_create");
+}
+
+array_list_pt module_getDependentRequirers(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void module_addDependentRequirer(module_pt module, module_pt requirer) {
+	mock_c()->actualCall("requirement_create");
+}
+
+void module_removeDependentRequirer(module_pt module, module_pt requirer) {
+	mock_c()->actualCall("requirement_create");
+}
+
+array_list_pt module_getDependents(module_pt module) {
+	mock_c()->actualCall("requirement_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+
+
+

Added: incubator/celix/trunk/framework/private/mock/properties_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/properties_mock.c?rev=1528394&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/mock/properties_mock.c (added)
+++ incubator/celix/trunk/framework/private/mock/properties_mock.c Wed Oct  2 09:16:54 2013
@@ -0,0 +1,71 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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.
+ */
+/*
+ * properties_mock.c
+ *
+ *  \date       Feb 7, 2013
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+#include "CppUTestExt/MockSupport_c.h"
+
+#include "properties.h"
+
+properties_pt properties_create(void) {
+	mock_c()->actualCall("properties_create");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void properties_destroy(properties_pt properties) {
+	mock_c()->actualCall("properties_destroy")
+			->withPointerParameters("properties", properties);
+}
+
+properties_pt properties_load(char * filename) {
+	mock_c()->actualCall("properties_load");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+void properties_store(properties_pt properties, char * file, char * header) {
+	mock_c()->actualCall("properties_store");
+}
+
+char * properties_get(properties_pt properties, char * key) {
+	mock_c()->actualCall("properties_get")
+			->withPointerParameters("properties", properties)
+			->withStringParameters("key", key);
+	return (char *) mock_c()->returnValue().value.stringValue;
+}
+
+char * properties_getWithDefault(properties_pt properties, char * key, char * defaultValue) {
+	mock_c()->actualCall("properties_getWithDefault");
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+char * properties_set(properties_pt properties, char * key, char * value) {
+	mock_c()->actualCall("properties_set")
+		->withPointerParameters("properties", properties)
+		->withStringParameters("key", key)
+		->withStringParameters("value", value);
+	return mock_c()->returnValue().value.pointerValue;
+}
+
+
+
+



Mime
View raw message