@ConsumerType
public class AemContextImpl
extends org.apache.sling.testing.mock.sling.context.SlingContextImpl
AemContext
JUnit rule.Constructor and Description |
---|
AemContextImpl() |
Modifier and Type | Method and Description |
---|---|
com.day.cq.dam.api.AssetManager |
assetManager() |
ContentBuilder |
create() |
com.day.cq.wcm.api.Page |
currentPage() |
com.day.cq.wcm.api.Page |
currentPage(com.day.cq.wcm.api.Page page)
Set current Page in request (via
ComponentContext ). |
com.day.cq.wcm.api.Page |
currentPage(String pagePath)
Set current Page in request (via
ComponentContext ). |
protected org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory() |
com.day.cq.wcm.api.PageManager |
pageManager() |
protected void |
registerDefaultServices() |
protected void |
setResourceResolverType(org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType) |
protected void |
setUp() |
protected void |
tearDown() |
UniqueRoot |
uniqueRoot()
Create unique root paths for unit tests (and clean them up after the test run automatically).
|
addModelsForClasses, addModelsForClasses, addModelsForPackage, addModelsForPackage, build, currentResource, currentResource, currentResource, load, load, registerAdapter, registerAdapter, request, requestPathInfo, resourceResolver, resourceResolverType, response, runMode, setResourceResolverFactoryActivatorProps, slingScriptHelper
bundleContext, componentContext, getService, getServices, registerInjectActivateService, registerInjectActivateService, registerInjectActivateService, registerService, registerService, registerService, registerService
protected void registerDefaultServices()
registerDefaultServices
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
protected void setResourceResolverType(org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
setResourceResolverType
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
protected org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory()
newResourceResolverFactory
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
protected void setUp()
setUp
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
protected void tearDown()
tearDown
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
public com.day.cq.wcm.api.PageManager pageManager()
public com.day.cq.dam.api.AssetManager assetManager()
public ContentBuilder create()
create
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
public com.day.cq.wcm.api.Page currentPage()
ComponentContext
. If none is set the page containing the current resource.
Null if no containing page exists.public com.day.cq.wcm.api.Page currentPage(String pagePath)
ComponentContext
).
This also sets the current resource to the content resource of the page.
You can set it to a different resources afterwards if required.pagePath
- Page pathpublic com.day.cq.wcm.api.Page currentPage(com.day.cq.wcm.api.Page page)
ComponentContext
).
This also sets the current resource to the content resource of the page.
You can set it to a different resources afterwards if required.page
- Pagepublic UniqueRoot uniqueRoot()
uniqueRoot
in class org.apache.sling.testing.mock.sling.context.SlingContextImpl
Copyright © 2014–2018 wcm.io. All rights reserved.