You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/05/27 18:52:18 UTC
[10/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
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/bundle_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/bundle_mock.c b/framework/private/mock/bundle_mock.c
deleted file mode 100644
index 8ab5068..0000000
--- a/framework/private/mock/bundle_mock.c
+++ /dev/null
@@ -1,294 +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.
- */
-/*
- * bundle_mock.c
- *
- * \date Feb 7, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include <CppUTestExt/MockSupport_c.h>
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "bundle_private.h"
-
-celix_status_t bundle_create(bundle_pt * bundle) {
- mock_c()->actualCall("bundle_create")
- ->withOutputParameter("bundle", bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive) {
- mock_c()->actualCall("bundle_createFromArchive")
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("archive", archive);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_destroy(bundle_pt bundle) {
- mock_c()->actualCall("destroy");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_isSystemBundle(bundle_pt bundle, bool *systemBundle) {
- mock_c()->actualCall("bundle_isSystembundle")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("systemBundle", systemBundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getArchive(bundle_pt bundle, bundle_archive_pt *archive) {
- mock_c()->actualCall("bundle_getArchive");
- 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)
- ->withOutputParameter("module", (void **) module);
- return mock_c()->returnValue().value.intValue;
-}
-
-array_list_pt bundle_getModules(bundle_pt bundle) {
- mock_c()->actualCall("bundle_getModules");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void * bundle_getHandle(bundle_pt bundle) {
- mock_c()->actualCall("bundle_getHandle");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void bundle_setHandle(bundle_pt bundle, void * handle) {
- mock_c()->actualCall("bundle_setHandle");
-}
-
-activator_pt bundle_getActivator(bundle_pt bundle) {
- mock_c()->actualCall("bundle_getActivator");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-celix_status_t bundle_setActivator(bundle_pt bundle, activator_pt activator) {
- mock_c()->actualCall("bundle_setActivator");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getContext(bundle_pt bundle, bundle_context_pt *context) {
- mock_c()->actualCall("bundle_getContext")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("context", context);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_setContext(bundle_pt bundle, bundle_context_pt context) {
- mock_c()->actualCall("bundle_setContext");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getEntry(bundle_pt bundle, const char * name, char **entry) {
- mock_c()->actualCall("bundle_getEntry")
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("name", name)
- ->withOutputParameter("entry", entry);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_start(bundle_pt bundle) {
- mock_c()->actualCall("bundle_start");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_startWithOptions(bundle_pt bundle, int options) {
- mock_c()->actualCall("bundle_startWithOptions");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_update(bundle_pt bundle, const char *inputFile) {
- mock_c()->actualCall("bundle_update");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_stop(bundle_pt bundle) {
- mock_c()->actualCall("bundle_stop");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_stopWithOptions(bundle_pt bundle, int options) {
- mock_c()->actualCall("bundle_stopWithOptions");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_uninstall(bundle_pt bundle) {
- mock_c()->actualCall("bundle_uninstall");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_setState(bundle_pt bundle, bundle_state_e state) {
- mock_c()->actualCall("bundle_setState");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_setPersistentStateInactive(bundle_pt bundle) {
- mock_c()->actualCall("bundle_setPersistentStateInactive");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_setPersistentStateUninstalled(bundle_pt bundle) {
- mock_c()->actualCall("bundle_setPersistentStateUninstalled");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-void uninstallBundle(bundle_pt bundle) {
- mock_c()->actualCall("uninstallBundle");
-}
-
-
-celix_status_t bundle_revise(bundle_pt bundle, const char * location, const char *inputFile) {
- mock_c()->actualCall("bundle_revise");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_addModule(bundle_pt bundle, module_pt module) {
- mock_c()->actualCall("bundle_addModule");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_closeModules(bundle_pt bundle) {
- mock_c()->actualCall("bundle_closeModules");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-// Service Reference Functions
-array_list_pt getUsingBundles(service_reference_pt reference) {
- mock_c()->actualCall("getUsingBundles");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-
-int compareTo(service_reference_pt a, service_reference_pt b) {
- mock_c()->actualCall("service_reference_pt");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_getState(bundle_pt bundle, bundle_state_e *state) {
- mock_c()->actualCall("bundle_getState")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("state", state);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_isLockable(bundle_pt bundle, bool *lockable) {
- mock_c()->actualCall("bundle_isLockable")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("lockable", lockable);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getLockingThread(bundle_pt bundle, celix_thread_t *thread) {
- mock_c()->actualCall("bundle_getLockingThread")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("thread", thread);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_lock(bundle_pt bundle, bool *locked) {
- mock_c()->actualCall("bundle_lock")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("locked", locked);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_unlock(bundle_pt bundle, bool *unlocked) {
- mock_c()->actualCall("bundle_unlock")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("unlocked", unlocked);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_closeAndDelete(bundle_pt bundle) {
- mock_c()->actualCall("bundle_closeAndDelete");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_close(bundle_pt bundle) {
- mock_c()->actualCall("bundle_close");
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_refresh(bundle_pt bundle) {
- mock_c()->actualCall("bundle_refresh");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getBundleId(bundle_pt bundle, long *id) {
- mock_c()->actualCall("bundle_getBundleId")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("id", id);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t bundle_getRegisteredServices(bundle_pt bundle, array_list_pt *list) {
- mock_c()->actualCall("bundle_getRegisteredServices")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("list", list);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getServicesInUse(bundle_pt bundle, array_list_pt *list) {
- mock_c()->actualCall("bundle_getServicesInUse")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("list", list);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_setFramework(bundle_pt bundle, framework_pt framework) {
- mock_c()->actualCall("bundle_setFramework");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundle_getFramework(bundle_pt bundle, framework_pt *framework) {
- mock_c()->actualCall("bundle_getFramework")
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("framework", framework);
- return mock_c()->returnValue().value.intValue;
-}
-
-long celix_bundle_getId(const bundle_t *bnd) {
- mock_c()->actualCall("celix_bundle_getId")
- ->withConstPointerParameters("bnd", bnd);
- return mock_c()->returnValue().value.longIntValue;
-}
-
-celix_bundle_state_e celix_bundle_getState(const bundle_t *bnd) {
- mock_c()->actualCall("celix_bundle_getState")
- ->withConstPointerParameters("bnd", bnd);
- return (celix_bundle_state_e)mock_c()->returnValue().value.intValue;
-}
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/bundle_revision_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/bundle_revision_mock.c b/framework/private/mock/bundle_revision_mock.c
deleted file mode 100644
index d324ceb..0000000
--- a/framework/private/mock/bundle_revision_mock.c
+++ /dev/null
@@ -1,79 +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.
- */
-/*
- * bundle_revision_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.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(const char *root, const char *location, long revisionNr, const char *inputFile, bundle_revision_pt *bundle_revision) {
- mock_c()->actualCall("bundleRevision_create")
- ->withStringParameters("root", root)
- ->withStringParameters("location", location)
- ->withLongIntParameters("revisionNr", revisionNr)
- ->withStringParameters("inputFile", inputFile)
- ->withOutputParameter("bundle_revision", bundle_revision);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_destroy(bundle_revision_pt revision) {
- mock_c()->actualCall("bundleRevision_destroy");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_getNumber(bundle_revision_pt revision, long *revisionNr) {
- mock_c()->actualCall("bundleRevision_getNumber")
- ->withPointerParameters("revision", revision)
- ->withOutputParameter("revisionNr", revisionNr);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_getLocation(bundle_revision_pt revision, const char **location) {
- mock_c()->actualCall("bundleRevision_getLocation")
- ->withPointerParameters("revision", revision)
- ->withOutputParameter("location", location);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_getRoot(bundle_revision_pt revision, const char **root) {
- mock_c()->actualCall("bundleRevision_getRoot")
- ->withPointerParameters("revision", revision)
- ->withOutputParameter("root", root);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_getManifest(bundle_revision_pt revision, manifest_pt *manifest) {
- mock_c()->actualCall("bundleRevision_getManifest")
- ->withPointerParameters("revision", revision)
- ->withOutputParameter("manifest", (void **) manifest);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t bundleRevision_getHandles(bundle_revision_pt revision, array_list_pt *handles) {
- mock_c()->actualCall("bundleRevision_getHandles")
- ->withPointerParameters("revision", revision)
- ->withOutputParameter("handles", (void **) handles);
- return mock_c()->returnValue().value.intValue;
-}
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/capability_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/capability_mock.c b/framework/private/mock/capability_mock.c
deleted file mode 100644
index a908ea2..0000000
--- a/framework/private/mock/capability_mock.c
+++ /dev/null
@@ -1,67 +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.
- */
-/*
- * capability_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.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(module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability) {
- mock_c()->actualCall("capability_create")
- ->withPointerParameters("module", module)
- ->withPointerParameters("directives", directives)
- ->withPointerParameters("attributes", attributes)
- ->withOutputParameter("capability", capability);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t capability_destroy(capability_pt capability) {
- mock_c()->actualCall("capability_destroy")
- ->withPointerParameters("capability", capability);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t capability_getServiceName(capability_pt capability, const char **serviceName) {
- mock_c()->actualCall("capability_getServiceName")
- ->withPointerParameters("capability", capability)
- ->withOutputParameter("serviceName", serviceName);
- 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)
- ->withOutputParameter("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")
- ->withPointerParameters("capability", capability)
- ->withOutputParameter("module", module);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/celix_log_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/celix_log_mock.c b/framework/private/mock/celix_log_mock.c
deleted file mode 100644
index 26ebb7e..0000000
--- a/framework/private/mock/celix_log_mock.c
+++ /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.
- */
-/*
- * celix_log_mock.c
- *
- * \date Oct, 5 2015
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include <stdarg.h>
-
-#include "celix_errno.h"
-#include "celix_log.h"
-
-static void test_logger_log(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line, const char *fmsg, ...);
-static void test_logger_print(framework_log_level_t level, const char *func, const char *file, int line, const char *msg);
-
-void framework_log(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line, const char *fmsg, ...) {
- mock_c()->actualCall("framework_log");
-
- test_logger_log(logger, level, func, file, line, "%s", fmsg);
-}
-
-void framework_logCode(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line, celix_status_t code, const char *fmsg, ...) {
- mock_c()->actualCall("framework_logCode")->withIntParameters("code", code);
- char message[256];
- celix_strerror(code, message, 256);
- char msg[512];
- va_list listPointer;
- va_start(listPointer, fmsg);
- vsprintf(msg, fmsg, listPointer);
-
- test_logger_log(logger, level, func, file, line, "%s [%d]: %s", message, code, msg);
-
- va_end(listPointer);
-}
-
-celix_status_t frameworkLogger_log(framework_log_level_t level, const char *func, const char *file, int line, const char *msg) {
- mock_c()->actualCall("frameworkLogger_log");
-
- test_logger_print(level, func, file, line, msg);
-
- return mock_c()->returnValue().value.intValue;
-}
-
-//test logger functions, let you read the logged errors
-static void test_logger_log(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line, const char *fmsg, ...) {
- char msg[512];
- va_list listPointer;
- va_start(listPointer, fmsg);
- vsprintf(msg, fmsg, listPointer);
-
- test_logger_print(level, func, file, line, msg);
-
- va_end(listPointer);
-}
-
-static void test_logger_print(framework_log_level_t level, const char *func, const char *file, int line, const char *msg) {
- char *levelStr = NULL;
- switch (level) {
- case OSGI_FRAMEWORK_LOG_ERROR:
- levelStr = "ERROR";
- break;
- case OSGI_FRAMEWORK_LOG_WARNING:
- levelStr = "WARNING";
- break;
- case OSGI_FRAMEWORK_LOG_INFO:
- levelStr = "INFO";
- break;
- case OSGI_FRAMEWORK_LOG_DEBUG:
- default:
- levelStr = "DEBUG";
- break;
- }
-
- if (level == OSGI_FRAMEWORK_LOG_ERROR) {
- printf("Code says: %s: %s\n\tat %s(%s:%d)\n", levelStr, msg, func, file, line);
- } else {
- printf("Code says: %s: %s\n", levelStr, msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/dm_dependency_manager_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/dm_dependency_manager_mock.c b/framework/private/mock/dm_dependency_manager_mock.c
deleted file mode 100644
index 8f87c8c..0000000
--- a/framework/private/mock/dm_dependency_manager_mock.c
+++ /dev/null
@@ -1,41 +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.
- */
-
-#include <CppUTestExt/MockSupport_c.h>
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "dm_dependency_manager.h"
-
-celix_status_t dependencyManager_removeAllComponents(dm_dependency_manager_t *manager) {
- mock_c()->actualCall("dependencyManager_removeAllComponents")
- ->withPointerParameters("manager", manager);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t dependencyManager_create(bundle_context_t *context, dm_dependency_manager_t **manager) {
- mock_c()->actualCall("dependencyManager_create")
- ->withPointerParameters("context", context)
- ->withOutputParameter("manager", (void **) manager);
- return mock_c()->returnValue().value.intValue;
-}
-
-void dependencyManager_destroy(dm_dependency_manager_t *manager) {
- mock_c()->actualCall("dependencyManager_destroy")
- ->withPointerParameters("manager", manager);
-}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/filter_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/filter_mock.c b/framework/private/mock/filter_mock.c
deleted file mode 100644
index d2fc75c..0000000
--- a/framework/private/mock/filter_mock.c
+++ /dev/null
@@ -1,54 +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.
- */
-/*
- * filter_mock.c
- *
- * \date Feb 7, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "filter.h"
-
-filter_pt filter_create(const char * filterString) {
- mock_c()->actualCall("filter_create")
- ->withStringParameters("filterString", filterString);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void filter_destroy(filter_pt filter) {
- mock_c()->actualCall("filter_destroy")
- ->withPointerParameters("filter", filter);
-}
-
-celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *result) {
- mock_c()->actualCall("filter_match")
- ->withPointerParameters("filter", filter)
- ->withPointerParameters("properties", properties)
- ->withOutputParameter("result", result);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t filter_getString(filter_pt filter, const char **filterStr) {
- mock_c()->actualCall("filter_getString")
- ->withPointerParameters("filter", filter)
- ->withOutputParameter("filterStr", filterStr);
- return mock_c()->returnValue().value.intValue;
-}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/framework_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/framework_mock.c b/framework/private/mock/framework_mock.c
deleted file mode 100644
index 7bbd752..0000000
--- a/framework/private/mock/framework_mock.c
+++ /dev/null
@@ -1,346 +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.
- */
-/*
- * framework_mock.c
- *
- * \date Feb 7, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include <CppUTestExt/MockSupport_c.h>
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "framework_private.h"
-
-celix_status_t framework_create(framework_pt *framework, 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;
-}
-
-celix_status_t framework_stop(framework_pt framework) {
- mock_c()->actualCall("framework_stop");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_getProperty(framework_pt framework, const char* name, const char* defaultValue, const char** value) {
- mock_c()->actualCall("fw_getProperty")
- ->withPointerParameters("framework", framework)
- ->withStringParameters("name", name)
- ->withStringParameters("defaultValue", defaultValue)
- ->withOutputParameter("value", (const char **) value);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_installBundle(framework_pt framework, bundle_pt * bundle, const char * location, const char *inputFile) {
- mock_c()->actualCall("fw_installBundle")
- ->withPointerParameters("framework", framework)
- ->withStringParameters("location", location)
- ->withStringParameters("inputFile", inputFile)
- ->withOutputParameter("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, const char *name, char **entry) {
- mock_c()->actualCall("framework_getBundleEntry")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("name", name)
- ->withOutputParameter("entry", (const char **) 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, const 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, const char* serviceName, const void* svcObj, properties_pt properties) {
- mock_c()->actualCall("fw_registerService")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("service", (void*) svcObj)
- ->withPointerParameters("properties", properties)
- ->withOutputParameter("registration", (void **) registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const 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)
- ->withOutputParameter("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, const char * filter) {
- mock_c()->actualCall("fw_getServiceReferences")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withStringParameters("filter", filter)
- ->withOutputParameter("references", (void **) references);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t framework_ungetServiceReference(framework_pt framework, bundle_pt bundle, service_reference_pt reference) {
- mock_c()->actualCall("framework_ungetServiceReference")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("reference", reference);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, const void **service) {
- mock_c()->actualCall("fw_getService")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("service", service);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t framework_ungetService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, bool *result) {
- mock_c()->actualCall("framework_ungetService")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("result", (int *) result);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_getBundleRegisteredServices(framework_pt framework, bundle_pt bundle, array_list_pt *services) {
- mock_c()->actualCall("fw_getBundleRegisteredServices")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("services", (void **) services);
- 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")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("services", (void **) services);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, const 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;
-}
-
-celix_status_t fw_addFrameworkListener(framework_pt framework, bundle_pt bundle, framework_listener_pt listener) {
- mock_c()->actualCall("fw_addframeworkListener")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("listener", listener);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t fw_removeFrameworkListener(framework_pt framework, bundle_pt bundle, framework_listener_pt listener) {
- mock_c()->actualCall("fw_removeframeworkListener")
- ->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, manifest_pt *manifest) {
- mock_c()->actualCall("getManifest")
- ->withPointerParameters("archive", archive)
- ->withOutputParameter("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")
- ->withPointerParameters("list", list);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-celix_status_t framework_markResolvedModules(framework_pt framework, linked_list_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, const char* location) {
- mock_c()->actualCall("framework_getBundle")
- ->withPointerParameters("framework", framework)
- ->withStringParameters("location", location);
- 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_getFrameworkBundle(framework_pt framework, bundle_pt *bundle) {
- mock_c()->actualCall("framework_getFrameworkBundle")
- ->withPointerParameters("framework", framework)
- ->withOutputParameter("bundle", bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-void celix_framework_useBundles(framework_t *fw, void *callbackHandle, void(*use)(void *handle, const bundle_t *bnd)) {
- mock_c()->actualCall("celix_framework_useBundles")
- ->withPointerParameters("fw", fw)
- ->withPointerParameters("callbackHandle", callbackHandle)
- ->withPointerParameters("use", use);
-}
-
-void celix_framework_useBundle(framework_t *fw, long bundleId, void *callbackHandle, void(*use)(void *handle, const bundle_t *bnd)) {
- mock_c()->actualCall("celix_framework_useBundle")
- ->withPointerParameters("fw", fw)
- ->withLongIntParameters("bundleId", bundleId)
- ->withPointerParameters("callbackHandle", callbackHandle)
- ->withPointerParameters("use", use);
-}
-
-service_registration_t* celix_framework_registerServiceFactory(framework_t *fw , const celix_bundle_t *bnd, const char* serviceName, celix_service_factory_t *factory, celix_properties_t *properties) {
- mock_c()->actualCall("celix_framework_registerServiceFactory")
- ->withPointerParameters("fw", fw)
- ->withConstPointerParameters("bnd", bnd)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("factory", factory)
- ->withPointerParameters("properties", properties);
- return mock_c()->returnValue().value.pointerValue;
-}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/manifest_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/manifest_mock.c b/framework/private/mock/manifest_mock.c
deleted file mode 100644
index b0f514a..0000000
--- a/framework/private/mock/manifest_mock.c
+++ /dev/null
@@ -1,79 +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.
- */
-/*
- * manifest_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.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(manifest_pt *manifest) {
- mock_c()->actualCall("manifest_create")
- ->withOutputParameter("manifest", (void **) manifest);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifest_createFromFile(const char *filename, manifest_pt *manifest) {
- mock_c()->actualCall("manifest_createFromFile")
- ->withStringParameters("filename", filename)
- ->withOutputParameter("manifest", (void **) manifest);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifest_destroy(manifest_pt manifest) {
- mock_c()->actualCall("manifest_destroy");
- return mock_c()->returnValue().value.intValue;
-}
-
-void manifest_clear(manifest_pt manifest) {
- mock_c()->actualCall("manifest_clear");
-}
-
-properties_pt manifest_getMainAttributes(manifest_pt manifest) {
- mock_c()->actualCall("manifest_getMainAttributes");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-celix_status_t manifest_getEntries(manifest_pt manifest, hash_map_pt *map) {
- mock_c()->actualCall("manifest_getEntries")
- ->withPointerParameters("manifest", manifest)
- ->withOutputParameter("map", map);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifest_read(manifest_pt manifest, const char *filename) {
- mock_c()->actualCall("manifest_read");
- return mock_c()->returnValue().value.intValue;
-}
-
-void manifest_write(manifest_pt manifest, const char * filename) {
- mock_c()->actualCall("manifest_write");
-}
-
-const char * manifest_getValue(manifest_pt manifest, const char * name) {
- mock_c()->actualCall("manifest_getValue")
- ->withStringParameters("name", name);
- return (char *) mock_c()->returnValue().value.stringValue;
-}
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/manifest_parser_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/manifest_parser_mock.c b/framework/private/mock/manifest_parser_mock.c
deleted file mode 100644
index c9ba693..0000000
--- a/framework/private/mock/manifest_parser_mock.c
+++ /dev/null
@@ -1,74 +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.
- */
-/*
- * manifest_parser_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.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, manifest_parser_pt *manifest_parser) {
- mock_c()->actualCall("manifestParser_create")
- ->withPointerParameters("owner", owner)
- ->withPointerParameters("manifest", manifest)
- ->withOutputParameter("manifest_parser", manifest_parser);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifestParser_destroy(manifest_parser_pt manifest_parser) {
- mock_c()->actualCall("manifestParser_destroy")
- ->withPointerParameters("manifest_parser", manifest_parser);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifestParser_getAndDuplicateSymbolicName(manifest_parser_pt parser, char **symbolicName) {
- mock_c()->actualCall("manifestParser_getSymbolicName")
- ->withPointerParameters("parser", parser)
- ->withOutputParameter("symbolicName", (void**) symbolicName);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, version_pt *version) {
- mock_c()->actualCall("manifestParser_getBundleVersion")
- ->withPointerParameters("parser", parser)
- ->withOutputParameter("version", (void**) version);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, linked_list_pt *capabilities) {
- mock_c()->actualCall("manifestParser_getCapabilities")
- ->withPointerParameters("parser", parser)
- ->withOutputParameter("capabilities", (void**) capabilities);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, linked_list_pt *requirements) {
- mock_c()->actualCall("manifestParser_getCurrentRequirements")
- ->withPointerParameters("parser", parser)
- ->withOutputParameter("requirements", (void**) requirements);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/miniunz_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/miniunz_mock.c b/framework/private/mock/miniunz_mock.c
deleted file mode 100644
index 357bf31..0000000
--- a/framework/private/mock/miniunz_mock.c
+++ /dev/null
@@ -1,38 +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.
- */
-/*
- * miniunz_mock.c
- *
- * \date Feb 12, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "archive.h"
-
-celix_status_t extractBundle(const char * bundleName, const char * revisionRoot) {
- mock_c()->actualCall("extractBundle")
- ->withStringParameters("bundleName", bundleName)
- ->withStringParameters("revisionRoot", revisionRoot);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/module_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/module_mock.c b/framework/private/mock/module_mock.c
deleted file mode 100644
index 989dd05..0000000
--- a/framework/private/mock/module_mock.c
+++ /dev/null
@@ -1,147 +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.
- */
-/*
- * module_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.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, const 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("module_destroy");
-}
-
-unsigned int module_hash(void * module) {
- mock_c()->actualCall("module_hash");
- return mock_c()->returnValue().value.intValue;
-}
-
-int module_equals(void * module, void * compare) {
- mock_c()->actualCall("module_equals");
- return mock_c()->returnValue().value.intValue;
-}
-
-wire_pt module_getWire(module_pt module, const char * serviceName) {
- mock_c()->actualCall("module_getwire");
- 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, const char **symbolicName) {
- mock_c()->actualCall("module_getSymbolicName")
- ->withPointerParameters("module", module)
- ->withOutputParameter("symbolicName", (const char **) symbolicName);
- return mock_c()->returnValue().value.intValue;
-}
-
-char * module_getId(module_pt module) {
- mock_c()->actualCall("module_getId");
- return (char *) mock_c()->returnValue().value.stringValue;
-}
-
-linked_list_pt module_getWires(module_pt module) {
- mock_c()->actualCall("module_getWires");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void module_setWires(module_pt module, linked_list_pt wires) {
- mock_c()->actualCall("module_setWires");
-}
-
-bool module_isResolved(module_pt module) {
- mock_c()->actualCall("module_isResolved");
- return mock_c()->returnValue().value.intValue;
-}
-
-void module_setResolved(module_pt module) {
- mock_c()->actualCall("module_setResolved");
-}
-
-bundle_pt module_getBundle(module_pt module) {
- mock_c()->actualCall("module_getBundle");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-linked_list_pt module_getRequirements(module_pt module) {
- mock_c()->actualCall("module_getRequirements");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-linked_list_pt module_getCapabilities(module_pt module) {
- mock_c()->actualCall("module_getCapabilities");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-array_list_pt module_getDependentImporters(module_pt module) {
- mock_c()->actualCall("module_getDependentImporters");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void module_addDependentImporter(module_pt module, module_pt importer) {
- mock_c()->actualCall("module_addDependentImporter");
-}
-
-void module_removeDependentImporter(module_pt module, module_pt importer) {
- mock_c()->actualCall("module_removeDependentImporter");
-}
-
-array_list_pt module_getDependentRequirers(module_pt module) {
- mock_c()->actualCall("module_getDependentRequirers");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void module_addDependentRequirer(module_pt module, module_pt requirer) {
- mock_c()->actualCall("module_addDependentRequirer");
-}
-
-void module_removeDependentRequirer(module_pt module, module_pt requirer) {
- mock_c()->actualCall("module_removeDependentRequirer");
-}
-
-array_list_pt module_getDependents(module_pt module) {
- mock_c()->actualCall("module_getDependents");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/properties_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/properties_mock.c b/framework/private/mock/properties_mock.c
deleted file mode 100644
index e977100..0000000
--- a/framework/private/mock/properties_mock.c
+++ /dev/null
@@ -1,73 +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.
- */
-/*
- * properties_mock.c
- *
- * \date Feb 7, 2013
- * \author <a href="mailto:dev@celix.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(const char * filename) {
- mock_c()->actualCall("properties_load");
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void properties_store(properties_pt properties, const char * file, const char * header) {
- mock_c()->actualCall("properties_store");
-}
-
-const char * properties_get(properties_pt properties, const char * key) {
- mock_c()->actualCall("properties_get")
- ->withPointerParameters("properties", properties)
- ->withStringParameters("key", key);
- return (char *) mock_c()->returnValue().value.stringValue;
-}
-
-const char * properties_getWithDefault(properties_pt properties, const char * key, const char * defaultValue) {
- mock_c()->actualCall("properties_get")
- ->withPointerParameters("properties", properties)
- ->withStringParameters("key", key)
- ->withStringParameters("defaultValue", defaultValue);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void properties_set(properties_pt properties, const char * key, const char * value) {
- mock_c()->actualCall("properties_set")
- ->withPointerParameters("properties", properties)
- ->withStringParameters("key", key)
- ->withStringParameters("value", value);
-}
-
-
-
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/requirement_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/requirement_mock.c b/framework/private/mock/requirement_mock.c
deleted file mode 100644
index 101bdce..0000000
--- a/framework/private/mock/requirement_mock.c
+++ /dev/null
@@ -1,65 +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.
- */
-/*
- * requirement_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "requirement.h"
-
-celix_status_t requirement_create(hash_map_pt directives, hash_map_pt attributes, requirement_pt *requirement) {
- mock_c()->actualCall("requirement_create")
- ->withPointerParameters("directives", directives)
- ->withPointerParameters("attributes", attributes)
- ->withOutputParameter("requirement", (void **) requirement);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t requirement_destroy(requirement_pt requirement) {
- mock_c()->actualCall("requirement_destroy")
- ->withPointerParameters("requirement", requirement);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t requirement_getVersionRange(requirement_pt requirement, version_range_pt *range) {
- mock_c()->actualCall("requirement_getVersionRange")
- ->withPointerParameters("requirement", requirement)
- ->withOutputParameter("range", range);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t requirement_getTargetName(requirement_pt requirement, const char **targetName) {
- mock_c()->actualCall("requirement_getTargetName")
- ->withPointerParameters("requirement", requirement)
- ->withOutputParameter("targetName", targetName);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t requirement_isSatisfied(requirement_pt requirement, capability_pt capability, bool *inRange) {
- mock_c()->actualCall("requirement_isSatisfied")
- ->withPointerParameters("requirement", requirement)
- ->withPointerParameters("capability", capability)
- ->withOutputParameter("inRange", inRange);
- return mock_c()->returnValue().value.intValue;
-}
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/resolver_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/resolver_mock.c b/framework/private/mock/resolver_mock.c
deleted file mode 100644
index 38e0fd0..0000000
--- a/framework/private/mock/resolver_mock.c
+++ /dev/null
@@ -1,50 +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.
- */
-/*
- * resolver_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "resolver.h"
-
-linked_list_pt resolver_resolve(module_pt root) {
- mock_c()->actualCall("resolver_resolve")
- ->withPointerParameters("module", root);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-void resolver_moduleResolved(module_pt module) {
- mock_c()->actualCall("resolver_moduleResolved")
- ->withPointerParameters("module", module);
-}
-
-void resolver_addModule(module_pt module) {
- mock_c()->actualCall("resolver_addModule")
- ->withPointerParameters("module", module);
-}
-
-void resolver_removeModule(module_pt module) {
- mock_c()->actualCall("resolver_removeModule")
- ->withPointerParameters("module", module);
-}
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/service_reference_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_reference_mock.c b/framework/private/mock/service_reference_mock.c
deleted file mode 100644
index 96ed005..0000000
--- a/framework/private/mock/service_reference_mock.c
+++ /dev/null
@@ -1,185 +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_reference_mock.c
- *
- * \date Feb 6, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "service_reference_private.h"
-
-celix_status_t serviceReference_create(registry_callback_t callback, bundle_pt referenceOwner, service_registration_pt registration, service_reference_pt *reference) {
- mock_c()->actualCall("serviceReference_create")
- ->withParameterOfType("registry_callback_t", "callback", &callback)
- ->withPointerParameters("referenceOwner", referenceOwner)
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("reference", (void **) reference);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_retain(service_reference_pt ref) {
- mock_c()->actualCall("serviceReference_retain")
- ->withPointerParameters("ref", ref);
- return mock_c()->returnValue().value.intValue;
-}
-celix_status_t serviceReference_release(service_reference_pt ref, bool *destroyed) {
- mock_c()->actualCall("serviceReference_release")
- ->withPointerParameters("ref", ref)
- ->withOutputParameter("destroyed", destroyed);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t serviceReference_increaseUsage(service_reference_pt ref, size_t *updatedCount){
- mock_c()->actualCall("serviceReference_increaseUsage")
- ->withPointerParameters("reference", ref)
- ->withOutputParameter("updatedCount", updatedCount);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_decreaseUsage(service_reference_pt ref, size_t *updatedCount){
- mock_c()->actualCall("serviceReference_decreaseUsage")
- ->withPointerParameters("ref", ref)
- ->withOutputParameter("updatedCount", updatedCount);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getUsageCount(service_reference_pt reference, size_t *count){
- mock_c()->actualCall("serviceReference_getUsageCount")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("count", count);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getReferenceCount(service_reference_pt reference, size_t *count){
- mock_c()->actualCall("serviceReference_getReferenceCount")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("count", count);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_setService(service_reference_pt ref, const void *service){
- mock_c()->actualCall("serviceReference_setService")
- ->withPointerParameters("ref", ref)
- ->withPointerParameters("service", (void *)service);
- return mock_c()->returnValue().value.intValue;
-}
-celix_status_t serviceReference_getService(service_reference_pt reference, void **service){
- mock_c()->actualCall("serviceReference_getService")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("service", service);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getBundle(service_reference_pt reference, bundle_pt *bundle) {
- mock_c()->actualCall("serviceReference_getBundle")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("bundle", bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t serviceReference_getOwner(service_reference_pt reference, bundle_pt *owner) {
- mock_c()->actualCall("serviceReference_getOwner")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("owner", owner);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getServiceRegistration(service_reference_pt reference, service_registration_pt *registration) {
- mock_c()->actualCall("serviceReference_getServiceRegistration")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("registration", (void **) registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getProperty(service_reference_pt reference, const char *key, const char** value){
- mock_c()->actualCall("serviceReference_getProperty")
- ->withPointerParameters("reference", reference)
- ->withStringParameters("key", key)
- ->withOutputParameter("value", value);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getPropertyKeys(service_reference_pt reference, char **keys[], unsigned int *size){
- mock_c()->actualCall("serviceReference_getPropertyKeys")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("keys", keys)
- ->withOutputParameter("size", size);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_invalidate(service_reference_pt reference) {
- mock_c()->actualCall("serviceReference_invalidate")
- ->withPointerParameters("reference", reference);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_isValid(service_reference_pt reference, bool *result) {
- mock_c()->actualCall("serviceReference_isValid")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("result", result);
- return mock_c()->returnValue().value.intValue;
-}
-
-bool serviceReference_isAssignableTo(service_reference_pt reference, bundle_pt requester, const char * serviceName) {
- mock_c()->actualCall("serviceReference_isAssignableTo")
- ->withPointerParameters("reference", reference)
- ->withPointerParameters("requester", requester)
- ->withStringParameters("serviceName", serviceName);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_getUsingBundles(service_reference_pt reference, array_list_pt *bundles) {
- mock_c()->actualCall("serviceReference_getUsingBundles")
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("bundles", bundles);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_equals(service_reference_pt reference, service_reference_pt compareTo, bool *equal) {
- mock_c()->actualCall("serviceReference_equals")
- ->withPointerParameters("reference", reference)
- ->withPointerParameters("compareTo", compareTo)
- ->withOutputParameter("equal", equal);
- return mock_c()->returnValue().value.intValue;
-}
-
-int serviceReference_equals2(const void *reference1, const void *reference2) {
- mock_c()->actualCall("serviceReference_equals2")
- ->withPointerParameters("reference1", (void*)reference1)
- ->withPointerParameters("reference2", (void*)reference2);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceReference_compareTo(service_reference_pt reference, service_reference_pt compareTo, int *compare){
- mock_c()->actualCall("serviceReference_compareTo")
- ->withPointerParameters("reference", reference)
- ->withPointerParameters("compareTo", compareTo)
- ->withOutputParameter("compare", compare);
- return mock_c()->returnValue().value.intValue;
-}
-
-unsigned int serviceReference_hashCode(const void *referenceP) {
- mock_c()->actualCall("serviceReference_hashCode");
- return mock_c()->returnValue().value.intValue;
-}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/service_registration_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_registration_mock.c b/framework/private/mock/service_registration_mock.c
deleted file mode 100644
index 69be7eb..0000000
--- a/framework/private/mock/service_registration_mock.c
+++ /dev/null
@@ -1,164 +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_registration_mock.c
- *
- * \date Feb 7, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include <CppUTestExt/MockSupport_c.h>
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "service_registration.h"
-#include "service_registration_private.h"
-
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, unsigned long serviceId, const void* serviceObject, properties_pt dictionary) {
- mock_c()->actualCall("serviceRegistration_create")
- ->withParameterOfType("registry_callback_t", "callback", &callback)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withUnsignedLongIntParameters("serviceId", serviceId)
- ->withPointerParameters("serviceObject", (void*)serviceObject)
- ->withPointerParameters("dictionary", dictionary);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, unsigned long serviceId, const void* serviceObject, properties_pt dictionary) {
- mock_c()->actualCall("serviceRegistration_createServiceFactory")
- ->withParameterOfType("registry_callback_t", "callback", &callback)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withUnsignedLongIntParameters("serviceId", serviceId)
- ->withPointerParameters("serviceObject", (void*) serviceObject)
- ->withPointerParameters("dictionary", dictionary);
- return mock_c()->returnValue().value.pointerValue;
-}
-
-celix_status_t serviceRegistration_destroy(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_destroy")
- ->withPointerParameters("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-bool serviceRegistration_isValid(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_isValid")
- ->withPointerParameters("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-void serviceRegistration_invalidate(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_invalidate")
- ->withPointerParameters("registration", registration);
-}
-
-celix_status_t serviceRegistration_unregister(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_unregister")
- ->withPointerParameters("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, const void **service) {
- mock_c()->actualCall("serviceRegistration_getService")
- ->withPointerParameters("registration", registration)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("service", (void **) service);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, const void **service) {
- mock_c()->actualCall("serviceRegistration_ungetService")
- ->withPointerParameters("registration", registration)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("service", service);
- return mock_c()->returnValue().value.intValue;
-}
-
-
-celix_status_t serviceRegistration_getProperties(service_registration_pt registration, properties_pt *properties) {
- mock_c()->actualCall("serviceRegistration_getProperties")
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("properties", (void **) properties);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistration_getRegistry(service_registration_pt registration, service_registry_pt *registry) {
- mock_c()->actualCall("serviceRegistration_getRegistry")
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("registry", (void **) registry);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistration_getServiceReferences(service_registration_pt registration, array_list_pt *references) {
- mock_c()->actualCall("serviceRegistration_getServiceReferences")
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("references", references);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistration_getBundle(service_registration_pt registration, bundle_pt *bundle) {
- mock_c()->actualCall("serviceRegistration_getBundle")
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("bundle", (void **) bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistration_getServiceName(service_registration_pt registration, const char **serviceName) {
- mock_c()->actualCall("serviceRegistration_getServiceName")
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("serviceName", (const char **) serviceName);
- return mock_c()->returnValue().value.intValue;
-}
-
-void serviceRegistration_retain(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_retain")
- ->withPointerParameters("registration", registration);
-}
-
-void serviceRegistration_release(service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistration_release")
- ->withPointerParameters("registration", registration);
-}
-
-
-long serviceRegistration_getServiceId(service_registration_t *registration) {
- mock_c()->actualCall("serviceRegistration_getServiceId")
- ->withPointerParameters("registration", registration);
- return mock_c()->returnValue().value.longIntValue;
-}
-
-service_registration_t* celix_serviceRegistration_createServiceFactory(
- registry_callback_t callback,
- const celix_bundle_t *bnd,
- const char *serviceName,
- long svcId,
- celix_service_factory_t* factory,
- celix_properties_t *props) {
- mock_c()->actualCall("celix_serviceRegistration_createServiceFactory")
- ->withParameterOfType("registry_callback_t", "callback", &callback)
- ->withConstPointerParameters("bnd", bnd)
- ->withStringParameters("serviceName", serviceName)
- ->withUnsignedLongIntParameters("svcId", svcId)
- ->withPointerParameters("factory", (void*) factory)
- ->withPointerParameters("props", props);
- return mock_c()->returnValue().value.pointerValue;
-}
-
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/framework/private/mock/service_registry_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_registry_mock.c b/framework/private/mock/service_registry_mock.c
deleted file mode 100644
index 9942818..0000000
--- a/framework/private/mock/service_registry_mock.c
+++ /dev/null
@@ -1,184 +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_mock.c
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-#include "CppUTestExt/MockSupport_c.h"
-
-#include "service_registry.h"
-
-celix_status_t serviceRegistry_create(framework_pt framework, serviceChanged_function_pt serviceChanged, service_registry_pt *registry) {
- mock_c()->actualCall("serviceRegistry_create")
- ->withPointerParameters("framework", framework)
- ->withPointerParameters("serviceChanged", serviceChanged)
- ->withOutputParameter("registry", registry);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_destroy(service_registry_pt registry) {
- mock_c()->actualCall("serviceRegistry_destroy");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getRegisteredServices(service_registry_pt registry, bundle_pt bundle, array_list_pt *services) {
- mock_c()->actualCall("serviceRegistry_getRegisteredServices")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("services", services);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bundle_pt bundle, array_list_pt *services) {
- mock_c()->actualCall("serviceRegistry_getServicesInUse")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("services", services);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void * serviceObject, properties_pt dictionary, service_registration_pt *registration) {
- mock_c()->actualCall("serviceRegistry_registerService")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("serviceObject", (void*)serviceObject)
- ->withPointerParameters("dictionary", dictionary)
- ->withOutputParameter("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_registerServiceFactory(service_registry_pt registry, bundle_pt bundle, const char* serviceName, service_factory_pt factory, properties_pt dictionary, service_registration_pt *registration) {
- mock_c()->actualCall("serviceRegistry_registerServiceFactory")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("factory", factory)
- ->withPointerParameters("dictionary", dictionary)
- ->withOutputParameter("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_unregisterService(service_registry_pt registry, bundle_pt bundle, service_registration_pt registration) {
- mock_c()->actualCall("serviceRegistry_unregisterService")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getServiceReferences(service_registry_pt registry, bundle_pt bundle, const char *serviceName, filter_pt filter, array_list_pt *references) {
- mock_c()->actualCall("serviceRegistry_getServiceReferences")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("filter", filter)
- ->withOutputParameter("references", references);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_retainServiceReference(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference) {
- mock_c()->actualCall("serviceRegistry_retainServiceReference");
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_ungetServiceReference(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference) {
- mock_c()->actualCall("serviceRegistry_ungetServiceReference")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("reference", reference);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, const void **service) {
- mock_c()->actualCall("serviceRegistry_getService")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("reference", reference)
- ->withOutputParameter("service", service);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, bool *result) {
- mock_c()->actualCall("serviceRegistry_ungetService")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("result", result);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getListenerHooks(service_registry_pt registry, bundle_pt bundle, array_list_pt *hooks) {
- mock_c()->actualCall("serviceRegistry_getListenerHooks")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withOutputParameter("hooks", hooks);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_servicePropertiesModified(service_registry_pt registry, service_registration_pt registration, properties_pt oldprops) {
- mock_c()->actualCall("serviceRegistry_servicePropertiesModified")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("registration", registration)
- ->withPointerParameters("oldprops", oldprops);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_getServiceReference(service_registry_pt registry, bundle_pt bundle, service_registration_pt registration, service_reference_pt *reference) {
- mock_c()->actualCall("serviceRegistry_getServiceReference")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle)
- ->withPointerParameters("registration", registration)
- ->withOutputParameter("reference", reference);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_clearReferencesFor(service_registry_pt registry, bundle_pt bundle) {
- mock_c()->actualCall("serviceRegistry_clearReferencesFor")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t serviceRegistry_clearServiceRegistrations(service_registry_pt registry, bundle_pt bundle) {
- mock_c()->actualCall("serviceRegistry_clearReferencesFor")
- ->withPointerParameters("registry", registry)
- ->withPointerParameters("bundle", bundle);
- return mock_c()->returnValue().value.intValue;
-}
-
-celix_status_t
-celix_serviceRegistry_registerServiceFactory(
- celix_service_registry_t *reg,
- const celix_bundle_t *bnd,
- const char *serviceName,
- celix_service_factory_t *factory,
- celix_properties_t* props,
- service_registration_t **registration) {
- mock_c()->actualCall("celix_serviceRegistry_registerServiceFactory")
- ->withPointerParameters("reg", reg)
- ->withConstPointerParameters("bnd", bnd)
- ->withStringParameters("serviceName", serviceName)
- ->withPointerParameters("factory", factory)
- ->withPointerParameters("props", props)
- ->withOutputParameter("registration", registration);
- return mock_c()->returnValue().value.intValue;
-}
\ No newline at end of file