You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2015/09/29 00:21:21 UTC
svn commit: r1705788 -
/sling/site/trunk/content/documentation/development/sling-mock.mdtext
Author: sseifert
Date: Mon Sep 28 22:21:19 2015
New Revision: 1705788
URL: http://svn.apache.org/viewvc?rev=1705788&view=rev
Log:
SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
SLING-5067 sling-mock: "uniqueRoot()" to simplify creation and cleanup of unique root paths in repository
Modified:
sling/site/trunk/content/documentation/development/sling-mock.mdtext
Modified: sling/site/trunk/content/documentation/development/sling-mock.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/sling-mock.mdtext?rev=1705788&r1=1705787&r2=1705788&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/sling-mock.mdtext (original)
+++ sling/site/trunk/content/documentation/development/sling-mock.mdtext Mon Sep 28 22:21:19 2015
@@ -136,48 +136,47 @@ Resource resolver types currently suppor
* The performance of this resource resolver type depends on the resource provider registered.
* This is useful if you want to test your own resource provides mapped to root without any JCR.
-**JCR_JACKRABBIT**
+**JCR_OAK**
-* Uses a real JCR Jackrabbit implementation (not Oak) as provided by [sling/commons/testing][sling-commons-testing]
+* Uses a real JCR Jackrabbit Oak implementation based on the `MemoryNodeStore`
* Full JCR/Sling features supported e.g. observations manager, transactions, versioning
* Uses the productive [Sling JCR resource provider implementation][jcr-resource] internally to do the Resource-JCR mapping
-* Takes some seconds for startup on the first access
-* All node types that are used when reading/writing data have to be registered
+* Takes some seconds for startup on the first access
+* Node types defined in OSGi bundle header 'Sling-Nodetypes' found in MANIFEST.MF files in the classpath are registered automatically.
To use this type you have to declare an additional dependency in your test project:
#!xml
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.sling-mock-jackrabbit</artifactId>
+ <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
<scope>test</scope>
</dependency>
See latest version on the [downloads page](/downloads.cgi).
-**JCR_OAK**
+**JCR_JACKRABBIT**
-* Uses a real JCR Jackrabbit Oak implementation based on the `MemoryNodeStore`
+* Uses a real JCR Jackrabbit implementation (not Oak) as provided by [sling/commons/testing][sling-commons-testing]
* Full JCR/Sling features supported e.g. observations manager, transactions, versioning
* Uses the productive [Sling JCR resource provider implementation][jcr-resource] internally to do the Resource-JCR mapping
* Takes some seconds for startup on the first access
-* All node types that are used when reading/writing data have to be registered
+* Node types defined in OSGi bundle header 'Sling-Nodetypes' found in MANIFEST.MF files in the classpath are registered automatically.
To use this type you have to declare an additional dependency in your test project:
#!xml
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
+ <artifactId>org.apache.sling.testing.sling-mock-jackrabbit</artifactId>
<scope>test</scope>
</dependency>
-This version is not yet released.
+See latest version on the [downloads page](/downloads.cgi).
-_Remarks on the JCR_JACKRABBIT and JCR_OAK types:_
+_Remarks on the JCR_JACKRABBIT type:_
-* The repository is not cleared for each unit test, so make sure to use a unique node path for each unit test.
-* To import Sling content you have to fully register all node types required for the data
+* The repository is not cleared for each unit test, so make sure to use a unique node path for each unit test. You may use the `uniquePath()` helper object of the SlingContext rule for this.
* The [sling/commons/testing][sling-commons-testing] dependency introduces a lot of further dependencies from
jackrabbit and others, be careful that they do not conflict and are imported in the right order in your test project