You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2026/10/14 21:08:09 UTC
(sling-org-apache-sling-i18n) 03/03: SLING-13393 add test description
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a commit to branch SLING-13393
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git
commit 33d9e91dc49979567d251677795009d29c4179a5
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Wed Oct 14 23:06:45 2026 +0200
SLING-13393 add test description
---
.../impl/ConcurrentJcrResourceBundleLoadingTest.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/sling/i18n/impl/ConcurrentJcrResourceBundleLoadingTest.java b/src/test/java/org/apache/sling/i18n/impl/ConcurrentJcrResourceBundleLoadingTest.java
index 2c170aa..a078cd2 100644
--- a/src/test/java/org/apache/sling/i18n/impl/ConcurrentJcrResourceBundleLoadingTest.java
+++ b/src/test/java/org/apache/sling/i18n/impl/ConcurrentJcrResourceBundleLoadingTest.java
@@ -322,7 +322,8 @@ public class ConcurrentJcrResourceBundleLoadingTest {
}
/**
- * Verify that no exception occurs if requests come in during deactivate
+ * Pauses a lookup before repository loading, then deactivates the provider.
+ * The lookup may complete, but neither it nor a later lookup may leave a service registered.
*/
@Test
public void loadBundlesDuringDeactivateRace() throws Exception {
@@ -351,11 +352,19 @@ public class ConcurrentJcrResourceBundleLoadingTest {
}
}
+ /**
+ * Deactivates while a new service's registration callback is blocked, before
+ * registry publication. The completed lookup must leave no registered service.
+ */
@Test
public void registrationDuringDeactivateDoesNotLeaveServices() throws Exception {
assertRegistrationDuringDeactivate(false);
}
+ /**
+ * Deactivates while a replacement's registration callback is blocked.
+ * Both the original and replacement services must be unregistered exactly once.
+ */
@Test
public void replacementDuringDeactivateDoesNotLeaveServices() throws Exception {
assertRegistrationDuringDeactivate(true);
@@ -401,6 +410,10 @@ public class ConcurrentJcrResourceBundleLoadingTest {
}
}
+ /**
+ * Triggers deactivation synchronously from a registration listener.
+ * Reentrant closure must prevent the returning registration from leaking a service.
+ */
@Test
public void deactivateFromRegistrationCallbackDoesNotLeaveServices() throws Exception {
ServiceListener listener = event -> {
@@ -417,6 +430,10 @@ public class ConcurrentJcrResourceBundleLoadingTest {
}
}
+ /**
+ * Pauses retirement of the original service while deactivation cleans up the
+ * registry. Overlapping reload and shutdown must unregister each service exactly once.
+ */
@Test
public void replacementRetirementDuringDeactivateUnregistersEachServiceOnce() throws Exception {
provider.getResourceBundle(Locale.ENGLISH);