use of org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy in project sling by apache.
the class ConfigurationResourceResolvingStrategyMultiplexerImplTest method testWithDefaultStrategy.
@Test
public void testWithDefaultStrategy() {
context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
assertThat(underTest.getResource(site1Page1, BUCKETS, "test"), ResourceMatchers.path("/conf/site1/sling:test/test"));
assertThat(underTest.getResourceCollection(site1Page1, BUCKETS, "feature"), ResourceCollectionMatchers.paths("/conf/site1/sling:test/feature/c", "/apps/conf/sling:test/feature/a", "/libs/conf/sling:test/feature/b"));
assertThat(first(underTest.getResourceInheritanceChain(site1Page1, BUCKETS, "test")), ResourceMatchers.path("/conf/site1/sling:test/test"));
assertThat(first(underTest.getResourceCollectionInheritanceChain(site1Page1, BUCKETS, "feature")), ResourceCollectionMatchers.paths("/conf/site1/sling:test/feature/c", "/apps/conf/sling:test/feature/a", "/libs/conf/sling:test/feature/b"));
assertEquals("/conf/site1/sling:test/test", underTest.getResourcePath(site1Page1, BUCKET, "test"));
assertEquals("/conf/site1/sling:test/feature", underTest.getResourceCollectionParentPath(site1Page1, BUCKET, "feature"));
}
use of org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy in project sling by apache.
the class ContextPlugins method registerConfigurationResourceResolverDefaultImpl.
/**
* Register default implementations for for ConfigurationResourceResolver.
* @param context Sling context
*/
private static void registerConfigurationResourceResolverDefaultImpl(SlingContextImpl context) {
context.registerInjectActivateService(new DefaultContextPathStrategy());
context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
}
use of org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy in project sling by apache.
the class ConfigurationResourceTestUtils method registerConfigurationResourceResolver.
/**
* Register all services for {@link ConfigurationResourceResolver}.
* @param context Sling context
*/
public static ConfigurationResourceResolver registerConfigurationResourceResolver(SlingContext context) {
context.registerInjectActivateService(new DefaultContextPathStrategy());
context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
context.registerInjectActivateService(new ConfigurationResourceResolvingStrategyMultiplexerImpl());
return context.registerInjectActivateService(new ConfigurationResourceResolverImpl());
}
Aggregations