@ProviderType
public final class SlingContext
extends org.apache.sling.testing.mock.sling.context.SlingContextImpl
implements org.junit.rules.TestRule
SlingContextBuilder alternatively to the constructors on this class - it offers
more options and fine-grained control about setting up the test context.| Constructor and Description |
|---|
SlingContext()
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback)
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback,
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
Initialize Sling context with resource resolver type.
|
SlingContext(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback)
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback,
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
Initialize Sling context with resource resolver type.
|
SlingContext(@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
Initialize Sling context with resource resolver type.
|
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
addModelsForClasses, addModelsForClasses, addModelsForPackage, addModelsForPackage, build, create, currentResource, currentResource, currentResource, load, load, newResourceResolverFactory, registerAdapter, registerAdapter, registerDefaultServices, request, requestPathInfo, resolveSlingBindingProperty, resourceResolver, resourceResolverType, response, runMode, setRegisterSlingModelsFromClassPath, setResourceResolverFactoryActivatorProps, setResourceResolverType, setUp, slingScriptHelper, tearDown, uniqueRootbundleContext, componentContext, getService, getServices, registerInjectActivateService, registerInjectActivateService, registerInjectActivateService, registerService, registerService, registerService, registerServicepublic SlingContext()
MockSling.DEFAULT_RESOURCERESOLVER_TYPE.public SlingContext(@NotNull
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
resourceResolverType - Resource resolver type.public SlingContext(@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback)
MockSling.DEFAULT_RESOURCERESOLVER_TYPE.T - context typeafterSetUpCallback - Allows the application to register an own callback function that is called after the built-in setup rules are executed.public SlingContext(@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback,
@NotNull
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
T - context typeafterSetUpCallback - Allows the application to register an own callback function that is called after the built-in setup rules are executed.resourceResolverType - Resource resolver type.public SlingContext(@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback)
MockSling.DEFAULT_RESOURCERESOLVER_TYPE.U - context typeV - context typeafterSetUpCallback - Allows the application to register an own callback function that is called after the built-in setup rules are executed.beforeTearDownCallback - Allows the application to register an own callback function that is called before the built-in teardown rules are executed.public SlingContext(@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
@NotNull
@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback,
@NotNull
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
U - context typeV - context typeafterSetUpCallback - Allows the application to register an own callback function that is called after the built-in setup rules are executed.beforeTearDownCallback - Allows the application to register an own callback function that is called before the built-in teardown rules are executed.resourceResolverType - Resource resolver type.Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.