use of org.apache.sling.caconfig.resource.spi.ConfigurationResourceResolvingStrategy in project sling by apache.
the class DefaultConfigurationResourceResolvingStrategyTest method testGetResourceCollection_SkipJcrContent.
/**
* Ensure jcr:content nodes are not included in resource collection.
*/
@Test
public void testGetResourceCollection_SkipJcrContent() {
ConfigurationResourceResolvingStrategy underTest = context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
// build config resources
context.build().resource("/conf/site1/sling:test/feature/a").resource("/conf/site1/sling:test/feature/b").resource("/conf/site2/sling:test/feature/jcr:content");
assertThat(underTest.getResourceCollection(site1Page1, BUCKETS, "feature"), ResourceCollectionMatchers.paths("/conf/site1/sling:test/feature/a", "/conf/site1/sling:test/feature/b"));
}
use of org.apache.sling.caconfig.resource.spi.ConfigurationResourceResolvingStrategy in project sling by apache.
the class DefaultConfigurationResourceResolvingStrategyTest method testGetResourceCollection_Inherit1Level.
/**
* Resource inheritance with enabling list merging on inner-most context level.
* => merge resource lists from next level
*/
@Test
public void testGetResourceCollection_Inherit1Level() {
ConfigurationResourceResolvingStrategy underTest = context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
// build config resources
context.build().resource("/conf/site1/sling:test/feature", PROPERTY_CONFIG_COLLECTION_INHERIT, true).resource("/conf/site1/sling:test/feature/c").resource("/conf/site2/sling:test/feature", PROPERTY_CONFIG_COLLECTION_INHERIT, true).resource("/conf/site2/sling:test/feature/c").resource("/conf/site2/sling:test/feature/d").resource("/apps/conf/sling:test/feature/a").resource("/libs/conf/sling:test/feature/b");
assertThat(underTest.getResourceCollection(site1Page1, BUCKETS, "feature"), ResourceCollectionMatchers.paths("/conf/site1/sling:test/feature/c", "/apps/conf/sling:test/feature/a"));
assertThat(underTest.getResourceCollection(site2Page1, BUCKETS, "feature"), ResourceCollectionMatchers.paths("/conf/site2/sling:test/feature/c", "/conf/site2/sling:test/feature/d", "/apps/conf/sling:test/feature/a"));
}
Aggregations