incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r590071 - in /incubator/sling/trunk/event: ./ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/sling/ src/test/java/org/apache/sling/event/ src/test/java/org/apache/sling/event/impl/ src/test/te...
Date Tue, 30 Oct 2007 13:49:15 GMT
Author: cziegeler
Date: Tue Oct 30 06:49:12 2007
New Revision: 590071

URL: http://svn.apache.org/viewvc?rev=590071&view=rev
Log:
Add some junit tests for the eventing stuff.

Added:
    incubator/sling/trunk/event/src/test/
    incubator/sling/trunk/event/src/test/java/
    incubator/sling/trunk/event/src/test/java/org/
    incubator/sling/trunk/event/src/test/java/org/apache/
    incubator/sling/trunk/event/src/test/java/org/apache/sling/
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java  
(with props)
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
  (with props)
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
  (with props)
    incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
  (with props)
    incubator/sling/trunk/event/src/test/test-config/
    incubator/sling/trunk/event/src/test/test-config/repository-derby.xml   (with props)
Modified:
    incubator/sling/trunk/event/pom.xml

Modified: incubator/sling/trunk/event/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/pom.xml?rev=590071&r1=590070&r2=590071&view=diff
==============================================================================
--- incubator/sling/trunk/event/pom.xml (original)
+++ incubator/sling/trunk/event/pom.xml Tue Oct 30 06:49:12 2007
@@ -110,5 +110,26 @@
             <artifactId>sling-scheduler</artifactId>
             <version>2.0.0-incubator-SNAPSHOT</version>
         </dependency>
+    <!-- Testing -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jmock</groupId>
+            <artifactId>jmock-junit4</artifactId>
+            <version>2.2.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-core</artifactId>
+        </dependency>
     </dependencies>
 </project>

