@ProviderType public final class SlingContext extends 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.contentBuilder, contentLoader, contentLoaderAutoCommit, request, resourceBuilder, resourceResolver, resourceResolverFactory, resourceResolverType, response, slingScriptHelper, uniqueRoot| Constructor and Description |
|---|
SlingContext()
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback)
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback,
ResourceResolverType resourceResolverType)
Initialize Sling context with resource resolver type.
|
SlingContext(org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback)
Initialize Sling context with default resource resolver type:
MockSling.DEFAULT_RESOURCERESOLVER_TYPE. |
SlingContext(org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback,
ResourceResolverType resourceResolverType)
Initialize Sling context with resource resolver type.
|
SlingContext(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, resourceResolver, resourceResolverType, response, runMode, setResourceResolverFactoryActivatorProps, setResourceResolverType, setUp, slingScriptHelper, tearDown, uniqueRootbundleContext, componentContext, getService, getServices, registerInjectActivateService, registerInjectActivateService, registerInjectActivateService, registerService, registerService, registerService, registerServicepublic SlingContext()
MockSling.DEFAULT_RESOURCERESOLVER_TYPE.public SlingContext(ResourceResolverType resourceResolverType)
resourceResolverType - Resource resolver type.public SlingContext(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(org.apache.sling.testing.mock.osgi.context.ContextCallback<T> afterSetUpCallback,
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(org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
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(org.apache.sling.testing.mock.osgi.context.ContextCallback<U> afterSetUpCallback,
org.apache.sling.testing.mock.osgi.context.ContextCallback<V> beforeTearDownCallback,
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–2017 The Apache Software Foundation. All rights reserved.