Search in sources :

Example 1 with ConfigurationMetadataProviderMultiplexerImpl

use of org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl in project sling by apache.

the class ConfigurationBindingsValueProviderTest method setUp.

@Before
public void setUp() {
    context.registerInjectActivateService(new ConfigurationMetadataProviderMultiplexerImpl());
    context.registerService(ConfigurationMetadataProvider.class, configMetadataProvider);
    when(configMetadataProvider.getConfigurationNames()).thenReturn(CONFIG_NAMES);
    when(bindings.containsKey(SlingBindings.REQUEST)).thenReturn(true);
    when(bindings.get(SlingBindings.REQUEST)).thenReturn(request);
    when(request.getResource()).thenReturn(resource);
    when(resource.adaptTo(ConfigurationBuilder.class)).thenReturn(configBuilder);
    when(configBuilder.name(anyString())).thenReturn(configBuilder);
    when(configBuilder.asValueMap()).thenReturn(VALUEMAP);
    when(configBuilder.asValueMapCollection()).thenReturn(ImmutableList.of(VALUEMAP));
    when(configMetadataProvider.getConfigurationMetadata("name1")).thenReturn(new ConfigurationMetadata("name1", ImmutableList.<PropertyMetadata<?>>of(), false));
    when(configMetadataProvider.getConfigurationMetadata("name.2")).thenReturn(new ConfigurationMetadata("name.2", ImmutableList.<PropertyMetadata<?>>of(), true));
}
Also used : ConfigurationMetadataProviderMultiplexerImpl(org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl) PropertyMetadata(org.apache.sling.caconfig.spi.metadata.PropertyMetadata) ConfigurationMetadata(org.apache.sling.caconfig.spi.metadata.ConfigurationMetadata) Before(org.junit.Before)

Example 2 with ConfigurationMetadataProviderMultiplexerImpl

use of org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl in project sling by apache.

the class ConfigurationTestUtils method registerConfigurationResolver.

/**
     * Register all services for {@link ConfigurationResolver}.
     * @param context Sling context
     */
public static ConfigurationResolver registerConfigurationResolver(SlingContext context, Object... properties) {
    ConfigurationResourceTestUtils.registerConfigurationResourceResolver(context);
    context.registerInjectActivateService(new ConfigurationManagementSettingsImpl());
    context.registerInjectActivateService(new DefaultConfigurationPersistenceStrategy());
    context.registerInjectActivateService(new ConfigurationPersistenceStrategyMultiplexerImpl());
    context.registerInjectActivateService(new DefaultConfigurationInheritanceStrategy());
    context.registerInjectActivateService(new ConfigurationInheritanceStrategyMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationOverrideMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationMetadataProviderMultiplexerImpl());
    return context.registerInjectActivateService(new ConfigurationResolverImpl(), properties);
}
Also used : ConfigurationOverrideMultiplexerImpl(org.apache.sling.caconfig.impl.override.ConfigurationOverrideMultiplexerImpl) ConfigurationMetadataProviderMultiplexerImpl(org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl) ConfigurationManagementSettingsImpl(org.apache.sling.caconfig.management.impl.ConfigurationManagementSettingsImpl) DefaultConfigurationInheritanceStrategy(org.apache.sling.caconfig.impl.def.DefaultConfigurationInheritanceStrategy) DefaultConfigurationPersistenceStrategy(org.apache.sling.caconfig.impl.def.DefaultConfigurationPersistenceStrategy) ConfigurationPersistenceStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ConfigurationPersistenceStrategyMultiplexerImpl)

Example 3 with ConfigurationMetadataProviderMultiplexerImpl

use of org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl in project sling by apache.

the class ConfigurationTestUtils method registerConfigurationResolverWithoutDefaultImpl.

/**
     * Register all services for {@link ConfigurationResolver}
     * without the default implementations of the multiplexed services.
     * @param context Sling context
     */
public static ConfigurationResolver registerConfigurationResolverWithoutDefaultImpl(SlingContext context, Object... properties) {
    ConfigurationResourceTestUtils.registerConfigurationResourceResolverWithoutDefaultImpl(context);
    context.registerInjectActivateService(new ConfigurationManagementSettingsImpl());
    context.registerInjectActivateService(new ConfigurationPersistenceStrategyMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationInheritanceStrategyMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationOverrideMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationMetadataProviderMultiplexerImpl());
    return context.registerInjectActivateService(new ConfigurationResolverImpl(), properties);
}
Also used : ConfigurationOverrideMultiplexerImpl(org.apache.sling.caconfig.impl.override.ConfigurationOverrideMultiplexerImpl) ConfigurationMetadataProviderMultiplexerImpl(org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl) ConfigurationManagementSettingsImpl(org.apache.sling.caconfig.management.impl.ConfigurationManagementSettingsImpl) ConfigurationPersistenceStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ConfigurationPersistenceStrategyMultiplexerImpl)

Aggregations

ConfigurationMetadataProviderMultiplexerImpl (org.apache.sling.caconfig.impl.metadata.ConfigurationMetadataProviderMultiplexerImpl)3 ConfigurationOverrideMultiplexerImpl (org.apache.sling.caconfig.impl.override.ConfigurationOverrideMultiplexerImpl)2 ConfigurationManagementSettingsImpl (org.apache.sling.caconfig.management.impl.ConfigurationManagementSettingsImpl)2 ConfigurationPersistenceStrategyMultiplexerImpl (org.apache.sling.caconfig.management.impl.ConfigurationPersistenceStrategyMultiplexerImpl)2 DefaultConfigurationInheritanceStrategy (org.apache.sling.caconfig.impl.def.DefaultConfigurationInheritanceStrategy)1 DefaultConfigurationPersistenceStrategy (org.apache.sling.caconfig.impl.def.DefaultConfigurationPersistenceStrategy)1 ConfigurationMetadata (org.apache.sling.caconfig.spi.metadata.ConfigurationMetadata)1 PropertyMetadata (org.apache.sling.caconfig.spi.metadata.PropertyMetadata)1 Before (org.junit.Before)1