Package org.apache.sling.testing.mock.sling

# 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.
`RESOURCEPROVIDER_MOCK`
Uses Sling "resourceresolver-mock" implementation, no underlying JCR repository.
`RESOURCERESOLVER_MOCK`
Uses Sling "resourceresolver-mock" implementation, no underlying JCR repository.

## Method Summary

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.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## 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.