Enum ResourceResolverType

java.lang.Object
java.lang.Enum<ResourceResolverType>
org.apache.sling.testing.mock.sling.ResourceResolverType
All Implemented Interfaces:
Serializable, Comparable<ResourceResolverType>

public enum ResourceResolverType extends Enum<ResourceResolverType>
The resource resolver mock implementation supports different underlying repository implementations.
  • Enum Constant Details

    • RESOURCERESOLVER_MOCK

      public static final ResourceResolverType RESOURCERESOLVER_MOCK
      Uses Sling "resourceresolver-mock" implementation, no underlying JCR repository.
      • Simulates an In-Memory resource tree, does not provide adaptions to JCR.
      • You can use it to make sure the code you want to test does not contain references to JCR API.
      • Behaves slightly different from JCR resource mapping e.g. handling binary and date values.
      • This resource resolver type is very fast.
    • RESOURCEPROVIDER_MOCK

      public static final ResourceResolverType RESOURCEPROVIDER_MOCK
      Uses Sling "resourceresolver-mock" implementation, no underlying JCR repository.
      • Uses the real Sling Resource Resolver and JCR Resource mapping implementation. This allows using multiple resource providers and loading folders for JSON or FileVault XML content.
      • Simulates an In-Memory resource tree, does not provide adaptions to JCR.
      • You can use it to make sure the code you want to test does not contain references to JCR API.
      • Behaves slightly different from JCR resource mapping e.g. handling binary and date values.
      • This resource resolver type is quite fast.
    • JCR_MOCK

      public static final ResourceResolverType JCR_MOCK
      Uses a simple JCR "in-memory" mock as underlying repository.
      • Uses the real Sling Resource Resolver and JCR Resource mapping implementation. This allows using multiple resource providers and loading folders for JSON or FileVault XML content.
      • The mock JCR implementation from Apache Sling is used.
      • It supports the most important, but not all JCR features. Extended features like Versioning, Eventing, Search, Transaction handling etc. are not supported.
      • This resource resolver type is quite fast.
    • JCR_OAK

      public static final ResourceResolverType JCR_OAK
      Uses a real JCR Jackrabbit Oak repository.
      • Uses the real Sling Resource Resolver and JCR Resource mapping implementation. This allows using multiple resource providers and loading folders for JSON or FileVault XML content.
      • The JCR repository is started on first access, this may take some seconds.
      • The MemoryNodeStore implementation is used, with no customizations.
    • NONE

      public static final ResourceResolverType NONE
      Provides resource resolver environment without any ResourceProvider. You have to register one yourself to do anything useful with it.
      • Uses the real Sling Resource Resolver implementation.
      • The performance of this resource resolver type depends on the resource provider registered.
  • Method Details

    • values

      public static ResourceResolverType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ResourceResolverType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getNodeTypeMode

      @NotNull public @NotNull NodeTypeMode getNodeTypeMode()
      Returns:
      How JCR namespaces and node types have to be handled.