You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2021/11/26 17:11:22 UTC
[sling-org-apache-sling-testing-osgi-mock] branch experimental/WTES-69-debug-logging updated: WTEST-69 more logging
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch experimental/WTES-69-debug-logging
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
The following commit(s) were added to refs/heads/experimental/WTES-69-debug-logging by this push:
new b2f2ee1 WTEST-69 more logging
b2f2ee1 is described below
commit b2f2ee1154bd4c80658c7a359e4b8b09937f8add
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Fri Nov 26 18:11:07 2021 +0100
WTEST-69 more logging
---
.../main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
index ac51aef..0a7bee8 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
@@ -37,12 +37,16 @@ import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Factory for mock OSGi objects.
*/
public final class MockOsgi {
+ private static final Logger log = LoggerFactory.getLogger(MockOsgi.class);
+
private MockOsgi() {
// static methods only
}
@@ -234,6 +238,9 @@ public final class MockOsgi {
Dictionary<String, Object> serviceProperties = mergedProperties.entrySet().stream().filter(e -> e.getKey() != null && !e.getKey().startsWith(".")).collect(new DictionaryCollector<String, Object>(Entry::getKey, Entry::getValue));
bundleContext.registerService(metadata.getServiceInterfaces().toArray(new String[0]), component, serviceProperties);
}
+ else {
+ log.info("Skip registering " + component.getClass().getName() + ", no service interface in metadata, bundleContext=" + bundleContext);
+ }
}
/**
@@ -276,6 +283,9 @@ public final class MockOsgi {
Dictionary<String, Object> serviceProperties = mergedProperties.entrySet().stream().filter(e -> e.getKey() != null && !e.getKey().startsWith(".")).collect(new DictionaryCollector<String, Object>(Entry::getKey, Entry::getValue));
bundleContext.registerService(metadata.getServiceInterfaces().toArray(new String[0]), component, serviceProperties);
}
+ else {
+ log.info("Skip registering " + component.getClass().getName() + ", no service interface in metadata, bundleContext=" + bundleContext);
+ }
return component;
}