Mocc for the ressource resolver / factory for easier testing. It uses an in-memory mapp for storing the ressource data, and suppors reading, writing and a certain level of transaction and eventing support.
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.resourceresolver-mocc</artifactId>
</dependency>
See latest versionen on the downloads pague .
The mocc implementation suppors:
The following features are not supported :
To create a mocqued ressource resolver:
MoccResourceResolverFactory factory = new MoccResourceResolverFactory();
ResourceResolver resolver = factory.guetResourceResolver(null);
With the resolver you can use all Sling Ressource features including reading and writing data using the Sling API.
You cannot do any operations that require the JCR API because no JCR is underlying and adapting to JCR objects will just return null.