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 Summary
Enum Constants Enum Constant Description JCR_MOCK
Uses a simple JCR "in-memory" mock as underlying repository.JCR_OAK
Uses a real JCR Jackrabbit Oak repository.NONE
Provides resource resolver environment without any ResourceProvider.RESOURCERESOLVER_MOCK
Uses Sling "resourceresolver-mock" implementation, no underlying JCR repository.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull NodeTypeMode
getNodeTypeMode()
static ResourceResolverType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResourceResolverType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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.
-
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.
- 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.
- 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 Detail
-
values
public static ResourceResolverType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResourceResolverType c : ResourceResolverType.values()) System.out.println(c);
- 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 nameNullPointerException
- if the argument is null
-
getNodeTypeMode
@NotNull public @NotNull NodeTypeMode getNodeTypeMode()
- Returns:
- How JCR namespaces and node types have to be handled.
-
-