This is an automated email from the ASF dual-hosted git repository.
henrykuijpers pushed a commit to branch
SLING-12391-resource-merger-with-negation-hides-local-resources-as-well
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourcemerger.git
The following commit(s) were added to
refs/heads/SLING-12391-resource-merger-with-negation-hides-local-resources-as-well
by this push:
new 5167953 SLING-12391 Additional test for local nodes without wildcard
and without negation (passes)
5167953 is described below
commit 516795300e4c74bf202a0d79d918628a32f04528
Author: KUIJPERS, Henry <[email protected]>
AuthorDate: Thu Jul 25 13:12:02 2024 +0200
SLING-12391 Additional test for local nodes without wildcard and without
negation (passes)
---
.../impl/CommonMergedResourceProviderTest.java | 26 +++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git
a/src/test/java/org/apache/sling/resourcemerger/impl/CommonMergedResourceProviderTest.java
b/src/test/java/org/apache/sling/resourcemerger/impl/CommonMergedResourceProviderTest.java
index 0bc1735..95b5460 100644
---
a/src/test/java/org/apache/sling/resourcemerger/impl/CommonMergedResourceProviderTest.java
+++
b/src/test/java/org/apache/sling/resourcemerger/impl/CommonMergedResourceProviderTest.java
@@ -515,7 +515,7 @@ public class CommonMergedResourceProviderTest {
}
@Test
- public void x() throws PersistenceException {
+ public void
testNodesReflectedInBaseStructureShouldBeRemovedWhenHideChildrenIsUsedAndNotIncludedInTheWildcardButLocalNodesShouldStillBePresent()
throws PersistenceException {
MockHelper.create(this.resolver)
// Set up the base structure, including a tab that is not
desired in the overlaid situation
.resource("/apps/base/test")
@@ -537,4 +537,28 @@ public class CommonMergedResourceProviderTest {
ResourceMatchers.name("expert")
));
}
+
+ @Test
+ public void
testNodesReflectedInBaseStructureShouldBeRemovedWhenHideChildrenIsUsedButLocalNodesShouldStillBePresent()
throws PersistenceException {
+ MockHelper.create(this.resolver)
+ // Set up the base structure, including a tab that is not
desired in the overlaid situation
+ .resource("/apps/base/test")
+ .resource("/apps/base/test/tabs")
+ .resource("/apps/base/test/tabs/basic")
+ .resource("/apps/base/test/tabs/advanced")
+ .resource("/apps/overlay/test")
+ .resource("/apps/overlay/test/tabs")
+ .p(MergedResourceConstants.PN_HIDE_CHILDREN, new
String[]{"basic"})
+ .resource("/apps/overlay/test/tabs/expert")
+ .commit();
+
+ // Ensure that the undesired tab is not found
+ final Resource tabsResource = this.provider.getResource(ctx,
"/merged/test/tabs", ResourceContext.EMPTY_CONTEXT, null);
+ Assert.assertNotNull(tabsResource);
+ final IteratorIterable<Resource> tabs = new
IteratorIterable<Resource>(this.provider.listChildren(ctx, tabsResource), true);
+ Assert.assertThat(tabs, Matchers.contains(
+ ResourceMatchers.name("advanced"),
+ ResourceMatchers.name("expert")
+ ));
+ }
}