Class UniqueRoot

java.lang.Object
org.apache.sling.testing.mock.sling.context.UniqueRoot
io.wcm.testing.mock.aem.context.UniqueRoot

@ProviderType public final class UniqueRoot extends org.apache.sling.testing.mock.sling.context.UniqueRoot
Manages unique root paths in JCR repository. This is important for resource resolver types like JCR_JACKRABBIT where the repository is not cleaned for each test run. This class provides unique root paths for each run, and cleans them up when done.
  • Field Summary

    Fields inherited from class org.apache.sling.testing.mock.sling.context.UniqueRoot

    uniquePathPart
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    dam()
    Gets (and creates if required) a unique path at /content/dam/xxx.

    Methods inherited from class org.apache.sling.testing.mock.sling.context.UniqueRoot

    apps, content, deleteResources, getOrCreateResource, libs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • dam

      public String dam()
      Gets (and creates if required) a unique path at /content/dam/xxx. The path (incl. all children) is automatically removed when the unit test completes.
      Returns:
      Unique content path
    • cleanUp

      protected void cleanUp()
      Overrides:
      cleanUp in class org.apache.sling.testing.mock.sling.context.UniqueRoot