celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [06/60] [abbrv] [partial] celix git commit: CELIX-424: Cleans up the directory structure. Moves all libraries to the libs subdir and all bundles to the bundles subdir
Date Sun, 27 May 2018 18:52:14 GMT
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/test/service_registry_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_registry_test.cpp b/framework/private/test/service_registry_test.cpp
deleted file mode 100644
index 5adf4f6..0000000
--- a/framework/private/test/service_registry_test.cpp
+++ /dev/null
@@ -1,1112 +0,0 @@
-/**
- *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.
- */
-/*
- * service_registry_test.cpp
- *
- *  \date       Feb 7, 2013
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "CppUTest/TestHarness.h"
-#include "CppUTest/TestHarness_c.h"
-#include "CppUTest/CommandLineTestRunner.h"
-#include "CppUTestExt/MockSupport.h"
-#include "CppUTestExt/MockSupport_c.h"
-
-extern "C" {
-#include "constants.h"
-#include "listener_hook_service.h"
-#include "service_registry.h"
-#include "service_registry_private.h"
-#include "service_registration_private.h"
-#include "celix_log.h"
-
-framework_logger_pt logger = (framework_logger_pt) 0x42;
-
-void serviceRegistryTest_serviceChanged(framework_pt framework, service_event_type_e eventType, service_registration_pt registration, properties_pt oldprops) {
-	mock_c()->actualCall("serviceRegistryTest_serviceChanged")
-			->withPointerParameters("framework", framework)
-			->withIntParameters("eventType", eventType)
-			->withPointerParameters("registration", registration)
-			->withPointerParameters("oldprops", oldprops);
-}
-
-static char* my_strdup(const char* s) {
-	if (s == NULL) {
-		return NULL;
-	}
-
-	size_t len = strlen(s);
-
-	char *d = (char*) calloc(len + 1, sizeof(char));
-
-	if (d == NULL) {
-		return NULL;
-	}
-
-	strncpy(d, s, len);
-	return d;
-}
-
-static int registry_callback_t_isEqual(const void* object1, const void* object2)
-{
-	registry_callback_t callback1 = *(registry_callback_t*) object1;
-	registry_callback_t callback2 = *(registry_callback_t*) object2;
-	return 	callback1.getUsingBundles == callback2.getUsingBundles &&
-       		callback1.handle == callback2.handle &&
-       		callback1.modified == callback2.modified &&
-       		callback1.unregister == callback2.unregister;
-}
-
-static const char * registry_callback_t_toString(const void* object)
-{
-	char buff[512];
-	registry_callback_t callback = *(registry_callback_t*) object;
-	snprintf(buff, 512, "getUsingBudles: %p, handle: %p, modified: %p, unregister: %p", callback.getUsingBundles, callback.handle, callback.modified, callback.unregister);
-
-	return my_strdup(buff);
-}
-}
-
-int main(int argc, char** argv) {
-	mock_c()->installComparator("registry_callback_t", registry_callback_t_isEqual, registry_callback_t_toString);
-	int ret = RUN_ALL_TESTS(argc, argv);
-	mock_c()->removeAllComparatorsAndCopiers();
-	return ret;
-}
-
-TEST_GROUP(service_registry) {
-	void setup(void) {
-	}
-
-	void teardown() {
-		mock().checkExpectations();
-		mock().clear();
-	}
-};
-
-TEST(service_registry, create) {
-	framework_pt framework = (framework_pt) 0x10;
-	service_registry_pt registry = NULL;
-
-	serviceRegistry_create(framework, serviceRegistryTest_serviceChanged, &registry);
-
-	POINTERS_EQUAL(framework, registry->framework);
-	POINTERS_EQUAL(serviceRegistryTest_serviceChanged, registry->serviceChanged);
-	UNSIGNED_LONGS_EQUAL(1UL, registry->currentServiceId);
-	CHECK(registry->listenerHooks != NULL);
-	CHECK(registry->serviceReferences != NULL);
-	CHECK(registry->serviceRegistrations != NULL);
-
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getRegisteredServices) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	service_registration_pt reg = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	reg->serviceId = 10UL;
-	arrayList_add(registrations, reg);
-	bundle_pt bundle = (bundle_pt) 0x20;
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	hash_map_pt usages = hashMap_create(NULL, NULL, NULL, NULL);
-	service_reference_pt ref = (service_reference_pt) 0x30;
-	hashMap_put(usages, (void*)reg->serviceId, ref);
-	hashMap_put(registry->serviceReferences, bundle, usages);
-
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", reg)
-		.andReturnValue(true);
-	mock()
-		.expectOneCall("serviceReference_retain")
-		.withParameter("ref", ref);
-
-	array_list_pt services = NULL;
-	serviceRegistry_getRegisteredServices(registry, bundle, &services);
-	LONGS_EQUAL(1, arrayList_size(services));
-	POINTERS_EQUAL(ref, arrayList_get(services, 0));
-
-	arrayList_destroy(services);
-	arrayList_destroy(registrations);
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	serviceRegistry_destroy(registry);
-	free(reg);
-	hashMap_destroy(usages, false, false);
-}
-
-TEST(service_registry, getServicesInUse) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	hash_map_pt usages = hashMap_create(NULL, NULL, NULL, NULL);
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_reference_pt ref = (service_reference_pt) 0x20;
-	service_registration_pt reg = (service_registration_pt) 0x30;
-	hashMap_put(usages, reg, ref);
-	hashMap_put(registry->serviceReferences, bundle, usages);
-
-	array_list_pt inUse = NULL;
-	serviceRegistry_getServicesInUse(registry, bundle, &inUse);
-	LONGS_EQUAL(1, arrayList_size(inUse));
-	POINTERS_EQUAL(ref, arrayList_get(inUse, 0));
-
-	arrayList_destroy(inUse);
-	serviceRegistry_destroy(registry);
-	hashMap_destroy(usages, false, false);
-}
-
-TEST(service_registry, registerServiceNoProps) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	char * serviceName = my_strdup("service");
-	void *service = (void *) 0x20;
-	service_registration_pt reg = (service_registration_pt) 0x30;
-
-	mock()
-		.expectOneCall("serviceRegistration_create")
-		.withParameterOfType("registry_callback_t", "callback", &registry->callback)
-		.withParameter("bundle", bundle)
-		.withParameter("serviceName", serviceName)
-		.withParameter("serviceId", 2)
-		.withParameter("serviceObject", service)
-		.withParameter("dictionary", (void *) NULL)
-		.andReturnValue(reg);
-
-	mock().expectOneCall("serviceRegistryTest_serviceChanged")
-			.withParameter("framework", framework)
-			.withParameter("eventType", OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED)
-			.withParameter("registration", reg)
-			.withParameter("oldprops", (void*)NULL);
-
-	service_registration_pt registration = NULL;
-	serviceRegistry_registerService(registry, bundle, serviceName, service, NULL, &registration);
-	POINTERS_EQUAL(reg, registration);
-
-	array_list_pt destroy_this = (array_list_pt) hashMap_remove(registry->serviceRegistrations, bundle);
-	arrayList_destroy(destroy_this);
-	serviceRegistry_destroy(registry);
-	free(serviceName);
-}
-
-TEST(service_registry, registerServiceFactoryNoProps) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	char * serviceName = my_strdup("service");
-	service_factory_pt factory = (service_factory_pt) malloc(sizeof(*factory));
-	factory->handle = (void*) 0x20;
-	service_registration_pt reg = (service_registration_pt) 0x40;
-
-	mock()
-		.expectOneCall("serviceRegistration_createServiceFactory")
-		.withParameterOfType("registry_callback_t", "callback", &registry->callback)
-		.withParameter("bundle", bundle)
-		.withParameter("serviceName", serviceName)
-		.withParameter("serviceId", 2)
-		.withParameter("serviceObject", factory)
-		.withParameter("dictionary", (void *) NULL)
-		.andReturnValue(reg);
-
-	mock().expectOneCall("serviceRegistryTest_serviceChanged")
-		.withParameter("framework", framework)
-		.withParameter("eventType", OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED)
-		.withParameter("registration", reg)
-		.withParameter("oldprops", (void*)NULL);
-
-	service_registration_pt registration = NULL;
-	serviceRegistry_registerServiceFactory(registry, bundle, serviceName, factory, NULL, &registration);
-	POINTERS_EQUAL(reg, registration);
-
-	array_list_pt destroy_this = (array_list_pt) hashMap_remove(registry->serviceRegistrations, bundle);
-	arrayList_destroy(destroy_this);
-	serviceRegistry_destroy(registry);
-	free(serviceName);
-	free(factory);
-}
-
-TEST(service_registry, registerServiceListenerHook) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	char * serviceName = my_strdup(OSGI_FRAMEWORK_LISTENER_HOOK_SERVICE_NAME);
-	void *service = (void *) 0x20;
-	service_registration_pt reg = (service_registration_pt) 0x30;
-
-	mock()
-		.expectOneCall("serviceRegistration_create")
-		.withParameterOfType("registry_callback_t", "callback", &registry->callback)
-		.withParameter("bundle", bundle)
-		.withParameter("serviceName", serviceName)
-		.withParameter("serviceId", 2)
-		.withParameter("serviceObject", service)
-		.withParameter("dictionary", (void *) NULL)
-		.andReturnValue(reg);
-
-	mock().expectOneCall("serviceRegistryTest_serviceChanged")
-			.withParameter("framework", framework)
-			.withParameter("eventType", OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED)
-			.withParameter("registration", reg)
-			.withParameter("oldprops", (void*)NULL);
-
-	service_registration_pt registration = NULL;
-	serviceRegistry_registerService(registry, bundle, serviceName, service, NULL, &registration);
-	POINTERS_EQUAL(reg, registration);
-	LONGS_EQUAL(1, arrayList_size(registry->listenerHooks));
-	POINTERS_EQUAL(reg, arrayList_get(registry->listenerHooks, 0));
-
-	//cleanup
-	array_list_pt destroy_this = (array_list_pt) hashMap_remove(registry->serviceRegistrations, bundle);
-	arrayList_destroy(destroy_this);
-	arrayList_remove(registry->listenerHooks, 0);
-	serviceRegistry_destroy(registry);
-	free(serviceName);
-}
-
-TEST(service_registry, unregisterService) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	arrayList_add(registrations, registration);
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-	service_reference_pt reference = (service_reference_pt) 0x30;
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-
-	hashMap_put(references, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-	properties_pt properties = (properties_pt) 0x40;
-
-	mock()
-		.expectOneCall("serviceRegistration_getProperties")
-		.withParameter("registration", registration)
-		.withOutputParameterReturning("properties", &properties, sizeof(properties))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("properties_get")
-		.withParameter("properties", properties)
-		.withParameter("key", (char *)OSGI_FRAMEWORK_OBJECTCLASS)
-		.andReturnValue((char*)OSGI_FRAMEWORK_LISTENER_HOOK_SERVICE_NAME);
-
-	mock()
-		.expectOneCall("serviceRegistryTest_serviceChanged")
-		.withParameter("framework", framework)
-		.withParameter("eventType", OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING)
-		.withParameter("registration", registration)
-		.withParameter("oldprops", (void*) NULL);
-	mock()
-		.expectOneCall("serviceReference_invalidate")
-		.withParameter("reference", reference);
-
-		mock()
-		.expectOneCall("serviceRegistration_invalidate")
-		.withParameter("registration", registration);
-
-	mock()
-		.expectOneCall("serviceRegistration_release")
-		.withParameter("registration", registration);
-
-
-
-	serviceRegistry_unregisterService(registry, bundle, registration);
-	hashMap_destroy(references, false,false);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, clearServiceRegistrations){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	service_registration_pt reg = (service_registration_pt) 0x10;
-	arrayList_add(registrations, reg);
-	bundle_pt bundle = (bundle_pt) 0x20;
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	//removing the first registration
-	char *serviceName = (char *) "test_service";
-	mock()
-		.expectOneCall("serviceRegistration_getServiceName")
-		.withParameter("registration", reg)
-		.withOutputParameterReturning("serviceName", &serviceName, sizeof(serviceName))
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("framework_log");
-
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", reg)
-		.andReturnValue(true);
-
-	//this call normally removes the registration from registry->serviceRegistrations
-	//but it remains since the mock does not call the callback->unregister therefore it acts like 2 separate registrations
-	mock().expectOneCall("serviceRegistration_unregister")
-			.withParameter("registration", reg);
-
-	//removing the "second" registration
-	mock()
-		.expectOneCall("serviceRegistration_getServiceName")
-		.withParameter("registration", reg)
-		.withOutputParameterReturning("serviceName", &serviceName, sizeof(serviceName))
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("framework_log");
-
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", reg)
-		.andReturnValue(false);
-
-	serviceRegistry_clearServiceRegistrations(registry, bundle);
-
-	//clean up
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	arrayList_destroy(registrations);
-
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getServiceReference){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-	service_reference_pt reference = (service_reference_pt) 0x50;
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	mock().expectOneCall("serviceReference_retain")
-			.withParameter("ref", reference);
-
-	service_reference_pt get_reference;
-	celix_status_t status = serviceRegistry_getServiceReference(registry, bundle, registration, &get_reference);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(reference, get_reference);
-
-	hashMap_destroy(references, false, false);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getServiceReference_unknownRef){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-	service_reference_pt reference = (service_reference_pt) 0x50;
-
-	//test getting ref from bundle without refs
-	mock().expectOneCall("serviceRegistration_getBundle")
-				.withParameter("registration", registration)
-				.withOutputParameterReturning("bundle", &bundle, sizeof(bundle));
-
-	mock().expectOneCall("serviceReference_create")
-			.withParameter("referenceOwner", bundle)
-			.withParameter("registration", registration)
-			.withOutputParameterReturning("reference", &reference, sizeof(reference))
-			.ignoreOtherParameters();
-
-
-	service_reference_pt get_reference;
-	celix_status_t status = serviceRegistry_getServiceReference(registry, bundle, registration, &get_reference);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(reference, get_reference);
-
-	//cleanup
-	hash_map_pt del = (hash_map_pt) hashMap_remove(registry->serviceReferences, bundle);
-	hashMap_destroy(del, false, false);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getServiceReferences) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	arrayList_add(registrations, registration);
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	properties_pt properties = (properties_pt) 0x30;
-	filter_pt filter = (filter_pt) 0x40;
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	service_reference_pt reference = (service_reference_pt) 0x50;
-	hashMap_put(references, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	mock()
-		.expectOneCall("serviceRegistration_retain")
-		.withParameter("registration", registration);
-
-	mock()
-		.expectOneCall("serviceRegistration_getProperties")
-		.withParameter("registration", registration)
-		.withOutputParameterReturning("properties", &properties, sizeof(properties))
-		.andReturnValue(CELIX_SUCCESS);
-	bool matchResult = true;
-	mock().expectNCalls(2, "filter_match")
-		.withParameter("filter", filter)
-		.withParameter("properties", properties)
-		.withOutputParameterReturning("result", &matchResult, sizeof(matchResult));
-	char *serviceName = (char *) "test";
-	mock()
-		.expectOneCall("serviceRegistration_getServiceName")
-		.withParameter("registration", registration)
-		.withOutputParameterReturning("serviceName", &serviceName, sizeof(serviceName))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", registration)
-		.andReturnValue(true);
-
-	mock()
-		.expectOneCall("serviceReference_retain")
-		.withParameter("ref", reference);
-
-	mock()
-		.expectOneCall("serviceRegistration_release")
-		.withParameter("registration", registration);
-
-	array_list_pt actual  = NULL;
-
-	serviceRegistry_getServiceReferences(registry, bundle, "test", filter, &actual);
-	LONGS_EQUAL(1, arrayList_size(actual));
-	POINTERS_EQUAL(reference, arrayList_get(actual, 0));
-
-	hashMap_destroy(references, false, false);
-	arrayList_destroy(actual);
-	arrayList_destroy(registrations);
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getServiceReferences_noFilterOrName) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	arrayList_add(registrations, registration);
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	properties_pt properties = (properties_pt) 0x30;
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	service_reference_pt reference = (service_reference_pt) 0x50;
-	hashMap_put(references, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	mock()
-		.expectOneCall("serviceRegistration_retain")
-		.withParameter("registration", registration);
-
-	mock()
-		.expectOneCall("serviceRegistration_getProperties")
-		.withParameter("registration", registration)
-		.withOutputParameterReturning("properties", &properties, sizeof(properties))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", registration)
-		.andReturnValue(true);
-
-	mock()
-		.expectOneCall("serviceReference_retain")
-		.withParameter("ref", reference);
-
-	mock()
-		.expectOneCall("serviceRegistration_release")
-		.withParameter("registration", registration);
-
-	array_list_pt actual  = NULL;
-
-	serviceRegistry_getServiceReferences(registry, bundle, NULL, NULL, &actual);
-	LONGS_EQUAL(1, arrayList_size(actual));
-	POINTERS_EQUAL(reference, arrayList_get(actual, 0));
-
-	hashMap_destroy(references, false, false);
-	arrayList_destroy(actual);
-	arrayList_destroy(registrations);
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, retainServiceReference){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	service_reference_pt reference = (service_reference_pt) 0x10;
-	bundle_pt bundle = (bundle_pt) 0x20;
-	bundle_pt bundle2 = (bundle_pt) 0x30;
-
-	//test unknown reference (reference not present in registry->deletedServiceReferences)
-	mock().expectOneCall("framework_log");
-
-	serviceRegistry_retainServiceReference(registry, bundle, reference);
-
-	//test known reference, but owner != bundle
-	registry->checkDeletedReferences = false;
-
-	mock().expectOneCall("serviceReference_getOwner")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("owner", &bundle2, sizeof(bundle2));
-	mock().expectOneCall("framework_log");
-
-	serviceRegistry_retainServiceReference(registry, bundle, reference);
-
-	registry->checkDeletedReferences = true;
-	//test known reference, with owner == bundle
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) false);
-	mock().expectOneCall("serviceReference_getOwner")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("owner", &bundle, sizeof(bundle));
-	mock().expectOneCall("serviceReference_retain")
-			.withParameter("ref", reference);
-
-	serviceRegistry_retainServiceReference(registry, bundle, reference);
-
-	//cleanup
-	hashMap_remove(registry->deletedServiceReferences, reference);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, ungetServiceReference){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	service_registration_pt registration = (service_registration_pt) 0x10;
-	service_registration_pt registration2 = (service_registration_pt) 0x20;
-	service_registration_pt registration3 = (service_registration_pt) 0x30;
-	service_reference_pt reference = (service_reference_pt) 0x40;
-	service_reference_pt reference2 = (service_reference_pt) 0x50;
-	service_reference_pt reference3 = (service_reference_pt) 0x60;
-	bundle_pt bundle = (bundle_pt) 0x70;
-	bundle_pt bundle2 = (bundle_pt) 0x80;
-    module_pt module = (module_pt) 0x90;
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, registration, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	hash_map_pt references2 = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references2, registration3, reference3);
-	hashMap_put(registry->serviceReferences, bundle2, references2);
-
-	//test unknown reference (reference not present in registry->deletedServiceReferences)
-	mock().expectOneCall("framework_log");
-
-	serviceRegistry_ungetServiceReference(registry, bundle, reference);
-
-	//test known reference, but destroyed == false
-	size_t count = 0;
-	bool destroyed = false;
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) false);
-
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &count, sizeof(count));
-	mock().expectOneCall("serviceReference_release")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-
-	serviceRegistry_ungetServiceReference(registry, bundle, reference);
-
-	//test known reference, destroyed == true, but wrong bundle (cannot find reference in bundle->refsMap)
-	destroyed = true;
-
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &count, sizeof(count));
-	mock().expectOneCall("serviceReference_release")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-	mock().expectOneCall("framework_log");
-
-	serviceRegistry_ungetServiceReference(registry, bundle2, reference);
-
-	//test known reference, destroyed == true, but count > 0
-	destroyed = true;
-	count = 5;
-
-    const char* mod_name = "mod name";
-    //const char* srv_name = "srv name";
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &count, sizeof(count));
-	mock().expectOneCall("serviceReference_release")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-    mock().expectNCalls(1, "bundle_getCurrentModule")
-            .withParameter("bundle", bundle)
-			.withOutputParameterReturning("module", &module, sizeof(module));
-    mock().expectNCalls(1, "module_getSymbolicName")
-            .withParameter("module", module)
-			.withOutputParameterReturning("symbolicName", &mod_name, sizeof(mod_name));
-	mock().expectNCalls(2, "framework_log");
-
-	serviceRegistry_ungetServiceReference(registry, bundle, reference);
-
-	CHECK((bool)hashMap_remove(registry->deletedServiceReferences, reference));
-
-	//test known reference2, destroyed == true, and count == 0
-	references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, registration, reference);
-	hashMap_put(references, registration2, reference2);
-	hashMap_put(registry->serviceReferences, bundle, references);
-	hashMap_put(registry->deletedServiceReferences, reference2, (void*) false);
-	destroyed = true;
-	count = 0;
-
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference2)
-			.withOutputParameterReturning("count", &count, sizeof(count));
-	mock().expectOneCall("serviceReference_release")
-			.withParameter("ref", reference2)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-
-	serviceRegistry_ungetServiceReference(registry, bundle, reference2);
-
-	CHECK((bool)hashMap_remove(registry->deletedServiceReferences, reference2));//check that ref2 deleted == true
-	POINTERS_EQUAL(reference, hashMap_remove(references, registration)); //check that ref1 is untouched
-
-	//cleanup
-	hashMap_remove(references2, registration3);
-	hashMap_destroy(references, false, false);
-	hashMap_destroy(references2, false, false);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, clearReferencesFor_1){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	service_registration_pt registration = (service_registration_pt) 0x10;
-	service_reference_pt reference = (service_reference_pt) 0x40;
-	bundle_pt bundle = (bundle_pt) 0x70;
-	//module_pt module = (module_pt) 0x80;
-	//const char* modName = "mod name";
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, registration, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	size_t useCount = 0;
-	size_t refCount = 0;
-	bool destroyed = true;
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) false);
-
-	//expected calls for removing reference1
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &useCount, sizeof(useCount));
-	mock().expectOneCall("serviceReference_getReferenceCount")
-				.withParameter("reference", reference)
-				.withOutputParameterReturning("count", &refCount, sizeof(refCount));
-	mock().expectOneCall("serviceReference_release")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-
-	serviceRegistry_clearReferencesFor(registry, bundle);
-
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, clearReferencesFor_2){
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	service_registration_pt registration = (service_registration_pt) 0x10;
-	service_reference_pt reference = (service_reference_pt) 0x40;
-	bundle_pt bundle = (bundle_pt) 0x70;
-	module_pt module = (module_pt) 0x80;
-	const char* modName = "mod name";
-    const char* srvName = "srv name";
-
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, registration, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	//expected calls for removing reference2 (including count error logging)
-	size_t useCount = 1;
-	size_t refCount = 1;
-    bool destroyed = true;
-	mock().expectOneCall("serviceReference_getUsageCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &useCount, sizeof(useCount));
-	mock().expectOneCall("serviceReference_getReferenceCount")
-			.withParameter("reference", reference)
-			.withOutputParameterReturning("count", &refCount, sizeof(refCount));
-	mock().expectNCalls(2, "framework_log");
-	size_t updatedUseCount = 0;
-	mock().expectOneCall("serviceReference_decreaseUsage")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("updatedCount", &updatedUseCount, sizeof(updatedUseCount));
-	mock().expectNCalls(1, "serviceReference_release")
-			.withParameter("ref", reference)
-			.withOutputParameterReturning("destroyed", &destroyed, sizeof(destroyed));
-	mock().expectNCalls(2, "bundle_getCurrentModule")
-			.withParameter("bundle", bundle)
-			.withOutputParameterReturning("module", &module, sizeof(module));
-	mock().expectNCalls(2, "module_getSymbolicName")
-			.withParameter("module", module)
-			.withOutputParameterReturning("symbolicName", &modName, sizeof(modName));
-    mock().expectOneCall("serviceReference_getProperty")
-            .withParameter("reference", reference)
-            .withParameter("key", OSGI_FRAMEWORK_OBJECTCLASS)
-			.withOutputParameterReturning("value", &srvName, sizeof(srvName));
-    mock().expectOneCall("serviceReference_getServiceRegistration")
-            .withParameter("reference", reference)
-			.withOutputParameterReturning("registration", &registration, sizeof(registration));
-    mock().expectOneCall("serviceRegistration_getBundle")
-            .withParameter("registration", registration)
-			.withOutputParameterReturning("bundle", &bundle, sizeof(bundle));
-	mock().expectOneCall("framework_log");
-
-	serviceRegistry_clearReferencesFor(registry, bundle);
-
-	serviceRegistry_destroy(registry);
-}
-
-
-TEST(service_registry, getService) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) 0x20;
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	arrayList_add(registrations, registration);
-
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	service_reference_pt reference = (service_reference_pt) 0x40;
-
-	void * service = (void *) 0x60;
-
-	//test invalid reference
-	mock().expectOneCall("framework_log");
-
-
-	const void *actual = (void*) 0x666;//generic non null pointer value
-	celix_status_t status = serviceRegistry_getService(registry, bundle, reference, &actual);
-	LONGS_EQUAL(CELIX_BUNDLE_EXCEPTION, status);
-	//test reference with invalid registration
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) false);
-
-	mock()
-		.expectOneCall("serviceReference_getServiceRegistration")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("registration", &registration, sizeof(registration))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", registration)
-		.andReturnValue(false);
-
-	actual = (void*) 0x666;//generic non null pointer value
-	serviceRegistry_getService(registry, bundle, reference, &actual);
-	POINTERS_EQUAL(NULL, actual);
-
-	//test reference with valid registration
-	mock()
-		.expectOneCall("serviceReference_getServiceRegistration")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("registration", &registration, sizeof(registration))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("serviceRegistration_isValid")
-		.withParameter("registration", registration)
-		.andReturnValue(true);
-
-	int count = 1;
-	mock()
-		.expectOneCall("serviceReference_increaseUsage")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("updatedCount", &count, sizeof(count));
-
-	mock()
-		.expectOneCall("serviceRegistration_getService")
-		.withParameter("registration", registration)
-		.withParameter("bundle", bundle)
-		.withOutputParameterReturning("service", &service, sizeof(service))
-		.andReturnValue(true);
-
-	mock()
-		.expectOneCall("serviceReference_setService")
-		.withParameter("ref", reference)
-		.withParameter("service", service);
-
-	mock()
-		.expectOneCall("serviceReference_getService")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("service", &service, sizeof(service));
-
-	actual = NULL;
-	serviceRegistry_getService(registry, bundle, reference, &actual);
-	POINTERS_EQUAL(service, actual);
-
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	arrayList_destroy(registrations);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, ungetService) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) 0x20;
-	array_list_pt registrations = NULL;
-	arrayList_create(&registrations);
-	arrayList_add(registrations, registration);
-
-	hashMap_put(registry->serviceRegistrations, bundle, registrations);
-
-	service_reference_pt reference = (service_reference_pt) 0x40;
-
-	array_list_pt usages = NULL;
-	arrayList_create(&usages);
-	hashMap_put(registry->serviceReferences, bundle, reference);
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) false);
-	void * service = (void*) 0x50;
-
-	int count = 0;
-	mock()
-		.expectOneCall("serviceReference_decreaseUsage")
-		.withParameter("ref", reference)
-		.withOutputParameterReturning("updatedCount", &count, sizeof(count));
-
-	mock()
-		.expectOneCall("serviceReference_getService")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("service", &service, sizeof(service));
-
-	mock()
-		.expectOneCall("serviceReference_getServiceRegistration")
-		.withParameter("reference", reference)
-		.withOutputParameterReturning("registration", &registration, sizeof(registration));
-
-	mock()
-		.expectOneCall("serviceRegistration_ungetService")
-		.withParameter("registration", registration)
-		.withParameter("bundle", bundle)
-		.withOutputParameterReturning("service", &service, sizeof(service));
-
-	bool result = false;
-	celix_status_t status;
-	status = serviceRegistry_ungetService(registry, bundle, reference, &result);
-	LONGS_EQUAL(CELIX_SUCCESS, status)
-	LONGS_EQUAL(true, result);
-
-	hashMap_remove(registry->deletedServiceReferences, reference);
-	hashMap_put(registry->deletedServiceReferences, reference, (void*) true);
-
-	mock()
-		.expectOneCall("framework_log");
-
-	status = serviceRegistry_ungetService(registry, bundle, reference, &result);
-	LONGS_EQUAL(CELIX_BUNDLE_EXCEPTION, status);
-
-
-	arrayList_destroy(registrations);
-	hashMap_remove(registry->serviceRegistrations, bundle);
-	serviceRegistry_destroy(registry);
-	arrayList_destroy(usages);
-}
-
-TEST(service_registry, getListenerHooks) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-	bundle_pt bundle = (bundle_pt) 0x10;
-	service_registration_pt registration = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	registration->serviceId = 20UL;
-	arrayList_add(registry->listenerHooks, registration);
-
-	hash_map_pt usages = hashMap_create(NULL, NULL, NULL, NULL);
-	service_reference_pt reference = (service_reference_pt) 0x30;
-	hashMap_put(usages, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, usages);
-
-	mock()
-		.expectOneCall("serviceRegistration_retain")
-		.withParameter("registration", registration);
-	mock()
-		.expectOneCall("serviceReference_retain")
-		.withParameter("ref", reference);
-	mock()
-		.expectOneCall("serviceRegistration_release")
-		.withParameter("registration", registration);
-
-	array_list_pt hooks = NULL;
-	serviceRegistry_getListenerHooks(registry, bundle, &hooks);
-	LONGS_EQUAL(1, arrayList_size(hooks));
-	POINTERS_EQUAL(reference, arrayList_get(hooks, 0));
-
-	hashMap_destroy(usages, false, false);
-	arrayList_destroy(hooks);
-	arrayList_remove(registry->listenerHooks, 0);
-	free(registration);
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, servicePropertiesModified) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-	service_registration_pt registration = (service_registration_pt) 0x02;
-	properties_pt properties = (properties_pt) 0x03;
-
-	mock().expectOneCall("serviceRegistryTest_serviceChanged")
-		.withParameter("framework", registry->framework)
-		.withParameter("eventType", OSGI_FRAMEWORK_SERVICE_EVENT_MODIFIED)
-		.withParameter("registration", registration)
-		.withParameter("oldprops", properties);
-
-	serviceRegistry_servicePropertiesModified(registry, registration, properties);
-
-	serviceRegistry_destroy(registry);
-}
-
-TEST(service_registry, getUsingBundles) {
-	service_registry_pt registry = NULL;
-	framework_pt framework = (framework_pt) 0x01;
-	serviceRegistry_create(framework,serviceRegistryTest_serviceChanged, &registry);
-
-	service_registration_pt registration  = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	service_registration_pt registration2 = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	service_registration_pt registration3 = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-	service_registration_pt registration4 = (service_registration_pt) calloc(1,sizeof(struct serviceRegistration));
-
-	registration->serviceId  = 10UL;
-	registration2->serviceId = 20UL;
-	registration3->serviceId = 30UL;
-	registration4->serviceId = 40UL;
-
-	service_reference_pt reference = (service_reference_pt) 0x50;
-	service_reference_pt reference2 = (service_reference_pt) 0x60;
-	service_reference_pt reference3 = (service_reference_pt) 0x70;
-	service_reference_pt reference4 = (service_reference_pt) 0x80;
-	service_reference_pt reference5 = (service_reference_pt) 0x90;
-
-	bundle_pt bundle = (bundle_pt) 0xA0;
-	bundle_pt bundle2 = (bundle_pt) 0xB0;
-	bundle_pt bundle3 = (bundle_pt) 0xC0;
-
-	//only contains registration1
-	hash_map_pt references = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references, (void*)registration->serviceId, reference);
-	hashMap_put(registry->serviceReferences, bundle, references);
-
-	//contains registration1 and one other
-	hash_map_pt references2 = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references2, (void*)registration->serviceId, reference2);
-	hashMap_put(references2, (void*)registration2->serviceId, reference3);
-	hashMap_put(registry->serviceReferences, bundle2, references2);
-
-	//contains 2 registrations, but not registration1
-	hash_map_pt references3 = hashMap_create(NULL, NULL, NULL, NULL);
-	hashMap_put(references3, (void*)registration3->serviceId, reference4);
-	hashMap_put(references3, (void*)registration4->serviceId, reference5);
-	hashMap_put(registry->serviceReferences, bundle3, references3);
-
-	//call to getUsingBundles
-	array_list_pt get_bundles_list = NULL;
-	registry->callback.getUsingBundles(registry, registration, &get_bundles_list);
-
-	//check that both bundle1 and bundle2 have been found
-	LONGS_EQUAL(2, arrayList_size(get_bundles_list));
-	bundle_pt get_bundle = (bundle_pt) arrayList_get(get_bundles_list, 0);
-	if (get_bundle == bundle){
-		get_bundle = (bundle_pt) arrayList_get(get_bundles_list, 1);
-		POINTERS_EQUAL(bundle2, get_bundle);
-	} else {
-		POINTERS_EQUAL(bundle2, get_bundle);
-		get_bundle = (bundle_pt) arrayList_get(get_bundles_list, 1);
-		POINTERS_EQUAL(bundle, get_bundle);
-	}
-
-	//cleanup
-	arrayList_destroy(get_bundles_list);
-
-	hashMap_destroy(references, false, false);
-	hashMap_destroy(references2, false, false);
-	hashMap_destroy(references3, false, false);
-	serviceRegistry_destroy(registry);
-
-   free(registration);
-   free(registration2);
-   free(registration3);
-   free(registration4);
-
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/test/service_tracker_customizer_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_tracker_customizer_test.cpp b/framework/private/test/service_tracker_customizer_test.cpp
deleted file mode 100644
index a80cd29..0000000
--- a/framework/private/test/service_tracker_customizer_test.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- *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.
- */
-/*
- * service_tracker_customizer_test.cpp
- *
- *  \date       Feb 7, 2013
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#include <stdlib.h>
-//#include <stdio.h>
-
-#include "CppUTest/TestHarness.h"
-#include "CppUTest/TestHarness_c.h"
-#include "CppUTest/CommandLineTestRunner.h"
-#include "CppUTestExt/MockSupport.h"
-
-extern "C"
-{
-#include "service_tracker_customizer_private.h"
-#include "service_reference.h"
-#include "celix_log.h"
-
-framework_logger_pt logger;
-}
-
-int main(int argc, char** argv) {
-	return RUN_ALL_TESTS(argc, argv);
-}
-
-TEST_GROUP(service_tracker_customizer) {
-	void setup(void) {
-	}
-
-	void teardown() {
-		mock().checkExpectations();
-		mock().clear();
-	}
-};
-
-extern "C" {
-	celix_status_t serviceTrackerCustomizerTest_addingService(void*, service_reference_pt, void** ) {
-		return CELIX_SUCCESS;
-	}
-	celix_status_t serviceTrackerCustomizerTest_addedService(void*, service_reference_pt, void*) {
-		return CELIX_SUCCESS;
-	}
-	celix_status_t serviceTrackerCustomizerTest_modifiedService(void*, service_reference_pt, void*) {
-		return CELIX_SUCCESS;
-	}
-	celix_status_t serviceTrackerCustomizerTest_removedService(void*, service_reference_pt, void*) {
-		return CELIX_SUCCESS;
-	}
-}
-
-TEST(service_tracker_customizer, create) {
-	void *handle = (void *) 0x10;
-	service_tracker_customizer_pt customizer = NULL;
-	celix_status_t status = serviceTrackerCustomizer_create(
-			handle,
-			serviceTrackerCustomizerTest_addingService,
-			serviceTrackerCustomizerTest_addedService,
-			serviceTrackerCustomizerTest_modifiedService,
-			serviceTrackerCustomizerTest_removedService, &customizer);
-
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(handle, customizer->handle);
-	POINTERS_EQUAL(serviceTrackerCustomizerTest_addingService, customizer->addingService);
-	POINTERS_EQUAL(serviceTrackerCustomizerTest_addedService, customizer->addedService);
-	POINTERS_EQUAL(serviceTrackerCustomizerTest_modifiedService, customizer->modifiedService);
-	POINTERS_EQUAL(serviceTrackerCustomizerTest_removedService, customizer->removedService);
-
-	serviceTrackerCustomizer_destroy(customizer);
-}
-
-TEST(service_tracker_customizer, createIllegalArgument) {
-	mock().expectOneCall("framework_logCode").withParameter("code", CELIX_ILLEGAL_ARGUMENT);
-
-	service_tracker_customizer_pt customizer = NULL;
-	celix_status_t status = serviceTrackerCustomizer_create(
-			NULL,
-			serviceTrackerCustomizerTest_addingService,
-			serviceTrackerCustomizerTest_addedService,
-			serviceTrackerCustomizerTest_modifiedService,
-			serviceTrackerCustomizerTest_removedService, &customizer);
-
-	LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, status);
-}
-
-TEST(service_tracker_customizer, getHandle) {
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) malloc(sizeof(*customizer));
-	void *handle = (void *) 0x10;
-	customizer->handle = handle;
-
-	void *getHandle = NULL;
-	celix_status_t status = serviceTrackerCustomizer_getHandle(customizer, &getHandle);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(handle, getHandle);
-
-	free(customizer);
-}
-
-TEST(service_tracker_customizer, getAddingFunction) {
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) malloc(sizeof(*customizer));
-	adding_callback_pt adding = (adding_callback_pt) 0x11;
-	customizer->addingService = adding;
-
-	adding_callback_pt getAdding = NULL;
-	celix_status_t status = serviceTrackerCustomizer_getAddingFunction(customizer, &getAdding);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(adding, getAdding);
-
-	free(customizer);
-}
-
-TEST(service_tracker_customizer, getAddedFunction) {
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) malloc(sizeof(*customizer));
-	added_callback_pt added = (added_callback_pt) 0x11;
-	customizer->addedService = added;
-
-	added_callback_pt getAdded = NULL;
-	celix_status_t status = serviceTrackerCustomizer_getAddedFunction(customizer, &getAdded);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(added, getAdded);
-
-	free(customizer);
-}
-
-TEST(service_tracker_customizer, getModifiedFunction) {
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) malloc(sizeof(*customizer));
-	modified_callback_pt modified = (modified_callback_pt) 0x11;
-	customizer->modifiedService = modified;
-
-	modified_callback_pt getModified = NULL;
-	celix_status_t status = serviceTrackerCustomizer_getModifiedFunction(customizer, &getModified);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(modified, getModified);
-
-	free(customizer);
-}
-
-TEST(service_tracker_customizer, getRemovedFunction) {
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) malloc(sizeof(*customizer));
-	removed_callback_pt removed = (removed_callback_pt) 0x11;
-	customizer->removedService = removed;
-
-	removed_callback_pt getRemoved = NULL;
-	celix_status_t status = serviceTrackerCustomizer_getRemovedFunction(customizer, &getRemoved);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(removed, getRemoved);
-
-	free(customizer);
-}
-

http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/test/service_tracker_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_tracker_test.cpp b/framework/private/test/service_tracker_test.cpp
deleted file mode 100644
index 45898a1..0000000
--- a/framework/private/test/service_tracker_test.cpp
+++ /dev/null
@@ -1,1074 +0,0 @@
-/**
- *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.
- */
-/*
- * service_tracker_test.cpp
- *
- *  \date       Feb 6, 2013
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "CppUTest/TestHarness.h"
-#include "CppUTest/TestHarness_c.h"
-#include "CppUTest/CommandLineTestRunner.h"
-#include "CppUTestExt/MockSupport.h"
-
-extern "C"
-{
-#include "service_tracker_private.h"
-#include "service_reference_private.h"
-#include "celix_log.h"
-
-framework_logger_pt logger = (framework_logger_pt) 0x42;
-}
-
-int main(int argc, char** argv) {
-	return RUN_ALL_TESTS(argc, argv);
-}
-
-static char* my_strdup(const char* s) {
-	if (s == NULL) {
-		return NULL;
-	}
-
-	size_t len = strlen(s);
-
-	char *d = (char*) calloc(len + 1, sizeof(char));
-
-	if (d == NULL) {
-		return NULL;
-	}
-
-	strncpy(d, s, len);
-	return d;
-}
-
-TEST_GROUP(service_tracker) {
-	void setup(void) {
-	}
-
-	void teardown() {
-		mock().checkExpectations();
-		mock().clear();
-	}
-};
-
-TEST(service_tracker, create) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	char * service = my_strdup("service");
-	status = serviceTracker_create(context, service, NULL, &tracker);
-
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(context, tracker->context);
-	POINTERS_EQUAL(NULL, tracker->customizer);
-	POINTERS_EQUAL(NULL, tracker->listener);
-	POINTERS_EQUAL(tracker, tracker->tracker);
-	STRCMP_EQUAL("(objectClass=service)", tracker->filter);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-}
-
-TEST(service_tracker, createWithCustomizer) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	char * service = my_strdup("service");
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	status = serviceTracker_create(context, service, customizer, &tracker);
-
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(context, tracker->context);
-	POINTERS_EQUAL(customizer, tracker->customizer);
-	POINTERS_EQUAL(NULL, tracker->listener);
-	POINTERS_EQUAL(tracker, tracker->tracker);
-	STRCMP_EQUAL("(objectClass=service)", tracker->filter);
-
-	mock().expectOneCall("serviceTrackerCustomizer_destroy")
-			.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-}
-
-TEST(service_tracker, createWithFilter) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	char * filter = my_strdup("(objectClass=test)");
-	status = serviceTracker_createWithFilter(context, filter, NULL, &tracker);
-
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(context, tracker->context);
-	POINTERS_EQUAL(NULL, tracker->customizer);
-	POINTERS_EQUAL(NULL, tracker->listener);
-	POINTERS_EQUAL(tracker, tracker->tracker);
-	STRCMP_EQUAL("(objectClass=test)", tracker->filter);
-
-	serviceTracker_destroy(tracker);
-	free(filter);
-}
-
-TEST(service_tracker, createWithFilterWithCustomizer) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	char * filter = my_strdup("(objectClass=test)");
-	status = serviceTracker_createWithFilter(context, filter, customizer, &tracker);
-
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	POINTERS_EQUAL(context, tracker->context);
-	POINTERS_EQUAL(customizer, tracker->customizer);
-	POINTERS_EQUAL(NULL, tracker->listener);
-	POINTERS_EQUAL(tracker, tracker->tracker);
-	STRCMP_EQUAL("(objectClass=test)", tracker->filter);
-
-	mock().expectOneCall("serviceTrackerCustomizer_destroy")
-			.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(filter);
-}
-
-TEST(service_tracker, destroy) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	char * filter = my_strdup("(objectClass=test)");
-	status = serviceTracker_createWithFilter(context, filter, NULL, &tracker);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	service_listener_pt listener = (service_listener_pt) calloc(1, sizeof(serviceListener));
-	tracker->listener = listener;
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	status = serviceTracker_destroy(tracker);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	free(filter);
-}
-
-TEST(service_tracker, open) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * filter = my_strdup("(objectClass=service)");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_createWithFilter(context, filter, NULL, &tracker);
-
-	array_list_pt refs = NULL;
-	arrayList_create(&refs);
-
-	mock().strictOrder();
-	mock()
-		.expectOneCall("bundleContext_getServiceReferences")
-		.withParameter("context", context)
-		.withParameter("serviceName", (char *) NULL)
-		.withParameter("filter", "(objectClass=service)")
-		.withOutputParameterReturning("service_references", &refs, sizeof(refs));
-	mock()
-		.expectOneCall("bundleContext_addServiceListener")
-		.withParameter("context", context)
-		.withParameter("filter", "(objectClass=service)")
-		.ignoreOtherParameters();
-	serviceTracker_open(tracker);
-	CHECK(tracker->listener != NULL);
-
-	// No services should be found
-	LONGS_EQUAL(0, arrayList_size(tracker->trackedServices));
-
-	mock().expectOneCall("bundleContext_removeServiceListener")
-			.withParameter("context", context)
-			.ignoreOtherParameters();
-
-	serviceTracker_destroy(tracker);
-	free(filter);
-}
-
-TEST(service_tracker, open_withRefs) {
-	celix_status_t status;
-	service_tracker_pt tracker = NULL;
-	bundle_context_pt context = (bundle_context_pt) 0x123;
-	char * filter = my_strdup("(objectClass=test)");
-	status = serviceTracker_createWithFilter(context, filter, NULL, &tracker);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-	tracker->listener = NULL;
-
-	array_list_pt refs = NULL;
-	arrayList_create(&refs);
-	service_reference_pt ref = (service_reference_pt) malloc(sizeof(*ref));
-	arrayList_add(refs, ref);
-	void *src = (void *) 0x345;
-
-	mock()
-		.expectOneCall("bundleContext_getServiceReferences")
-		.withParameter("context", context)
-		.withParameter("serviceName", (char *) NULL)
-		.withParameter("filter", filter)
-		.withOutputParameterReturning("service_references", &refs, sizeof(refs));
-	mock()
-		.expectOneCall("bundleContext_addServiceListener")
-		.withParameter("context", context)
-		.withParameter("filter", filter)
-		.ignoreOtherParameters();
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	mock()
-		.expectOneCall("bundleContext_getService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("service_instance", &src, sizeof(src));
-	serviceTracker_open(tracker);
-
-	CHECK(tracker->listener != NULL);
-	tracked_pt get_tracked = (tracked_pt) arrayList_get(tracker->trackedServices, 0);
-	POINTERS_EQUAL(src, get_tracked->service);
-	POINTERS_EQUAL(ref, get_tracked->reference);
-
-
-	// One service should be found
-	LONGS_EQUAL(1, arrayList_size(tracker->trackedServices));
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.ignoreOtherParameters();
-
-	serviceTracker_destroy(tracker);
-	free(ref);
-	free(get_tracked);
-	free(filter);
-}
-
-TEST(service_tracker, open_withRefsAndTracked) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	service_reference_pt ref = (service_reference_pt) 0x02;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	array_list_pt refs = NULL;
-	arrayList_create(&refs);
-	arrayList_add(refs, ref);
-
-	mock()
-		.expectOneCall("bundleContext_getServiceReferences")
-		.withParameter("context", context)
-		.withParameter("serviceName", (char *) NULL)
-		.withParameter("filter", "(objectClass=service_name)")
-		.withOutputParameterReturning("service_references", &refs, sizeof(refs));
-	mock()
-		.expectOneCall("bundleContext_addServiceListener")
-		.withParameter("context", context)
-		.withParameter("filter", "(objectClass=service_name)")
-		.ignoreOtherParameters();
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_open(tracker);
-	CHECK(tracker->listener != NULL);
-
-	// One service should be found
-	LONGS_EQUAL(1, arrayList_size(tracker->trackedServices));
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.ignoreOtherParameters();
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(service);
-}
-
-TEST(service_tracker, close) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	service_reference_pt ref = (service_reference_pt) 0x02;
-
-	tracker->listener = listener;
-
-	entry->service = (void *) 0x03;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.andReturnValue(CELIX_SUCCESS);
-	bool result = true;
-	mock()
-		.expectOneCall("bundleContext_ungetService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("result", &result, sizeof(result))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("bundleContext_ungetServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-
-	celix_status_t status;
-
-	status = serviceTracker_close(tracker);
-	LONGS_EQUAL(CELIX_SUCCESS, status);
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-}
-
-TEST(service_tracker, getServiceReference) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-	service_reference_pt reference = (service_reference_pt) 0x02;
-	service_reference_pt reference2 = (service_reference_pt) 0x03;
-	service_reference_pt get_reference;
-	tracked_pt tracked = (tracked_pt) malloc(sizeof(*tracked));
-	tracked_pt tracked2 = (tracked_pt) malloc(sizeof(*tracked2));
-
-	tracked->reference = reference;
-	tracked2->reference = reference2;
-	arrayList_add(tracker->trackedServices, tracked);
-	arrayList_add(tracker->trackedServices, tracked2);
-
-	get_reference = serviceTracker_getServiceReference(tracker);
-
-	//test for either of the references
-	if(get_reference != reference && get_reference != reference2){
-		FAIL("unknown reference");
-	}
-
-	serviceTracker_destroy(tracker);
-	free(service);
-	free(tracked);
-	free(tracked2);
-}
-
-TEST(service_tracker, getServiceReferenceNull) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	service_reference_pt reference = serviceTracker_getServiceReference(tracker);
-	POINTERS_EQUAL(NULL, reference);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-}
-
-TEST(service_tracker, getServiceReferences) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-	service_reference_pt reference = (service_reference_pt) 0x02;
-	service_reference_pt reference2 = (service_reference_pt) 0x03;
-	service_reference_pt get_reference;
-	tracked_pt tracked = (tracked_pt) malloc(sizeof(*tracked));
-	tracked_pt tracked2 = (tracked_pt) malloc(sizeof(*tracked2));
-	array_list_pt get_references;
-
-	tracked->reference = reference;
-	tracked2->reference = reference2;
-	arrayList_add(tracker->trackedServices, tracked);
-	arrayList_add(tracker->trackedServices, tracked2);
-
-	get_references = serviceTracker_getServiceReferences(tracker);
-
-	//test for the references, in no specific order
-	get_reference = (service_reference_pt) arrayList_get(get_references, 0);
-	if(get_reference == reference){
-		get_reference = (service_reference_pt) arrayList_get(get_references, 1);
-		POINTERS_EQUAL(reference2, get_reference);
-	} else {
-		POINTERS_EQUAL(reference2, get_reference);
-		get_reference = (service_reference_pt) arrayList_get(get_references, 1);
-		POINTERS_EQUAL(reference, get_reference);
-	}
-
-	arrayList_destroy(get_references);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-	free(tracked);
-	free(tracked2);
-}
-
-TEST(service_tracker, getService) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	service_reference_pt ref = (service_reference_pt) 0x02;
-	entry->reference = ref;
-	void * actual_service = (void*) 0x32;
-	entry->service = actual_service;
-	arrayList_add(tracker->trackedServices, entry);
-	tracked_pt entry2 = (tracked_pt) malloc(sizeof(*entry));
-	service_reference_pt ref2 = (service_reference_pt) 0x52;
-	entry2->reference = ref2;
-	arrayList_add(tracker->trackedServices, entry2);
-
-	void *get_service = serviceTracker_getService(tracker);
-	POINTERS_EQUAL(actual_service, get_service);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(entry2);
-	free(service);
-}
-
-TEST(service_tracker, getServiceNull) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	void * get_service = serviceTracker_getService(tracker);
-	POINTERS_EQUAL(NULL, get_service);
-
-	serviceTracker_destroy(tracker);
-	free(service);
-}
-
-TEST(service_tracker, getServices) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-	tracked_pt entry2 = (tracked_pt) malloc(sizeof(*entry));
-	entry2->service = (void *) 0x32;
-	service_reference_pt ref2 = (service_reference_pt) 0x52;
-	entry2->reference = ref2;
-	arrayList_add(tracker->trackedServices, entry2);
-
-	array_list_pt services = serviceTracker_getServices(tracker);
-	LONGS_EQUAL(2, arrayList_size(services));
-	POINTERS_EQUAL(0x31, arrayList_get(services, 0));
-	POINTERS_EQUAL(0x32, arrayList_get(services, 1));
-
-	arrayList_destroy(services);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(entry2);
-	free(service);
-}
-
-TEST(service_tracker, getServiceByReference) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.andReturnValue(4);
-		//.ignoreOtherParameters();
-	void * get_service = serviceTracker_getServiceByReference(tracker, ref);
-	POINTERS_EQUAL(0x31, get_service);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(service);
-}
-
-TEST(service_tracker, getServiceByReferenceNull) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	bool equal = false;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.ignoreOtherParameters()
-		.andReturnValue(CELIX_SUCCESS)
-		.withCallOrder(1);
-	void * get_service = serviceTracker_getServiceByReference(tracker, ref);
-	POINTERS_EQUAL(NULL, get_service);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(service);
-}
-
-TEST(service_tracker, serviceChangedRegistered) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	service_reference_pt ref = (service_reference_pt) 0x51;
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED;
-	event->reference = ref;
-
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	void *src = (void *) 0x345;
-	mock()
-		.expectOneCall("bundleContext_getService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("service_instance", &src, sizeof(src))
-		.andReturnValue(CELIX_SUCCESS);
-	serviceTracker_serviceChanged(listener, event);
-
-	tracked_pt get_tracked = (tracked_pt) arrayList_get(tracker->trackedServices, 0);
-	POINTERS_EQUAL(src, get_tracked->service);
-	POINTERS_EQUAL(ref, get_tracked->reference);
-
-	//cleanup
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_destroy(tracker);
-	free(get_tracked);
-	free(event);
-	free(service);
-}
-
-TEST(service_tracker, serviceChangedModified) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_MODIFIED;
-	event->reference = ref;
-
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.ignoreOtherParameters()
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_serviceChanged(listener, event);
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(event);
-	free(service);
-}
-
-TEST(service_tracker, serviceChangedUnregistering) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING;
-	event->reference = ref;
-
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.andReturnValue(CELIX_SUCCESS);
-	bool result = true;
-	mock()
-		.expectOneCall("bundleContext_ungetService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("result", &result, sizeof(result))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("bundleContext_ungetServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-
-	serviceTracker_serviceChanged(listener, event);
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_destroy(tracker);
-	free(event);
-	free(service);
-}
-
-TEST(service_tracker, serviceChangedModifiedEndmatch) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	serviceTracker_create(context, service, NULL, &tracker);
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_MODIFIED_ENDMATCH;
-	event->reference = ref;
-
-	serviceTracker_serviceChanged(listener, event);
-
-	//cleanup
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(event);
-	free(service);
-}
-
-extern "C" {
-	celix_status_t serviceDependency_addingService(void * handle, service_reference_pt reference, void **service) {
-		*service = (void*) 0x45;
-		return CELIX_SUCCESS;
-	}
-
-	celix_status_t serviceDependency_addedService(void * handle, service_reference_pt reference, void *service) {
-		return CELIX_SUCCESS;
-	}
-}
-
-TEST(service_tracker, serviceChangedRegisteredCustomizer) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	serviceTracker_create(context, service, customizer, &tracker);
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	service_reference_pt ref = (service_reference_pt) 0x51;
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED;
-	event->reference = ref;
-
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	void * handle = (void*) 0x60;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getHandle")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("handle", &handle, sizeof(handle))
-		.andReturnValue(CELIX_SUCCESS);
-	void *function = (void *) serviceDependency_addingService;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getAddingFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &function, sizeof(function))
-		.andReturnValue(CELIX_SUCCESS);
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getHandle")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("handle", &handle, sizeof(handle))
-		.andReturnValue(CELIX_SUCCESS);
-	void *function2 = (void *) serviceDependency_addedService;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getAddedFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &function2, sizeof(function))
-		.andReturnValue(CELIX_SUCCESS);
-	serviceTracker_serviceChanged(listener, event);
-
-	tracked_pt get_tracked = (tracked_pt) arrayList_get(tracker->trackedServices, 0);
-	POINTERS_EQUAL(0x45, get_tracked->service);
-	POINTERS_EQUAL(ref, get_tracked->reference);
-
-	//cleanup
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_destroy")
-		.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(get_tracked);
-	free(event);
-	free(service);
-}
-
-
-extern "C" {
-	celix_status_t serviceDependency_modifiedService(void * handle, service_reference_pt reference, void * service) {
-		return CELIX_SUCCESS;
-	}
-}
-
-TEST(service_tracker, serviceChangedModifiedCustomizer) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	serviceTracker_create(context, service, customizer, &tracker);
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-	//adding_callback_pt adding_func = NULL;
-	//added_callback_pt added_func = NULL;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_MODIFIED;
-	event->reference = ref;
-
-	bool equal = true;
-	mock()
-		.expectOneCall("bundleContext_retainServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.ignoreOtherParameters()
-		.andReturnValue(CELIX_SUCCESS);
-	void * handle = (void*) 0x60;
-
-/*	this branch is not covered here, unlike earlier faulty tests
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getHandle")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("handle", &handle, sizeof(handle))
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getAddingFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &adding_func, sizeof(adding_func))
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getAddedFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &added_func, sizeof(added_func));
-
-	mock()
-		.expectOneCall("bundleContext_getService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("service_instance", &entry->service, sizeof(entry->service));
-*/
-
-	mock()
-			.expectOneCall("serviceTrackerCustomizer_getHandle")
-			.withParameter("customizer", customizer)
-			.withOutputParameterReturning("handle", &handle, sizeof(handle))
-			.andReturnValue(CELIX_SUCCESS);
-
-
-	void *function = (void *) serviceDependency_modifiedService;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getModifiedFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &function, sizeof(function))
-		.andReturnValue(CELIX_SUCCESS);
-
-	serviceTracker_serviceChanged(listener, event);
-
-	//cleanup
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_destroy")
-		.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(entry);
-	free(event);
-	free(service);
-}
-
-extern "C" {
-	celix_status_t serviceDependency_removedService(void * handle, service_reference_pt reference, void * service) {
-		return CELIX_SUCCESS;
-	}
-}
-
-TEST(service_tracker, serviceChangedUnregisteringCustomizer) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	serviceTracker_create(context, service, customizer, &tracker);
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING;
-	event->reference = ref;
-
-	bool equal = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equal, sizeof(equal))
-		.andReturnValue(CELIX_SUCCESS);
-	void * handle = (void*) 0x60;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getHandle")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("handle", &handle, sizeof(handle))
-		.andReturnValue(CELIX_SUCCESS);
-	void *function = (void*) serviceDependency_removedService;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getRemovedFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &function , sizeof(function))
-		.andReturnValue(CELIX_SUCCESS);
-
-	bool result = true;
-	mock()
-		.expectOneCall("bundleContext_ungetService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("result", &result, sizeof(result));
-	mock()
-		.expectOneCall("bundleContext_ungetServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-
-	serviceTracker_serviceChanged(listener, event);
-
-	//clean up
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_destroy")
-		.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(event);
-	free(service);
-}
-
-TEST(service_tracker, serviceChangedUnregisteringCustomizerNoFunc) {
-	bundle_context_pt context= (bundle_context_pt) 0x01;
-	char * service = my_strdup("service_name");
-	service_tracker_pt tracker = NULL;
-	service_tracker_customizer_pt customizer = (service_tracker_customizer_pt) 0x20;
-	serviceTracker_create(context, service, customizer, &tracker);
-	service_listener_pt listener = (service_listener_pt) malloc(sizeof(*listener));
-	tracker->listener = listener;
-	listener->handle = tracker;
-
-	tracked_pt entry = (tracked_pt) malloc(sizeof(*entry));
-	entry->service = (void *) 0x31;
-	service_reference_pt ref = (service_reference_pt) 0x51;
-	entry->reference = ref;
-	arrayList_add(tracker->trackedServices, entry);
-
-	service_event_pt event = (service_event_pt) malloc(sizeof(*event));
-	event->type = OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING;
-	event->reference = ref;
-
-	bool equals = true;
-	mock()
-		.expectOneCall("serviceReference_equals")
-		.withParameter("reference", ref)
-		.withParameter("compareTo", ref)
-		.withOutputParameterReturning("equal", &equals, sizeof(equals));
-	void * handle = (void*) 0x60;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getHandle")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("handle", &handle, sizeof(handle));
-	void *function = NULL;
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_getRemovedFunction")
-		.withParameter("customizer", customizer)
-		.withOutputParameterReturning("function", &function, sizeof(function));
-	bool result = true;
-	mock()
-		.expectOneCall("bundleContext_ungetService")
-		.withParameter("context", context)
-		.withParameter("reference", ref)
-		.withOutputParameterReturning("result", &result, sizeof(result));
-	mock()
-		.expectOneCall("bundleContext_ungetServiceReference")
-		.withParameter("context", context)
-		.withParameter("reference", ref);
-
-	serviceTracker_serviceChanged(listener, event);
-
-	mock()
-		.expectOneCall("bundleContext_removeServiceListener")
-		.withParameter("context", context)
-		.withParameter("listener", listener)
-		.andReturnValue(CELIX_SUCCESS);
-
-	mock()
-		.expectOneCall("serviceTrackerCustomizer_destroy")
-		.withParameter("customizer", customizer);
-
-	serviceTracker_destroy(tracker);
-	free(event);
-	free(service);
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/test/wire_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/wire_test.cpp b/framework/private/test/wire_test.cpp
deleted file mode 100644
index bbcf579..0000000
--- a/framework/private/test/wire_test.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- *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.
- */
-/*
- * wire_test.cpp
- *
- *  \date       Sep 25, 2015
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-#include "CppUTest/TestHarness.h"
-#include "CppUTest/TestHarness_c.h"
-#include "CppUTest/CommandLineTestRunner.h"
-#include "CppUTestExt/MockSupport.h"
-
-extern "C"
-{
-#include "celix_log.h"
-#include "celix_errno.h"
-
-#include "wire.h"
-#include "module.h"
-#include "requirement.h"
-#include "capability.h"
-
-framework_logger_pt logger = (framework_logger_pt) 0x42;
-}
-
-int main(int argc, char** argv) {
-	return RUN_ALL_TESTS(argc, argv);
-}
-
-TEST_GROUP(wire) {
-
-	void setup(void) {
-	}
-
-	void teardown() {
-		mock().checkExpectations();
-		mock().clear();
-	}
-};
-
-
-TEST(wire, create) {
-	mock().expectOneCall("framework_logCode").withParameter("code", CELIX_ILLEGAL_ARGUMENT);
-
-    module_pt module = (module_pt) 0x01;
-    capability_pt cap = (capability_pt) 0x02;
-    requirement_pt req = (requirement_pt) 0x03;
-    wire_pt wire = NULL;
-
-    LONGS_EQUAL(CELIX_SUCCESS, wire_create(module, req, module, cap, &wire));
-
-    LONGS_EQUAL(CELIX_ILLEGAL_ARGUMENT, wire_create(module, req, module, cap, &wire));
-
-    LONGS_EQUAL(CELIX_SUCCESS, wire_destroy(wire));
-}
-
-TEST(wire, get){
-    module_pt importer = (module_pt) 0x01;
-    module_pt exporter = (module_pt) 0x02;
-    capability_pt cap = (capability_pt) 0x03;
-    requirement_pt req = (requirement_pt) 0x04;
-    void * get;
-
-    wire_pt wire = NULL;
-
-    wire_create(importer, req, exporter, cap, &wire);
-
-    wire_getImporter(wire, (module_pt*)&get);
-	POINTERS_EQUAL(importer, get);
-
-    wire_getExporter(wire, (module_pt*)&get);
-	POINTERS_EQUAL(exporter, get);
-
-    wire_getCapability(wire, (capability_pt*)&get);
-	POINTERS_EQUAL(cap, get);
-
-    wire_getRequirement(wire, (requirement_pt*)&get);
-	POINTERS_EQUAL(req, get);
-
-	wire_destroy(wire);
-}


Mime
View raw message