celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-282: Updates expected mock calls for updated logging info.
Date Sun, 16 Oct 2016 22:17:27 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 147a30775 -> 6959571eb


CELIX-282: Updates expected mock calls for updated logging info.


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

Branch: refs/heads/develop
Commit: 6959571eb745e666f60b551b68d2806b9e885602
Parents: 147a307
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Mon Oct 17 00:16:28 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Mon Oct 17 00:16:28 2016 +0200

----------------------------------------------------------------------
 .../private/test/service_registry_test.cpp      | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/6959571e/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
index 35725e0..95017ae 100644
--- a/framework/private/test/service_registry_test.cpp
+++ b/framework/private/test/service_registry_test.cpp
@@ -647,6 +647,7 @@ TEST(service_registry, ungetServiceReference){
 	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);
@@ -692,13 +693,31 @@ TEST(service_registry, ungetServiceReference){
 	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().expectOneCall("framework_log");
+    mock().expectNCalls(2, "bundle_getCurrentModule")
+            .withParameter("bundle", bundle)
+			.withOutputParameterReturning("module", &module, sizeof(module));
+    mock().expectNCalls(2, "module_getSymbolicName")
+            .withParameter("module", module)
+			.withOutputParameterReturning("symbolicName", &mod_name, sizeof(mod_name));
+    mock().expectOneCall("serviceReference_getProperty")
+            .withParameter("reference", reference)
+            .withParameter("key", OSGI_FRAMEWORK_OBJECTCLASS)
+			.withOutputParameterReturning("value", &srv_name, sizeof(srv_name));
+    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().expectNCalls(2, "framework_log");
 
 	serviceRegistry_ungetServiceReference(registry, bundle, reference);
 


Mime
View raw message