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/12/07 09:18:15 UTC

[sling-org-apache-sling-testing-osgi-mock] branch experimental/WTES-69-diagnosis created (now 17245c3)

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a change to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git.


      at 17245c3  logging variants

This branch includes the following new commits:

     new 9126977  set version to 3.2.1-WTES-69-SNAPSHOT
     new 7fecb75  do not call getService in debug logging
     new 556339e  disable all log.isDebugEnabled() statements
     new d4359e5  enable isDebugEnabled logging again for MockEventAdmin
     new a2b9583  enable minimal debug logging for register/unregister
     new a0f6a4a  disable log on register again
     new 17245c3  logging variants

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-testing-osgi-mock] 04/07: enable isDebugEnabled logging again for MockEventAdmin

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit d4359e5e64d1de5c64cd4a1c1920ab97ed1090ad
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 08:23:31 2021 +0100

    enable isDebugEnabled logging again for MockEventAdmin
---
 .../main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java  | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
index da6578b..1f1443e 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
@@ -73,11 +73,9 @@ public final class MockEventAdmin implements EventAdmin {
 
     @Override
     public void postEvent(final Event event) {
-        /*
         if (log.isDebugEnabled()) {
             log.debug("Send event: {}, bundleContext={}", event.getTopic(), this.bundleContext);
         }
-        */
         try {
             asyncHandler.execute(new Runnable() {
                 @Override
@@ -102,11 +100,9 @@ public final class MockEventAdmin implements EventAdmin {
             for (EventHandlerItem item : eventHandlers.values()) {
                 if (item.matches(event)) {
                     try {
-                        /*
                         if (log.isDebugEnabled()) {
                             log.debug("Distribute event: {} to {}, bundleContext={}", event.getTopic(), item.getEventHandler().getClass(), this.bundleContext);
                         }
-                        */
                         item.getEventHandler().handleEvent(event);
                     }
                     catch (Throwable ex) {

[sling-org-apache-sling-testing-osgi-mock] 01/07: set version to 3.2.1-WTES-69-SNAPSHOT

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit 912697768ff7aab183fd762cc137c9d6e46cffeb
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Mon Dec 6 22:18:46 2021 +0100

    set version to 3.2.1-WTES-69-SNAPSHOT
---
 core/pom.xml          | 4 ++--
 junit4/pom.xml        | 6 +++---
 junit5/pom.xml        | 6 +++---
 parent/pom.xml        | 4 ++--
 pom.xml               | 2 +-
 relocate/pom.xml      | 2 +-
 test-services/pom.xml | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 8f2bc33..37e378f 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
@@ -173,7 +173,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock.test-services</artifactId>
-            <version>3.2.1-SNAPSHOT</version>
+            <version>3.2.1-WTES-69-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
 
diff --git a/junit4/pom.xml b/junit4/pom.xml
index fdf73f1..0b9adab 100644
--- a/junit4/pom.xml
+++ b/junit4/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
@@ -37,13 +37,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
-            <version>3.2.1-SNAPSHOT</version>
+            <version>3.2.1-WTES-69-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
-            <version>3.2.1-SNAPSHOT</version>
+            <version>3.2.1-WTES-69-SNAPSHOT</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
diff --git a/junit5/pom.xml b/junit5/pom.xml
index eed625f..c9220ca 100644
--- a/junit5/pom.xml
+++ b/junit5/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
@@ -37,13 +37,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
-            <version>3.2.1-SNAPSHOT</version>
+            <version>3.2.1-WTES-69-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
-            <version>3.2.1-SNAPSHOT</version>
+            <version>3.2.1-WTES-69-SNAPSHOT</version>
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
diff --git a/parent/pom.xml b/parent/pom.xml
index bc5f6fb..c3a4162 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -28,14 +28,14 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-    <version>3.2.1-SNAPSHOT</version>
+    <version>3.2.1-WTES-69-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache Sling Testing OSGi Mock Parent</name>
     <description>Mock implementation of selected OSGi APIs.</description>
 
     <properties>
-        <project.build.outputTimestamp>2021-11-29T17:07:24Z</project.build.outputTimestamp>
+        <project.build.outputTimestamp>2021-12-06T21:18:04Z</project.build.outputTimestamp>
     </properties>
 
     <dependencies>
diff --git a/pom.xml b/pom.xml
index 497b97b..46127f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>parent/pom.xml</relativePath>
     </parent>
 
diff --git a/relocate/pom.xml b/relocate/pom.xml
index 4fdc370..dbc9f80 100644
--- a/relocate/pom.xml
+++ b/relocate/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
diff --git a/test-services/pom.xml b/test-services/pom.xml
index 80dd06c..d997d03 100644
--- a/test-services/pom.xml
+++ b/test-services/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1-WTES-69-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 

[sling-org-apache-sling-testing-osgi-mock] 03/07: disable all log.isDebugEnabled() statements

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit 556339ee27b200429ef18147fc77864067384399
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 08:09:46 2021 +0100

    disable all log.isDebugEnabled() statements
---
 .../java/org/apache/sling/testing/mock/osgi/MockBundleContext.java    | 4 ++++
 .../main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index 376e492..54dc455 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -128,9 +128,11 @@ class MockBundleContext implements BundleContext {
     @SuppressWarnings("unchecked")
     @Override
     public ServiceRegistration registerService(final String[] clazzes, final Object service, final Dictionary properties) {
+        /*
         if (log.isDebugEnabled()) {
             log.debug("Register {} ({}), bundleContext={}", service.getClass().getName(), StringUtils.join(clazzes, ","), this);
         }
+        */
 
         MockServiceRegistration<?> registration = new MockServiceRegistration<>(this.bundle, clazzes, service, properties, this);
         this.registeredServices.add(registration);
@@ -204,11 +206,13 @@ class MockBundleContext implements BundleContext {
     }
 
     void unregisterService(MockServiceRegistration<?> registration) {
+        /*
         if (log.isDebugEnabled()) {
             Object componentInstance = registration.service;
             log.debug("Unregister {} ({}), bundleContext={}", componentInstance != null ? componentInstance.getClass() : "",
                     StringUtils.join(registration.getClasses(), ","), this);
         }
+        */
 
         boolean wasRemoved = this.registeredServices.remove(registration);
         if (wasRemoved) {
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
index 1f1443e..da6578b 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
@@ -73,9 +73,11 @@ public final class MockEventAdmin implements EventAdmin {
 
     @Override
     public void postEvent(final Event event) {
+        /*
         if (log.isDebugEnabled()) {
             log.debug("Send event: {}, bundleContext={}", event.getTopic(), this.bundleContext);
         }
+        */
         try {
             asyncHandler.execute(new Runnable() {
                 @Override
@@ -100,9 +102,11 @@ public final class MockEventAdmin implements EventAdmin {
             for (EventHandlerItem item : eventHandlers.values()) {
                 if (item.matches(event)) {
                     try {
+                        /*
                         if (log.isDebugEnabled()) {
                             log.debug("Distribute event: {} to {}, bundleContext={}", event.getTopic(), item.getEventHandler().getClass(), this.bundleContext);
                         }
+                        */
                         item.getEventHandler().handleEvent(event);
                     }
                     catch (Throwable ex) {

[sling-org-apache-sling-testing-osgi-mock] 07/07: logging variants

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit 17245c3847ee00d824c53d35773ba051076f531b
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 09:05:33 2021 +0100

    logging variants
---
 .../java/org/apache/sling/testing/mock/osgi/MockBundleContext.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index 28bfea4..240f547 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -128,7 +128,7 @@ class MockBundleContext implements BundleContext {
     @SuppressWarnings("unchecked")
     @Override
     public ServiceRegistration registerService(final String[] clazzes, final Object service, final Dictionary properties) {
-        //log.debug("Register {} ({}), bundleContext={}", service, clazzes, this);
+        log.debug("Register {} ({}), bundleContext={}", null, null, this);
         /*
         if (log.isDebugEnabled()) {
             log.debug("Register {} ({}), bundleContext={}", service.getClass().getName(), StringUtils.join(clazzes, ","), this);
@@ -207,7 +207,7 @@ class MockBundleContext implements BundleContext {
     }
 
     void unregisterService(MockServiceRegistration<?> registration) {
-        log.debug("Unregister {} ({}), bundleContext={}", this);
+        log.debug("Unregister {} ({}), bundleContext={}", registration, null, this);
         /*
         if (log.isDebugEnabled()) {
             Object componentInstance = registration.service;

[sling-org-apache-sling-testing-osgi-mock] 06/07: disable log on register again

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit a0f6a4aea6d33402610b19b69fbe1b4ca538d2f3
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 08:53:18 2021 +0100

    disable log on register again
---
 .../main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index ff66942..28bfea4 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -128,7 +128,7 @@ class MockBundleContext implements BundleContext {
     @SuppressWarnings("unchecked")
     @Override
     public ServiceRegistration registerService(final String[] clazzes, final Object service, final Dictionary properties) {
-        log.debug("Register {} ({}), bundleContext={}", service, clazzes, this);
+        //log.debug("Register {} ({}), bundleContext={}", service, clazzes, this);
         /*
         if (log.isDebugEnabled()) {
             log.debug("Register {} ({}), bundleContext={}", service.getClass().getName(), StringUtils.join(clazzes, ","), this);

[sling-org-apache-sling-testing-osgi-mock] 02/07: do not call getService in debug logging

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit 7fecb75405d48bcfddd8300572258c350dcf4e77
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Mon Dec 6 22:19:07 2021 +0100

    do not call getService in debug logging
---
 .../main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java | 2 +-
 .../org/apache/sling/testing/mock/osgi/MockServiceRegistration.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index f2b5e41..376e492 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -205,7 +205,7 @@ class MockBundleContext implements BundleContext {
 
     void unregisterService(MockServiceRegistration<?> registration) {
         if (log.isDebugEnabled()) {
-            Object componentInstance = registration.getService();
+            Object componentInstance = registration.service;
             log.debug("Unregister {} ({}), bundleContext={}", componentInstance != null ? componentInstance.getClass() : "",
                     StringUtils.join(registration.getClasses(), ","), this);
         }
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
index 08b7ba9..2294611 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -46,7 +46,7 @@ class MockServiceRegistration<T> implements ServiceRegistration<T>, Comparable<M
 
     private final Long serviceId;
     private final Set<String> clazzes;
-    private final T service;
+    final T service;
     private final Hashtable<String, Object> properties;
     private final ServiceReference<T> serviceReference;
     private final MockBundleContext bundleContext;

[sling-org-apache-sling-testing-osgi-mock] 05/07: enable minimal debug logging for register/unregister

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch experimental/WTES-69-diagnosis
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit a2b958390a2e1f458baabd9572bd282b4829cfb8
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 08:35:57 2021 +0100

    enable minimal debug logging for register/unregister
---
 .../main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index 54dc455..ff66942 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -128,6 +128,7 @@ class MockBundleContext implements BundleContext {
     @SuppressWarnings("unchecked")
     @Override
     public ServiceRegistration registerService(final String[] clazzes, final Object service, final Dictionary properties) {
+        log.debug("Register {} ({}), bundleContext={}", service, clazzes, this);
         /*
         if (log.isDebugEnabled()) {
             log.debug("Register {} ({}), bundleContext={}", service.getClass().getName(), StringUtils.join(clazzes, ","), this);
@@ -206,6 +207,7 @@ class MockBundleContext implements BundleContext {
     }
 
     void unregisterService(MockServiceRegistration<?> registration) {
+        log.debug("Unregister {} ({}), bundleContext={}", this);
         /*
         if (log.isDebugEnabled()) {
             Object componentInstance = registration.service;