Search in sources :

Example 1 with ResourceBuilderFactoryService

use of org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService in project sling by apache.

the class SlingContextImpl method registerDefaultServices.

/**
     * Default services that should be available for every unit test
     */
protected void registerDefaultServices() {
    // scripting services (required by sling models impl since 1.3.6)
    registerInjectActivateService(new ScriptEngineManagerFactory());
    registerInjectActivateService(new BindingsValuesProvidersByContextImpl());
    // sling models
    registerInjectActivateService(new ModelAdapterFactory());
    registerInjectActivateServiceByClassName("org.apache.sling.models.impl.FirstImplementationPicker", "org.apache.sling.models.impl.ResourceTypeBasedResourcePicker", "org.apache.sling.models.impl.injectors.BindingsInjector", "org.apache.sling.models.impl.injectors.ChildResourceInjector", "org.apache.sling.models.impl.injectors.OSGiServiceInjector", "org.apache.sling.models.impl.injectors.RequestAttributeInjector", "org.apache.sling.models.impl.injectors.ResourcePathInjector", "org.apache.sling.models.impl.injectors.SelfInjector", "org.apache.sling.models.impl.injectors.SlingObjectInjector", "org.apache.sling.models.impl.injectors.ValueMapInjector", "org.apache.sling.models.impl.via.BeanPropertyViaProvider", "org.apache.sling.models.impl.via.ChildResourceViaProvider", "org.apache.sling.models.impl.via.ForcedResourceTypeViaProvider", "org.apache.sling.models.impl.via.ResourceSuperTypeViaProvider");
    // other services
    registerService(SlingSettingsService.class, new MockSlingSettingService(DEFAULT_RUN_MODES));
    registerService(MimeTypeService.class, new MockMimeTypeService());
    registerInjectActivateService(new ResourceBuilderFactoryService());
    // scan for models defined via bundle headers in classpath
    ModelAdapterFactoryUtil.addModelsForManifestEntries(this.bundleContext());
}
Also used : ModelAdapterFactory(org.apache.sling.models.impl.ModelAdapterFactory) BindingsValuesProvidersByContextImpl(org.apache.sling.scripting.core.impl.BindingsValuesProvidersByContextImpl) ScriptEngineManagerFactory(org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory) MockSlingSettingService(org.apache.sling.testing.mock.sling.services.MockSlingSettingService) MockMimeTypeService(org.apache.sling.testing.mock.sling.services.MockMimeTypeService) ResourceBuilderFactoryService(org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService)

Aggregations

ModelAdapterFactory (org.apache.sling.models.impl.ModelAdapterFactory)1 ResourceBuilderFactoryService (org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService)1 BindingsValuesProvidersByContextImpl (org.apache.sling.scripting.core.impl.BindingsValuesProvidersByContextImpl)1 ScriptEngineManagerFactory (org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory)1 MockMimeTypeService (org.apache.sling.testing.mock.sling.services.MockMimeTypeService)1 MockSlingSettingService (org.apache.sling.testing.mock.sling.services.MockSlingSettingService)1