You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/01/23 15:27:51 UTC

svn commit: r614542 - in /incubator/sling/trunk: commons/testing/ commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/ scripting/javascript/ scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/ scripting/javascript/s...

Author: bdelacretaz
Date: Wed Jan 23 06:27:42 2008
New Revision: 614542

URL: http://svn.apache.org/viewvc?rev=614542&view=rev
Log:
SLING-154 - automated tests for Scriptable JCR objects, work in progress

Added:
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java   (with props)
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java   (with props)
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java   (with props)
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java   (with props)
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java   (with props)
    incubator/sling/trunk/scripting/javascript/src/test/test-config/
    incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml   (with props)
Modified:
    incubator/sling/trunk/commons/testing/   (props changed)
    incubator/sling/trunk/commons/testing/pom.xml
    incubator/sling/trunk/scripting/javascript/   (props changed)
    incubator/sling/trunk/scripting/javascript/pom.xml
    incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoJavaScriptEngine.java

Propchange: incubator/sling/trunk/commons/testing/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jan 23 06:27:42 2008
@@ -0,0 +1,6 @@
+.classpath
+.project
+target
+.settings
+.externalToolBuilders
+derby.log

Modified: incubator/sling/trunk/commons/testing/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/pom.xml?rev=614542&r1=614541&r2=614542&view=diff
==============================================================================
--- incubator/sling/trunk/commons/testing/pom.xml (original)
+++ incubator/sling/trunk/commons/testing/pom.xml Wed Jan 23 06:27:42 2008
@@ -59,5 +59,10 @@
             <artifactId>org.apache.sling.jcr.api</artifactId>
             <version>2.0.0-incubator-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>

Added: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java (added)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java Wed Jan 23 06:27:42 2008
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.commons.testing.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.jcr.api.SlingRepository;
+
+/** Base class for tests which need a Repository. Uses static
+ *  variables to initialize it only once per test run.
+ */
+public class RepositoryTestBase extends TestCase {
+    private static SlingRepository repository;
+    protected Node testRoot;
+    protected Session session;
+    private int counter;
+    
+    private static class ShutdownThread extends Thread {
+        @Override
+        public void run() {
+            try {
+                RepositoryUtil.stopRepository();
+            } catch(Exception e) {
+                System.out.println("Exception in ShutdownThread:" + e);
+            }
+        }
+        
+    };
+    
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        if(session != null) {
+            session.logout();
+        }
+    }
+
+    /** Return a JCR Session, initialized on demand */ 
+    protected Session getSession() throws RepositoryException, NamingException {
+        if(session == null) {
+            session = getRepository().loginAdministrative(null);
+        }
+        return session;
+    }
+    
+    /** Return a test root node, created on demand, with a unique path */ 
+    protected Node getTestRootNode() throws RepositoryException, NamingException {
+        if(testRoot==null) {
+            final Node root = getSession().getRootNode();
+            final Node classRoot = root.addNode(getClass().getSimpleName()); 
+            testRoot = classRoot.addNode(System.currentTimeMillis() + "_" + (++counter));
+        }
+        return testRoot;
+    }
+
+    /** Return a Repository - first call initializes it, and a JVM
+     *  shutdown hook is registered to stop it
+     */
+    protected SlingRepository getRepository() throws RepositoryException, NamingException {
+        if(repository != null) {
+            return repository;
+        }
+        
+        synchronized (RepositoryTestBase.class) {
+            if(repository == null) {
+                RepositoryUtil.startRepository();
+                repository = RepositoryUtil.getRepository();
+                Runtime.getRuntime().addShutdownHook(new ShutdownThread());
+            }
+            return repository;
+        }
+    }
+}

Propchange: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryTestBase.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Propchange: incubator/sling/trunk/scripting/javascript/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jan 23 06:27:42 2008
@@ -2,3 +2,5 @@
 .project
 target
 .settings
+.externalToolBuilders
+derby.log

