chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1463888 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr: ./ src/test/java/org/apache/chemistry/opencmis/jcr/ src/test/java/org/apache/jackrabbit/ src/test/java/org/apache/jackrabbit/core/ src/test/jav...
Date Wed, 03 Apr 2013 09:19:41 GMT
Author: mduerig
Date: Wed Apr  3 09:19:40 2013
New Revision: 1463888

URL: http://svn.apache.org/r1463888
Log:
CMIS-586: Create unit tests environment for chemistry-opencmis-server-jcr
add test cases (currently marked as ignored)
thanks Ivan Vasyliev for the patch

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml
  (with props)
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/pom.xml

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/pom.xml?rev=1463888&r1=1463887&r2=1463888&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/pom.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/pom.xml
Wed Apr  3 09:19:40 2013
@@ -26,7 +26,7 @@
     <properties>
         <parentBasedir>../../</parentBasedir>
     </properties>
-    
+
     <build>
         <plugins>
             <plugin>
@@ -62,6 +62,26 @@
                 <artifactId>maven-jetty-plugin</artifactId>
                 <version>6.1.23</version>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.maven.surefire</groupId>
+                        <artifactId>surefire-junit4</artifactId>
+                        <version>2.12</version>
+                    </dependency>
+                </dependencies>
+                <configuration>
+                    <includes>
+                        <include>**/*Test.class</include>
+                    </includes>
+                  <systemProperties>
+                      <org.apache.jackrabbit.repository.conf>${basedir}/src/test/resources/repository.xml</org.apache.jackrabbit.repository.conf>
+                      <org.apache.jackrabbit.repository.home>${basedir}/target/jackrabbit-repo</org.apache.jackrabbit.repository.home>
+                    </systemProperties> 
+                </configuration>
+            </plugin>            
         </plugins>
     </build>
 
@@ -112,6 +132,12 @@
             <version>4.7</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+        <groupId>org.apache.jackrabbit</groupId>
+        <artifactId>jackrabbit-core</artifactId>
+        <version>2.5.1</version>
+        <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <profiles>

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java?rev=1463888&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
Wed Apr  3 09:19:40 2013
@@ -0,0 +1,88 @@
+/*
+ * 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.chemistry.opencmis.jcr;
+
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.jcr.impl.DefaultDocumentTypeHandler;
+import org.apache.chemistry.opencmis.jcr.impl.DefaultFolderTypeHandler;
+import org.apache.chemistry.opencmis.jcr.impl.DefaultUnversionedDocumentTypeHandler;
+import org.apache.chemistry.opencmis.jcr.type.JcrTypeHandlerManager;
+import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.core.TransientRepository;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * Abstract class for the test cases are covering JCR compliance.
+ * The Jackrabbit's TransientRepository class uses as content repository.   
+ */
+public abstract class AbstractJcrSessionTest {
+    private TransientRepository transientRepository;
+    private JcrRepository jcrRepository;
+    private Session session;
+    private JcrTypeManager typeManager;
+    private static final String MOUNT_PATH = "/";
+
+
+    @Before
+    public void setUp() throws Exception {
+        transientRepository = new TransientRepository();
+        session = transientRepository.login(new SimpleCredentials("adminId", "admin".toCharArray()));
+        typeManager = new JcrTypeManager();
+        PathManager pathManger = new PathManager(MOUNT_PATH);
+        JcrTypeHandlerManager typeHandlerManager = createTypeHandlerManager(pathManger, typeManager);
+        jcrRepository = new JcrRepository(transientRepository, pathManger, typeManager, typeHandlerManager);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        transientRepository.shutdown();
+    }
+
+    private static JcrTypeHandlerManager createTypeHandlerManager(PathManager pathManager,
JcrTypeManager typeManager) {
+        JcrTypeHandlerManager typeHandlerManager = new JcrTypeHandlerManager(pathManager,
typeManager);
+        typeHandlerManager.addHandler(new DefaultFolderTypeHandler());
+        typeHandlerManager.addHandler(new DefaultDocumentTypeHandler());
+        typeHandlerManager.addHandler(new DefaultUnversionedDocumentTypeHandler());
+        return typeHandlerManager;
+    }
+
+    protected Session getSession() {
+        try {
+            //initialization of the UserManager
+            ((JackrabbitSession) session).getUserManager();
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage());
+        }
+        return session;
+    }
+
+    protected JcrRepository getJcrRepository() {
+        return jcrRepository;
+    }
+
+    protected ObjectData getRootFolder(){
+        return getJcrRepository().getObjectByPath(getSession(),
+                MOUNT_PATH, null, false, false, null, false);
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/AbstractJcrSessionTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java?rev=1463888&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
Wed Apr  3 09:19:40 2013
@@ -0,0 +1,64 @@
+/*
+ * 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.chemistry.opencmis.jcr;
+
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * The test covers org.apache.chemistry.opencmis.jcr.JcrRepository class.
+ */
+@Ignore
+public class JcrFolderTest extends AbstractJcrSessionTest {
+
+    /**
+     * Test of the root folder
+     */
+    @Test
+    public void testRootFolder(){
+        ObjectData objData = getRootFolder();
+        Assert.assertNotNull(objData);
+    }
+
+    /**
+     * Test of the <code>PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS</code> of
the CMIS object.
+     */
+    @Test
+    public void testJcrTypeProperty(){
+        getRootFolder().getProperties();
+        PropertiesImpl properties = new PropertiesImpl();
+
+        properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, "cmis:folder"));
+        properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, "TestFolder"));
+        String testFolderId = getJcrRepository().createFolder(getSession(), properties, getRootFolder().getId());
+        ObjectData testFolder = getJcrRepository().getObject(getSession(), testFolderId,
null, null, null, false);
+        Assert.assertNotNull(testFolder.getProperties().getProperties()
+                .get(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS).getValues());
+    }
+
+
+
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrFolderTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java?rev=1463888&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
Wed Apr  3 09:19:40 2013
@@ -0,0 +1,97 @@
+/*
+ * 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.chemistry.opencmis.jcr;
+
+import java.math.BigInteger;
+
+import junit.framework.Assert;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ChangeEventInfo;
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.enums.CapabilityChanges;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore
+public class JcrObservationJournalTest extends AbstractJcrSessionTest {
+    private static final BigInteger PAGE_SIZE = new BigInteger("4");
+
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+
+        Assert.assertEquals(CapabilityChanges.OBJECTIDSONLY, getJcrRepository()
+                .getRepositoryInfo(getSession()).getCapabilities()
+                .getChangesCapability());
+
+        fillObservationJournal();
+    }
+
+    @Test
+    public void testObservationJournal() throws Exception {
+        // FIXME not such method: JcrRepository.getContentChanges()
+//        ObjectList objList = getJcrRepository().getContentChanges(getSession(),
+//                null, false, null, false, false, PAGE_SIZE, null);
+        ObjectList objList = null;
+
+        //The repository supports journaled observation
+        Assert.assertNotNull(objList);
+
+        //event list isn't empty
+        Assert.assertEquals(true, !objList.getObjects().isEmpty());
+
+        ChangeEventInfo latestChangeEvent = objList.getObjects()
+                .get(objList.getNumItems().intValue() - 1).getChangeEventInfo();
+        long previousChangeLogToken = latestChangeEvent.getChangeTime().getTimeInMillis();
+        // FIXME not such method: JcrRepository.getContentChanges()
+//        objList = getJcrRepository().getContentChanges(getSession(),
+//                String.valueOf(previousChangeLogToken), false, null, false, false, PAGE_SIZE,
null);
+
+        latestChangeEvent = objList.getObjects()
+                .get(objList.getNumItems().intValue() - 1).getChangeEventInfo();
+
+        long latestChangeLogToken = latestChangeEvent.getChangeTime().getTimeInMillis();
+
+        //Ensure the latest change log token is the really latest one.
+        Assert.assertEquals(true, latestChangeLogToken > previousChangeLogToken);
+
+        //In journal must remain some events.
+        Assert.assertEquals(Boolean.TRUE, objList.hasMoreItems());
+    }
+
+    private void fillObservationJournal() {
+        PropertiesImpl properties = new PropertiesImpl();
+        properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, "OBSERVATION_TEST_FOLDER"));
+        properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, "cmis:folder"));
+
+        String testFolderId = getJcrRepository().createFolder(getSession(), properties, getRootFolder().getId());
+        properties = new PropertiesImpl();
+        properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, "NEW_NAME_TEST_FOLDER"));
+        getJcrRepository().getJcrNode(getSession(), testFolderId)
+            .updateProperties(properties);
+        getJcrRepository().deleteObject(getSession(), testFolderId, true);
+    }
+
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/JcrObservationJournalTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java?rev=1463888&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
Wed Apr  3 09:19:40 2013
@@ -0,0 +1,88 @@
+/*
+ * 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.jackrabbit.core.security;
+
+import java.lang.reflect.Field;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.UserManager;
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.security.simple.SimpleSecurityManager;
+import org.apache.jackrabbit.core.security.user.UserImpl;
+import org.apache.jackrabbit.core.security.user.UserManagerImpl;
+
+/**
+ * Provides access to the observation journal. It represents current user as administrator.
 
+ * The reason to use one is SimpleSecurityManager doesn't support UserManager of a session.
+ */
+public class TestSecurityManager extends SimpleSecurityManager {
+
+    private static class MockAdmin extends UserImpl {
+
+        protected MockAdmin(UserManagerImpl userManager) {
+            super(null, userManager);
+        }
+
+        @Override
+        public boolean isGroup() {
+            return false;
+        }
+
+        @Override
+        public boolean isDisabled() throws RepositoryException {
+            return false;
+        }
+
+        @Override
+        public boolean isAdmin() {
+            return true;
+        }
+
+    }
+
+    private class MockUserManager extends UserManagerImpl {
+
+        public MockUserManager() throws RepositoryException {
+            super((SessionImpl) getSystemSession(), "admin");
+        }
+
+        @Override
+        public Authorizable getAuthorizable(String id) throws RepositoryException {
+            return new MockAdmin(this);
+        }
+    }
+
+    @Override
+    public UserManager getUserManager(Session session) throws RepositoryException {
+        return new MockUserManager();
+    }
+
+    protected Session getSystemSession() {
+        try {
+            Field sessionField;
+            sessionField = SimpleSecurityManager.class.getDeclaredField("systemSession");
+            sessionField.setAccessible(true);
+            return (Session) sessionField.get(this);
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/jackrabbit/core/security/TestSecurityManager.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml?rev=1463888&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml
Wed Apr  3 09:19:40 2013
@@ -0,0 +1,159 @@
+<?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 2.0//EN"
+          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
+
+<!-- Example Repository Configuration File
+     Used by
+     - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
+     -
+-->
+<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>
+
+    <!--
+        data store configuration
+    -->
+    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
+
+    <!--
+        security configuration
+    -->
+    <Security appName="Jackrabbit">
+        <!--
+            security manager:
+            class: FQN of class implementing the JackrabbitSecurityManager interface
+        -->
+
+        <!--  <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
workspaceName="security"> --> 
+         <SecurityManager class="org.apache.jackrabbit.core.security.TestSecurityManager"
workspaceName="security"> 
+
+            <!--
+            workspace access:
+            class: FQN of class implementing the WorkspaceAccessManager interface
+            -->
+            <!-- <WorkspaceAccessManager class="..."/> -->
+            <!-- <param name="config" value="${rep.home}/security.xml"/> -->
+        </SecurityManager>
+
+        <!--
+            access manager:
+            class: FQN of class implementing the AccessManager interface
+        -->
+        <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
+            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+        </AccessManager>
+
+        <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
+           <!-- 
+              anonymous user name ('anonymous' is the default value)
+            -->
+           <param name="anonymousId" value="anonymous"/>
+           <!--
+              administrator user id (default value if param is missing is 'admin')
+            -->
+           <param name="adminId" value="admin"/>
+        </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="${wsp.name}">
+        <!--
+            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.pool.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+          <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+        </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"/>
+            <param name="supportHighlighting" value="true"/>
+        </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.pool.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"/>
+        <param name="supportHighlighting" value="true"/>
+    </SearchIndex>
+
+    <!--
+        Run with a cluster journal
+    -->
+    <Cluster id="node1">
+          <Journal class="org.apache.jackrabbit.core.journal.FileJournal">
+        <param name="revision" value="${rep.home}/revision.log" />
+        <param name="directory" value="${rep.home}/myjournal" />
+      </Journal>
+    </Cluster>
+</Repository>

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/resources/repository.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message