Added: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java?rev=590071&view=auto
==============================================================================
--- incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java (added)
+++ incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java Tue
Oct 30 06:49:12 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.event;
+
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.osgi.service.event.Event;
+
+/**
+ * Tests for the EventUtil utility methods.
+ */
+public class EventUtilTest {
+
+    @Test public void testDistributeFlag() {
+        final Event distributableEvent = EventUtil.createDistributableEvent("some/topic",
null);
+        assertTrue(EventUtil.shouldDistribute(distributableEvent));
+        final Event nonDistributableEvent = new Event("another/topic", null);
+        assertFalse(EventUtil.shouldDistribute(nonDistributableEvent));
+    }
+
+    @Test public void testLocalFlag() {
+        final Event localEvent = new Event("local/event", null);
+        assertTrue(EventUtil.isLocal(localEvent));
+        final Properties props = new Properties();
+        props.put(EventUtil.PROPERTY_APPLICATION, "application1");
+        final Event remoteEvent = new Event("remote/event", props);
+        assertFalse(EventUtil.isLocal(remoteEvent));
+    }
+}

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/EventUtilTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java?rev=590071&view=auto
==============================================================================
--- incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
(added)
+++ incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
Tue Oct 30 06:49:12 2007
@@ -0,0 +1,128 @@
+/*
+ * 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.event.impl;
+
+import static org.junit.Assert.*;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.observation.EventListenerIterator;
+
+import org.apache.sling.core.Constants;
+import org.apache.sling.jcr.SlingRepository;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.junit.runner.RunWith;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventAdmin;
+
+@RunWith(JMock.class)
+public abstract class AbstractRepositoryEventHandlerTest {
+
+    protected AbstractRepositoryEventHandler handler;
+
+    protected static final String REPO_PATH = "/test/events";
+    protected static final String SLING_ID = "4711";
+    protected static final int CLEANUP_PERIOD = 10000;
+
+    protected static Session session;
+
+    protected abstract Mockery getMockery();
+
+    protected Dictionary<String, Object> getComponentConfig() {
+        final Dictionary<String, Object> config = new Hashtable<String, Object>();
+        config.put(AbstractRepositoryEventHandler.CONFIG_PROPERTY_REPO_PATH, REPO_PATH);
+        config.put(AbstractRepositoryEventHandler.CONFIG_PROPERTY_CLEANUP_PERIOD, CLEANUP_PERIOD);
+
+        return config;
+    }
+
+    @org.junit.BeforeClass public static void setupRepository() throws Exception {
+        RepositoryUtil.startRepository();
+        final SlingRepository repository = RepositoryUtil.getRepository();
+        session = repository.loginAdministrative(repository.getDefaultWorkspace());
+        assertTrue(RepositoryUtil.registerNodeType(session, DistributingEventHandler.class.getResourceAsStream("/SLING-INF/nodetypes/event.cnd")));
+    }
+
+    @org.junit.AfterClass public static void shutdownRepository() throws Exception {
+        RepositoryUtil.stopRepository();
+    }
+
+    @org.junit.Before public void setup() throws Exception {
+        this.handler.repository = RepositoryUtil.getRepository();
+
+        // the event admin
+        final EventAdmin eventAdmin = this.getMockery().mock(EventAdmin.class);
+        this.handler.eventAdmin = eventAdmin;
+        this.getMockery().checking(new Expectations() {{
+            allowing(eventAdmin).postEvent(with(any(Event.class)));
+            allowing(eventAdmin).sendEvent(with(any(Event.class)));
+        }});
+
+        // lets set up the bundle context with the sling id
+        final BundleContext bundleContext = this.getMockery().mock(BundleContext.class);
+        this.getMockery().checking(new Expectations() {{
+            allowing(bundleContext).getProperty(Constants.SLING_ID);
+            will(returnValue(SLING_ID));
+        }});
+
+        // lets set up the component configuration
+        final Dictionary<String, Object> componentConfig = this.getComponentConfig();
+
+        // lets set up the compnent context
+        final ComponentContext componentContext = this.getMockery().mock(ComponentContext.class);
+        this.getMockery().checking(new Expectations() {{
+            allowing(componentContext).getBundleContext();
+            will(returnValue(bundleContext));
+            allowing(componentContext).getProperties();
+            will(returnValue(componentConfig));
+        }});
+
+        this.handler.activate(componentContext);
+    }
+
+    @org.junit.After public void shutdown() throws Exception {
+        ComponentContext componentContext = this.getMockery().mock(ComponentContext.class);
+        this.handler.deactivate(componentContext);
+    }
+
+    @org.junit.Test public void testSetup() throws RepositoryException {
+        assertEquals(this.handler.applicationId, SLING_ID);
+        assertEquals(this.handler.cleanupPeriod, CLEANUP_PERIOD);
+        assertEquals(this.handler.repositoryPath, REPO_PATH);
+        assertNotNull(this.handler.session);
+        final EventListenerIterator iter = this.handler.session.getWorkspace().getObservationManager().getRegisteredEventListeners();
+        boolean found = false;
+        while ( !found && iter.hasNext() ) {
+            final javax.jcr.observation.EventListener listener = iter.nextEventListener();
+            found = (listener == this.handler);
+        }
+        assertTrue("Handler is not registered as event listener.", found);
+    }
+
+    @org.junit.Test public void testPathCreation() throws RepositoryException {
+        assertTrue(session.itemExists(REPO_PATH));
+    }
+}

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/AbstractRepositoryEventHandlerTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java?rev=590071&view=auto
==============================================================================
--- incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
(added)
+++ incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
Tue Oct 30 06:49:12 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.event.impl;
+
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class DistributingEventHandlerTest extends AbstractRepositoryEventHandlerTest {
+
+    protected Mockery context;
+
+    public DistributingEventHandlerTest() {
+        this.handler = new DistributingEventHandler();
+        this.context = new JUnit4Mockery();
+    }
+
+    @Override
+    protected Mockery getMockery() {
+        return this.context;
+    }
+
+
+}

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/DistributingEventHandlerTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java?rev=590071&view=auto
==============================================================================
--- incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
(added)
+++ incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
Tue Oct 30 06:49:12 2007
@@ -0,0 +1,194 @@
+/*
+ * 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.event.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Hashtable;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.Workspace;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
+import org.apache.jackrabbit.core.jndi.RegistryHelper;
+import org.apache.sling.jcr.SlingRepository;
+
+/**
+* Utility class for managing JCR repositories.
+*/
+public class RepositoryUtil {
+
+    public static final String REPOSITORY_NAME = "repositoryTest";
+    public static final String ADMIN_NAME = "admin";
+    public static final String ADMIN_PASSWORD = "admin";
+    public static final String CONTEXT_FACTORY = "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory";
+    public static final String PROVIDER_URL = "localhost";
+    public static final String CONFIG_FILE = "./src/test/test-config/repository-derby.xml";
+    public static final String HOME_DIR = "target/repository";
+
+    protected static InitialContext getInitialContext() throws NamingException {
+        final Hashtable<String, String> env = new Hashtable<String, String>();
+        env.put(Context.INITIAL_CONTEXT_FACTORY, CONTEXT_FACTORY);
+        env.put(Context.PROVIDER_URL, PROVIDER_URL);
+        return new InitialContext(env);
+    }
+
+    /**
+     * Start a new repository
+     *
+     * @throws RepositoryException when it is not possible to start the repository.
+     * @throws NamingException
+     */
+    public static void startRepository()
+    throws RepositoryException, NamingException {
+        RegistryHelper.registerRepository(getInitialContext(), REPOSITORY_NAME, CONFIG_FILE,
HOME_DIR, true);
+    }
+
+
+    /**
+     * Stop a repository.
+     *
+     * @throws RepositoryException when it is not possible to stop the repository
+     * @throws NamingException
+     */
+    public static void stopRepository() throws RepositoryException, NamingException {
+        RegistryHelper.unregisterRepository(getInitialContext(), REPOSITORY_NAME);
+    }
+
+    /**
+     * Get a repository
+     *
+     * @return a JCR repository reference
+     *
+     * @throws RepositoryException when it is not possible to get the repository.
+     *         Before calling this method, the repository has to be registered (@see RepositoryUtil#registerRepository(String,
String, String)
+     * @throws NamingException
+     */
+    public static SlingRepository getRepository() throws RepositoryException, NamingException
{
+        return new RepositoryWrapper((Repository) getInitialContext().lookup(REPOSITORY_NAME));
+    }
+
+    /**
+     * Registers node types from the CND file read from the <code>source</code>
+     * with the node type manager available from the given <code>session</code>.
+     * <p>
+     * The <code>NodeTypeManager</code> returned by the <code>session</code>'s
+     * workspace is expected to be of type
+     * <code>org.apache.jackrabbit.api.JackrabbitNodeTypeManager</code> for
+     * the node type registration to succeed.
+     * <p>
+     * This method is not synchronized. It is up to the calling method to
+     * prevent paralell execution.
+     *
+     * @param session The <code>Session</code> providing the node type manager
+     *            through which the node type is to be registered.
+     * @param source The <code>InputStream</code> from which the CND file is
+     *            read.
+     * @return <code>true</code> if registration of all node types succeeded.
+     */
+    public static boolean registerNodeType(Session session, InputStream source)
+            throws IOException, RepositoryException {
+
+        Workspace workspace = session.getWorkspace();
+        NodeTypeManager ntm = workspace.getNodeTypeManager();
+        if (ntm instanceof JackrabbitNodeTypeManager) {
+            JackrabbitNodeTypeManager jntm = (JackrabbitNodeTypeManager) ntm;
+            try {
+                jntm.registerNodeTypes(source,
+                    JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
+                return true;
+            } catch (RepositoryException re) {
+                Throwable t = re.getCause();
+                if (t != null
+                    && t.getClass().getName().endsWith(
+                        ".InvalidNodeTypeDefException")) {
+                    // hacky wacky: interpret message to check whether it is for
+                    // duplicate node type -> very bad, that this is the only
+                    // way to check !!!
+                    if (re.getCause().getMessage().indexOf("already exists") >= 0) {
+                        // alright, node types are already registered, ignore
+                        // this
+                        return true;
+                    }
+                }
+
+                // get here to rethrow the RepositoryException
+                throw re;
+            }
+        }
+
+        return false;
+    }
+
+    public static final class RepositoryWrapper implements SlingRepository {
+
+        protected final Repository wrapped;
+
+        public RepositoryWrapper(Repository r) {
+            wrapped = r;
+        }
+
+        public String getDescriptor(String key) {
+            return wrapped.getDescriptor(key);
+        }
+
+        public String[] getDescriptorKeys() {
+            return wrapped.getDescriptorKeys();
+        }
+
+        public Session login() throws LoginException, RepositoryException {
+            return wrapped.login();
+        }
+
+        public Session login(Credentials credentials, String workspaceName)
+                throws LoginException, NoSuchWorkspaceException,
+                RepositoryException {
+            return wrapped.login(credentials, workspaceName);
+        }
+
+        public Session login(Credentials credentials) throws LoginException,
+                RepositoryException {
+            return wrapped.login(credentials);
+        }
+
+        public Session login(String workspaceName) throws LoginException,
+                NoSuchWorkspaceException, RepositoryException {
+            return wrapped.login(workspaceName);
+        }
+
+        public String getDefaultWorkspace() {
+            return "default";
+        }
+
+        public Session loginAdministrative(String workspace)
+        throws RepositoryException {
+            final Credentials credentials = new SimpleCredentials(ADMIN_NAME, ADMIN_PASSWORD.toCharArray());
+            return this.login(credentials, workspace);
+        }
+
+    }
+}

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/event/src/test/java/org/apache/sling/event/impl/RepositoryUtil.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: incubator/sling/trunk/event/src/test/test-config/repository-derby.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/test/test-config/repository-derby.xml?rev=590071&view=auto
==============================================================================
--- incubator/sling/trunk/event/src/test/test-config/repository-derby.xml (added)
+++ incubator/sling/trunk/event/src/test/test-config/repository-derby.xml Tue Oct 30 06:49:12
2007
@@ -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/event/src/test/test-config/repository-derby.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/trunk/event/src/test/test-config/repository-derby.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/sling/trunk/event/src/test/test-config/repository-derby.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message