Search in sources :

Example 1 with DefaultConfigurationResourceResolvingStrategy

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"));
}
Also used : DefaultConfigurationResourceResolvingStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy) Test(org.junit.Test)

Example 2 with DefaultConfigurationResourceResolvingStrategy

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());
}
Also used : DefaultConfigurationResourceResolvingStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy) DefaultContextPathStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy)

Example 3 with 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());
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl) DefaultConfigurationResourceResolvingStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy) DefaultContextPathStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy)

Aggregations

DefaultConfigurationResourceResolvingStrategy (org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy)3 DefaultContextPathStrategy (org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy)2 ContextPathStrategyMultiplexerImpl (org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl)1 Test (org.junit.Test)1