@ConsumerType
public class UniqueRoot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
uniquePathPart |
Modifier | Constructor and Description |
---|---|
protected |
UniqueRoot(@NotNull SlingContextImpl context) |
Modifier and Type | Method and Description |
---|---|
@NotNull java.lang.String |
apps()
Gets (and creates if required) a unique path at
/apps/xxx . |
protected void |
cleanUp()
Cleanup is called when the unit test rule completes a unit test run.
|
@NotNull java.lang.String |
content()
Gets (and creates if required) a unique path at
/content/xxx . |
protected void |
deleteResources(org.apache.sling.api.resource.Resource... resources)
Deletes the given set of resources and commits afterwards.
|
protected org.apache.sling.api.resource.Resource |
getOrCreateResource(@NotNull java.lang.String path,
@NotNull java.lang.String primaryType)
Get or create resource with given JCR primary type
|
@NotNull java.lang.String |
libs()
Gets (and creates if required) a unique path at
/libs/xxx . |
protected UniqueRoot(@NotNull @NotNull SlingContextImpl context)
protected final org.apache.sling.api.resource.Resource getOrCreateResource(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.lang.String primaryType)
path
- PathprimaryType
- JCR primary type@NotNull public final @NotNull java.lang.String content()
/content/xxx
.
The path (incl. all children) is automatically removed when the unit test completes.@NotNull public final @NotNull java.lang.String apps()
/apps/xxx
.
The path (incl. all children) is automatically removed when the unit test completes.@NotNull public final @NotNull java.lang.String libs()
/libs/xxx
.
The path (incl. all children) is automatically removed when the unit test completes.protected void cleanUp()
protected final void deleteResources(@Nullable org.apache.sling.api.resource.Resource... resources)
resources
- Resources to be deletedCopyright © 2014–2021 wcm.io. All rights reserved.