public final class MockSling
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static @NotNull ResourceResolverType |
DEFAULT_RESOURCERESOLVER_TYPE
Default resource resolver type is
ResourceResolverType.RESOURCERESOLVER_MOCK . |
Modifier and Type | Method and Description |
---|---|
static void |
clearAdapterManagerBundleContext()
Clear adapter registrations..
|
static @NotNull org.apache.sling.api.resource.ResourceResolver |
newResourceResolver(@NotNull org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver instance using
DEFAULT_RESOURCERESOLVER_TYPE . |
static @NotNull org.apache.sling.api.resource.ResourceResolver |
newResourceResolver(@NotNull ResourceResolverType type,
@NotNull org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver instance.
|
static @NotNull org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory(@NotNull org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver factory instance.
|
static @NotNull org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory(@NotNull ResourceResolverType type,
@NotNull org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver factory instance.
|
static @NotNull org.apache.sling.api.scripting.SlingScriptHelper |
newSlingScriptHelper(@NotNull org.osgi.framework.BundleContext bundleContext)
Creates a new sling script helper instance using
DEFAULT_RESOURCERESOLVER_TYPE for the resource resolver. |
static @NotNull org.apache.sling.api.scripting.SlingScriptHelper |
newSlingScriptHelper(@NotNull org.apache.sling.api.SlingHttpServletRequest request,
@NotNull org.apache.sling.api.SlingHttpServletResponse response,
@NotNull org.osgi.framework.BundleContext bundleContext)
Creates a new sling script helper instance.
|
static void |
setAdapterManagerBundleContext(@NotNull org.osgi.framework.BundleContext bundleContext)
Set bundle context for adapter manager.
|
@NotNull public static final @NotNull ResourceResolverType DEFAULT_RESOURCERESOLVER_TYPE
ResourceResolverType.RESOURCERESOLVER_MOCK
.@NotNull public static @NotNull org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory(@NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
bundleContext
- Bundle context@NotNull public static @NotNull org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory(@NotNull @NotNull ResourceResolverType type, @NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
type
- Type of underlying repository.bundleContext
- Bundle context@NotNull public static @NotNull org.apache.sling.api.resource.ResourceResolver newResourceResolver(@NotNull @NotNull ResourceResolverType type, @NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
type
- Type of underlying repository.bundleContext
- Bundle context@NotNull public static @NotNull org.apache.sling.api.resource.ResourceResolver newResourceResolver(@NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
DEFAULT_RESOURCERESOLVER_TYPE
.bundleContext
- Bundle context@NotNull public static @NotNull org.apache.sling.api.scripting.SlingScriptHelper newSlingScriptHelper(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
request
- Requestresponse
- ResponsebundleContext
- Bundle context@NotNull public static @NotNull org.apache.sling.api.scripting.SlingScriptHelper newSlingScriptHelper(@NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
DEFAULT_RESOURCERESOLVER_TYPE
for the resource resolver.bundleContext
- Bundle contextpublic static void setAdapterManagerBundleContext(@NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
bundleContext
- OSGi bundle contextpublic static void clearAdapterManagerBundleContext()
Copyright © 2014–2021 wcm.io. All rights reserved.