Modified: incubator/sling/trunk/scripting/javascript/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/pom.xml?rev=614542&r1=614541&r2=614542&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/javascript/pom.xml (original)
+++ incubator/sling/trunk/scripting/javascript/pom.xml Wed Jan 23 06:27:42 2008
@@ -87,6 +87,17 @@
             <version>2.0.0-incubator-SNAPSHOT</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.testing</artifactId>
+            <version>2.0.0-incubator-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>

Modified: incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoJavaScriptEngine.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoJavaScriptEngine.java?rev=614542&r1=614541&r2=614542&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoJavaScriptEngine.java (original)
+++ incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoJavaScriptEngine.java Wed Jan 23 06:27:42 2008
@@ -51,9 +51,13 @@
     public Object eval(Reader scriptReader, ScriptContext scriptContext)
             throws ScriptException {
         Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
-
-        SlingScriptHelper helper = (SlingScriptHelper) bindings.get(SlingBindings.SLING);
-        String scriptName = helper.getScript().getScriptResource().getPath();
+        String scriptName = "NO_SCRIPT_NAME";
+        {
+            SlingScriptHelper helper = (SlingScriptHelper) bindings.get(SlingBindings.SLING);
+            if(helper != null) {
+                scriptName = helper.getScript().getScriptResource().getPath();
+            }
+        }
 
         // wrap the reader in an EspReader for ESP scripts
         if (scriptName.endsWith(RhinoJavaScriptEngineFactory.ESP_SCRIPT_EXTENSION)) {

Added: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java (added)
+++ incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java Wed Jan 23 06:27:42 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting;
+
+import org.apache.sling.commons.testing.jcr.RepositoryTestBase;
+
+
+/** Base class for tests which need a Repository
+ *  and scripting functionality */
+public class RepositoryScriptingTestBase extends RepositoryTestBase {
+    protected ScriptEngineHelper script;
+    
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        script = new ScriptEngineHelper();
+    }
+
+}

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/RepositoryScriptingTestBase.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java (added)
+++ incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java Wed Jan 23 06:27:42 2008
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting;
+
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import javax.script.SimpleBindings;
+import javax.script.SimpleScriptContext;
+
+import org.apache.sling.scripting.javascript.RhinoJavaScriptEngineFactory;
+
+/** Helpers to run javascript code fragments in tests */
+public class ScriptEngineHelper {
+    private static ScriptEngine engine;
+
+    public static class Data extends HashMap<String, Object> {
+    }
+    
+    private static ScriptEngine getEngine() {
+        if(engine == null) {
+            synchronized (ScriptEngineHelper.class) {
+                engine = new RhinoJavaScriptEngineFactory().getScriptEngine(); 
+            }
+        }
+        return engine;
+    }
+    
+    public String evalToString(String javascriptCode) throws ScriptException {
+        return evalToString(javascriptCode, null);
+    }
+    
+    public String evalToString(String javascriptCode, Map<String, Object> data) throws ScriptException {
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw, true);
+        ScriptContext ctx = new SimpleScriptContext();
+        
+        final Bindings b = new SimpleBindings();
+        b.put("out", pw);
+        if(data != null) {
+            for(Map.Entry<String, Object> e : data.entrySet()) {
+                b.put(e.getKey(), e.getValue());
+            }
+        }
+        
+        ctx.setBindings(b, ScriptContext.ENGINE_SCOPE);
+        ctx.setWriter(sw);
+        ctx.setErrorWriter(new OutputStreamWriter(System.err));
+        getEngine().eval(javascriptCode, ctx);
+        return sw.toString();
+    }
+}

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/ScriptEngineHelper.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java (added)
+++ incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java Wed Jan 23 06:27:42 2008
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting;
+
+
+/** Verify that our test environment works */
+public class TestSetupTest extends RepositoryScriptingTestBase {
+    
+    /** Test our test repository setup */
+    public void testRootNode() throws Exception {
+        assertNotNull(getTestRootNode());
+    }
+    
+    /** Test our script engine setup */
+    public void testScripting() throws Exception {
+        assertEquals("something",script.evalToString("out.print('something')"));
+    }
+    
+    public void testScriptingWithData() throws Exception {
+        final ScriptEngineHelper.Data data = new ScriptEngineHelper.Data();
+        data.put("a", "A");
+        data.put("b", "B");
+        assertEquals("A1",script.evalToString("out.print(a + b.length)", data));
+    }
+}

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/TestSetupTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java (added)
+++ incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java Wed Jan 23 06:27:42 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting.wrapper;
+
+import org.apache.sling.scripting.RepositoryScriptingTestBase;
+import org.apache.sling.scripting.ScriptEngineHelper;
+
+/** Test the ScriptableNode class "live", by retrieving
+ *  Nodes from a Repository and executing javascript code
+ *  using them.
+ */
+public class ScriptableNodeTest extends RepositoryScriptingTestBase {
+
+    public void testPrimaryNodeType() throws Exception {
+        final ScriptEngineHelper.Data data = new ScriptEngineHelper.Data();
+        data.put("node", getTestRootNode());
+        assertEquals(
+                "nt:unstructured",
+                script.evalToString("out.print(node.primaryNodeType.name)", data)
+        );
+    }
+}

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml?rev=614542&view=auto
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml (added)
+++ incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml Wed Jan 23 06:27:42 2008
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<Repository>
+    <!--
+        virtual file system where the repository stores global state
+        (e.g. registered namespaces, custom node types, etc.)
+    -->
+    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+        <param name="path" value="${rep.home}/repository"/>
+    </FileSystem>
+
+    <!--
+        security configuration
+    -->
+    <Security appName="Jackrabbit">
+        <!--
+            access manager:
+            class: FQN of class implementing the AccessManager interface
+        -->
+        <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
+            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+        </AccessManager>
+
+        <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
+           <!-- anonymous user name ('anonymous' is the default value) -->
+           <param name="anonymousId" value="anonymous"/>
+           <!--
+              default user name to be used instead of the anonymous user
+              when no login credentials are provided (unset by default)
+           -->
+           <param name="defaultUserId" value="superuser"/>
+        </LoginModule>
+    </Security>
+
+    <!--
+        location of workspaces root directory and name of default workspace
+    -->
+    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+    <!--
+        workspace configuration template:
+        used to create the initial workspace if there's no workspace yet
+    -->
+    <Workspace name="Jackrabbit Core">
+        <!--
+            virtual file system of the workspace:
+            class: FQN of class implementing the FileSystem interface
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${wsp.home}"/>
+        </FileSystem>
+        <!--
+            persistence manager of the workspace:
+            class: FQN of class implementing the PersistenceManager interface
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+          <param name="schemaObjectPrefix" value="Jackrabbit Core_"/>
+        </PersistenceManager>
+        <!--
+            Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+        -->
+        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+            <param name="path" value="${wsp.home}/index"/>
+        </SearchIndex>
+    </Workspace>
+
+    <!--
+        Configures the versioning
+    -->
+    <Versioning rootPath="${rep.home}/version">
+        <!--
+            Configures the filesystem to use for versioning for the respective
+            persistence manager
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${rep.home}/version" />
+        </FileSystem>
+
+        <!--
+            Configures the persistence manager to be used for persisting version state.
+            Please note that the current versioning implementation is based on
+            a 'normal' persistence manager, but this could change in future
+            implementations.
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+          <param name="schemaObjectPrefix" value="version_"/>
+        </PersistenceManager>
+    </Versioning>
+
+    <!--
+        Search index for content that is shared repository wide
+        (/jcr:system tree, contains mainly versions)
+    -->
+    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+        <param name="path" value="${rep.home}/repository/index"/>
+    </SearchIndex>
+</Repository>
+

Propchange: incubator/sling/trunk/scripting/javascript/src/test/test-config/jackrabbit-test-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native