You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2008/07/18 15:50:38 UTC

svn commit: r677908 [1/2] - in /jackrabbit/trunk/jackrabbit-spi2jcr: ./ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/jackrabbit/ src/test/java/org/apache/jackrabbit/spi2jcr/ src/test/java/org/apache/jac...

Author: angela
Date: Fri Jul 18 06:50:36 2008
New Revision: 677908

URL: http://svn.apache.org/viewvc?rev=677908&view=rev
Log:
JCR-1683: JCR2SPI: Move test execution to SPI2JCR

Added:
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/jaas.config
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties   (with props)
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/testdata.xml   (with props)
Modified:
    jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml?rev=677908&r1=677907&r2=677908&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml Fri Jul 18 06:50:36 2008
@@ -44,6 +44,41 @@
     <url>http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr</url>
   </scm>
 
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <includes>
+            <include>**/TestAll.java</include>
+          </includes>
+          <forkMode>once</forkMode>
+          <argLine>-Xmx128m -enableassertions</argLine>
+          <systemProperties>
+            <property>
+              <name>derby.system.durability</name>
+              <value>test</value>
+            </property>
+            <property>
+              <name>derby.stream.error.file</name>
+              <value>target/derby.log</value>
+            </property>
+            <property>
+              <name>known.issues</name>
+              <value>
+                org.apache.jackrabbit.jcr2spi.name.NamespaceRegistryTest#testReRegisteredNamespaceVisibility
+                org.apache.jackrabbit.jcr2spi.name.NamespaceRegistryTest#testRegisteredNamespaceVisibility
+                org.apache.jackrabbit.jcr2spi.ReorderMoveTest#testRevertMoveAndReorderSNS
+                org.apache.jackrabbit.jcr2spi.ReorderMoveTest#testRevertMoveReorderedSNS
+                org.apache.jackrabbit.value.BinaryValueTest#testBinaryValueEquals
+              </value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
   <dependencies>
     <dependency>
       <groupId>javax.jcr</groupId>
@@ -52,6 +87,15 @@
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-spi</artifactId>
+      <version>${project.parent.version}</version>
+      <classifier></classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-spi</artifactId>
+      <version>${project.parent.version}</version>
+      <classifier>tests</classifier>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
@@ -65,6 +109,49 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-tests</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-benchmark</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-rmi</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr2spi</artifactId>
+      <version>${project.parent.version}</version>
+      <classifier>tests</classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr2spi</artifactId>
+      <version>${project.parent.version}</version>
+      <classifier></classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
-
 </project>

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,127 @@
+/*
+ * 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.spi2jcr;
+
+import org.apache.jackrabbit.test.RepositoryStub;
+import org.apache.jackrabbit.test.RepositoryStubException;
+import org.apache.jackrabbit.core.jndi.RegistryHelper;
+
+import javax.jcr.Repository;
+import javax.jcr.Session;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+import java.util.Hashtable;
+
+/**
+ * Implements the <code>RepositoryStub</code> for the JCR Reference Implementation.
+ * TODO: copied from jackrabbit/core test classes
+ */
+public class DefaultRepositoryStub extends RepositoryStub {
+
+    /**
+     * Property for the repository name (used for jndi lookup)
+     */
+    public static final String PROP_REPOSITORY_NAME = "org.apache.jackrabbit.repository.name";
+
+    /**
+     * Property for the repository configuration file (used for repository instantiation)
+     */
+    public static final String PROP_REPOSITORY_CONFIG = "org.apache.jackrabbit.repository.config";
+
+    /**
+     * Property for the repository home directory (used for repository instantiation)
+     */
+    public static final String PROP_REPOSITORY_HOME = "org.apache.jackrabbit.repository.home";
+
+    /**
+     * Property for the jaas config path. If the system property
+     * <code>java.security.auth.login.config</code> is not set this repository
+     * stub will try to read this property from the environment and use the
+     * value retrieved as the value for the system property.
+     */
+    public static final String PROP_JAAS_CONFIG = "org.apache.jackrabbit.repository.jaas.config";
+
+    /**
+     * The name of the jaas config system property.
+     */
+    private static final String SYS_JAAS_CONFIG = "java.security.auth.login.config";
+
+    /**
+     * The repository instance
+     */
+    private Repository repository;
+
+    /**
+     * Constructor as required by the JCR TCK.
+     *
+     * @param env environment properties.
+     */
+    public DefaultRepositoryStub(Properties env) {
+        super(env);
+        // set some attributes on the sessions
+        superuser.setAttribute("jackrabbit", "jackrabbit");
+        readwrite.setAttribute("jackrabbit", "jackrabbit");
+        readonly.setAttribute("jackrabbit", "jackrabbit");
+    }
+
+    /**
+     * Returns the configured <code>Repository</code> instance.
+     * <br>
+     * The default repository name is 'repo'.
+     *
+     * @return the configured <code>Repository</code> instance.
+     * @throws RepositoryStubException if an error occurs while
+     *                                 obtaining the Repository instance.
+     */
+    public synchronized Repository getRepository() throws RepositoryStubException {
+        if (repository == null) {
+            try {
+                String repName = environment.getProperty(PROP_REPOSITORY_NAME, "repo");
+                String repConfig = environment.getProperty(PROP_REPOSITORY_CONFIG);
+                String repHome = environment.getProperty(PROP_REPOSITORY_HOME);
+                String jaasConfig = environment.getProperty(PROP_JAAS_CONFIG);
+
+                // set jaas config from stub properties if system property is
+                // not set.
+                if (System.getProperty(SYS_JAAS_CONFIG) == null && jaasConfig != null) {
+                    System.setProperty(SYS_JAAS_CONFIG, jaasConfig);
+                }
+
+                // register repository instance
+                Hashtable env = new Hashtable();
+                env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
+                env.put(Context.PROVIDER_URL, "localhost");
+                InitialContext ctx = new InitialContext(env);
+                RegistryHelper.registerRepository(ctx, repName, repConfig, repHome, true);
+
+                repository = (Repository) ctx.lookup(repName);
+
+                // setup repository
+                Session s = repository.login(getSuperuserCredentials());
+                try {
+                    RepositorySetup.run(s);
+                } finally {
+                    s.logout();
+                }
+            } catch (Exception e) {
+                throw new RepositoryStubException(e.toString());
+            }
+        }
+        return repository;
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/DefaultRepositoryStub.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,118 @@
+/*
+ * 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.spi2jcr;
+
+import org.apache.jackrabbit.test.RepositoryStubException;
+import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory;
+import org.apache.log4j.PropertyConfigurator;
+
+import javax.jcr.Repository;
+import java.util.Properties;
+import java.rmi.RemoteException;
+import java.rmi.NotBoundException;
+import java.net.MalformedURLException;
+
+/**
+ * <code>RMIRepositoryStub</code> implements a repository stub that initializes
+ * a Jackrabbit RMI client.
+ */
+public class RMIRepositoryStub extends DefaultRepositoryStub {
+
+    /**
+     * Property for the repository url
+     */
+    public static final String PROP_REPOSITORY_URI = "org.apache.jackrabbit.rmi.repository.uri";
+
+    static {
+        PropertyConfigurator.configure(RMIRepositoryStub.class.getClassLoader().getResource("log4j.properties"));
+    }
+
+    /**
+     * The Jackrabbit repository.
+     */
+    private Repository repo;
+
+    /**
+     * Constructor required by TCK.
+     *
+     * @param env the environment.
+     */
+    public RMIRepositoryStub(Properties env) {
+        super(env);
+    }
+
+    /**
+     * @return the repository instance to test.
+     * @throws RepositoryStubException if an error occurs while starting up the
+     *                                 repository.
+     */
+    public Repository getRepository() throws RepositoryStubException {
+        if (repo == null) {
+            repo = getRepositoryFromRMI();
+        }
+        return repo;
+    }
+
+    private Repository getRepositoryFromRMI() throws RepositoryStubException {
+        try {
+            Class clazz = Class.forName(getServerFactoryDelegaterClass());
+            RMIRepositoryStub.ClientFactoryDelegater cfd = (ClientFactoryDelegater) clazz.newInstance();
+
+            String repositoryURI = environment.getProperty(PROP_REPOSITORY_URI);
+            Repository r = cfd.getRepository(repositoryURI);
+            //log.info("Acquired repository via RMI.");
+            return r;
+        } catch (Exception e) {
+            //log.error("Error while retrieving repository using RMI: " + e);
+            throw new RepositoryStubException(e.getMessage());
+        }
+    }
+
+    /**
+     * Return the fully qualified name of the class providing the client
+     * repository. The class whose name is returned must implement the
+     * {@link ClientFactoryDelegater} interface.
+     *
+     * @return the qfn of the factory class.
+     */
+    protected String getServerFactoryDelegaterClass() {
+        return getClass().getName() + "$RMIClientFactoryDelegater";
+    }
+
+    /**
+     * optional class for RMI, will only be used, if RMI client is present
+     */
+    protected static abstract class ClientFactoryDelegater {
+
+        public abstract Repository getRepository(String uri)
+                throws RemoteException, MalformedURLException, NotBoundException;
+    }
+
+    /**
+     * optional class for RMI, will only be used, if RMI server is present
+     */
+    protected static class RMIClientFactoryDelegater extends ClientFactoryDelegater {
+
+        // only used to enforce linking upon Class.forName()
+        static String FactoryClassName = ClientRepositoryFactory.class.getName();
+
+        public Repository getRepository(String uri) throws MalformedURLException, NotBoundException, RemoteException {
+            System.setProperty("java.rmi.server.useCodebaseOnly", "true");
+            return new ClientRepositoryFactory().getRepository(uri);
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RMIRepositoryStub.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,267 @@
+/*
+ * 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.spi2jcr;
+
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.WorkspaceImpl;
+import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
+import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.Node;
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * <code>RepositorySetup</code> initializes the test candidate with required
+ * namespaces, node types and test content.
+ */
+public class RepositorySetup {
+
+    private static final String NAMESPACES_RESOURCE = "namespaces.properties";
+
+    private static final String NODETYPES_RESOURCE = "custom_nodetypes.xml";
+
+    private static final String TEST_CONTENT_RESOURCE = "testdata.xml";
+
+    private static final String TEST_WORKSPACE_NAME = "test";
+
+    /**
+     * The setup tasks to run.
+     */
+    private final Task[] TASKS = {
+        new RegisterNamespaces(),
+        new RegisterNodeTypes(),
+        new ImportTestContent(),
+        new CreateTestWorkspace()
+    };
+
+    /**
+     * The session to the repository to setup.
+     */
+    private final SessionImpl session;
+
+    /**
+     * Private constructor.
+     */
+    private RepositorySetup(SessionImpl session) {
+        this.session = session;
+    }
+
+    /**
+     * Executes the repository setup tasks.
+     *
+     * @throws RepositoryException if an error occurs while running the tasks.
+     */
+    private void execute() throws RepositoryException {
+        for (int i = 0; i < TASKS.length; i++) {
+            TASKS[i].execute();
+        }
+    }
+
+    /**
+     * Runs the repository setup.
+     *
+     * @param session the session of the repository to setup.
+     * @throws RepositoryException      if an error occurs while running the
+     *                                  tasks.
+     * @throws IllegalArgumentException if <code>session</code> is not a jackrabbit
+     *                                  session.
+     */
+    public static void run(Session session) throws RepositoryException {
+        if (session instanceof SessionImpl) {
+            new RepositorySetup((SessionImpl) session).execute();
+        } else {
+            throw new IllegalArgumentException("not a Jackrabbit session");
+        }
+    }
+
+    /**
+     * Returns an input stream for reading the specified resource.
+     *
+     * @param name the resource name.
+     * @return An input stream for reading the resource, or <code>null</code> if
+     *         the resource could not be found
+     */
+    private static InputStream getResource(String name) {
+        return RepositorySetup.class.getClassLoader().getResourceAsStream(name);
+    }
+
+    /**
+     * Registers the <code>namespaces</code>.
+     *
+     * @param namespaces the namespaces to register.
+     * @param session the session to register the namespaces.
+     */
+    private static void registerNamespaces(Properties namespaces,
+                                           Session session)
+            throws RepositoryException {
+        NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
+        for (Iterator it = namespaces.keySet().iterator(); it.hasNext();) {
+            String prefix = (String) it.next();
+            String uri = namespaces.getProperty(prefix);
+            try {
+                nsReg.registerNamespace(prefix, uri);
+            } catch (RepositoryException e) {
+                // then this namespace is already registered.
+            }
+        }
+    }
+
+    private interface Task {
+
+        /**
+         * Executes this task.
+         *
+         * @throws RepositoryException if an error occurs while running this
+         *                             tasks.
+         */
+        public void execute() throws RepositoryException;
+    }
+
+    /**
+     * Registers namespaces that are needed to run the test cases.
+     */
+    private final class RegisterNamespaces implements Task {
+
+        /**
+         * @inheritDoc
+         */
+        public void execute() throws RepositoryException {
+            InputStream is = getResource(NAMESPACES_RESOURCE);
+            if (is != null) {
+                try {
+                    Properties namespaces = new Properties();
+                    namespaces.load(is);
+
+                    registerNamespaces(namespaces, session);
+                } catch (IOException e) {
+                    throw new RepositoryException(e.getMessage());
+                } finally {
+                    try {
+                        is.close();
+                    } catch (IOException e1) {
+                        // ignore
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Registers node types that are needed to run the test cases.
+     */
+    private final class RegisterNodeTypes implements Task {
+
+        /**
+         * @inheritDoc
+         */
+        public void execute() throws RepositoryException {
+            InputStream is = getResource(NODETYPES_RESOURCE);
+            if (is != null) {
+                try {
+                    NodeTypeReader ntReader = new NodeTypeReader(is);
+                    registerNamespaces(ntReader.getNamespaces(), session);
+
+                    NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
+                    NodeTypeDef[] nodeTypes = ntReader.getNodeTypeDefs();
+                    List unregisteredNTs = new ArrayList();
+                    for (int i = 0; i < nodeTypes.length; i++) {
+                        try {
+                            ntMgr.getNodeType(nodeTypes[i].getName());
+                        } catch (NoSuchNodeTypeException e) {
+                            // register the node type
+                            unregisteredNTs.add(nodeTypes[i]);
+                        }
+                    }
+                    ntMgr.getNodeTypeRegistry().registerNodeTypes(unregisteredNTs);
+                } catch (IOException e) {
+                    throw new RepositoryException(e.getMessage());
+                } catch (InvalidNodeTypeDefException e) {
+                    throw new RepositoryException(e.getMessage());
+                } finally {
+                    try {
+                        is.close();
+                    } catch (IOException e1) {
+                        // ignore
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Imports test content into the repository if the repository is empty.
+     */
+    private final class ImportTestContent implements Task {
+
+        /**
+         * @inheritDoc
+         */
+        public void execute() throws RepositoryException {
+            InputStream is = getResource(TEST_CONTENT_RESOURCE);
+            if (is != null) {
+                try {
+                    Node rootNode = session.getRootNode();
+                    if (!rootNode.hasNode("testdata")) {
+                        session.getWorkspace().importXML("/", is,
+                                ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING);
+                    }
+                    if (!rootNode.hasNode("testroot")) {
+                        rootNode.addNode("testroot");
+                        session.save();
+                    }
+                } catch (IOException e) {
+                    throw new RepositoryException(e.getMessage());
+                } finally {
+                    try {
+                        is.close();
+                    } catch (IOException e1) {
+                        // ignore
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Creates a workspace with name 'test' if it is not yet present.
+     */
+    private final class CreateTestWorkspace implements Task {
+
+        /**
+         * @inheritDoc
+         */
+        public void execute() throws RepositoryException {
+            List workspaces = Arrays.asList(session.getWorkspace().getAccessibleWorkspaceNames());
+            if (!workspaces.contains(TEST_WORKSPACE_NAME)) {
+                ((WorkspaceImpl) session.getWorkspace()).createWorkspace(TEST_WORKSPACE_NAME);
+            }
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositorySetup.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java Fri Jul 18 06:50:36 2008
@@ -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.spi2jcr;
+
+import org.apache.jackrabbit.jcr2spi.AbstractRepositoryConfig;
+import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
+import org.apache.jackrabbit.spi.RepositoryService;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.apache.jackrabbit.test.RepositoryStubException;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import java.util.Properties;
+
+/**
+ * <code>RepositoryStubImpl</code> implements a repository stub that
+ * initializes a Jackrabbit repository and wraps it with a SPI2JCR layer and
+ * a JCR2SPI layer.
+ */
+public class RepositoryStubImpl extends DefaultRepositoryStub {
+
+    /**
+     * The Jackrabbit repository.
+     */
+    private Repository repo;
+
+    /**
+     * Constructor required by TCK.
+     *
+     * @param env the environment.
+     */
+    public RepositoryStubImpl(Properties env) {
+        super(env);
+    }
+
+    /**
+     * @return the repository instance to test.
+     * @throws RepositoryStubException if an error occurs while starting up the
+     *                                 repository.
+     */
+    public Repository getRepository() throws RepositoryStubException {
+        if (repo == null) {
+            try {
+                final RepositoryService service = getRepositoryService();
+                repo = RepositoryImpl.create(new AbstractRepositoryConfig() {
+                    public RepositoryService getRepositoryService() {
+                        return service;
+                    }
+                });
+            } catch (RepositoryException e) {
+                RepositoryStubException ex = new RepositoryStubException(e.getMessage());
+                ex.initCause(e);
+                throw ex;
+            }
+        }
+        return repo;
+    }
+
+    /**
+     *
+     * @return
+     * @throws RepositoryStubException
+     */
+    public RepositoryService getRepositoryService() throws RepositoryStubException {
+        Repository jackrabbitRepo = super.getRepository();
+
+        // TODO: make configurable
+        BatchReadConfig brconfig = new BatchReadConfig();
+        brconfig.setDepth(NameConstants.NT_FILE, BatchReadConfig.DEPTH_INFINITE);
+        brconfig.setDepth(NameConstants.NT_RESOURCE, BatchReadConfig.DEPTH_INFINITE);
+
+        return new RepositoryServiceImpl(jackrabbitRepo, brconfig);
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/RepositoryStubImpl.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,127 @@
+/*
+ * 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.spi2jcr;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.spi.RepositoryServiceStub;
+import org.apache.jackrabbit.spi.RepositoryService;
+import org.apache.jackrabbit.core.jndi.RegistryHelper;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Repository;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.Credentials;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+import java.util.Hashtable;
+
+/** <code>ServiceStubImpl</code>... */
+public class ServiceStubImpl extends RepositoryServiceStub {
+
+    private static Logger log = LoggerFactory.getLogger(ServiceStubImpl.class);
+
+    /**
+     * Property for the repository name (used for jndi lookup)
+     */
+    public static final String PROP_REPOSITORY_NAME = "org.apache.jackrabbit.spi2jcr.name";
+
+    /**
+     * Property for the repository configuration file (used for repository instantiation)
+     */
+    public static final String PROP_REPOSITORY_CONFIG = "org.apache.jackrabbit.spi2jcr.config";
+
+    /**
+     * Property for the repository home directory (used for repository instantiation)
+     */
+    public static final String PROP_REPOSITORY_HOME = "org.apache.jackrabbit.spi2jcr.home";
+
+    /**
+     * Property for the jaas config path. If the system property
+     * <code>java.security.auth.login.config</code> is not set this repository
+     * stub will try to read this property from the environment and use the
+     * value retrieved as the value for the system property.
+     */
+    public static final String PROP_JAAS_CONFIG = "org.apache.jackrabbit.spi2jcr.jaas.config";
+
+    /**
+     * The name of the jaas config system property.
+     */
+    private static final String SYS_JAAS_CONFIG = "java.security.auth.login.config";
+
+
+    private RepositoryService service;
+    private Credentials adminCredentials;
+    private Credentials readOnlyCredentials;
+
+    /**
+     * Implementations of this class must overwrite this constructor.
+     *
+     * @param env the environment variables. This parameter must not be null.
+     */
+    public ServiceStubImpl(Properties env) {
+        super(env);
+    }
+
+    public RepositoryService getRepositoryService() throws RepositoryException {
+        if (service == null) {
+            Repository repository;
+            try {
+                String repName = environment.getProperty(PROP_REPOSITORY_NAME);
+                String repConfig = environment.getProperty(PROP_REPOSITORY_CONFIG);
+                String repHome = environment.getProperty(PROP_REPOSITORY_HOME);
+                String jaasConfig = environment.getProperty(PROP_JAAS_CONFIG);
+
+                // set jaas config from stub properties if system property is
+                // not set.
+                if (System.getProperty(SYS_JAAS_CONFIG) == null && jaasConfig != null) {
+                    System.setProperty(SYS_JAAS_CONFIG, jaasConfig);
+                }
+
+                // register repository instance
+                Hashtable env = new Hashtable();
+                env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
+                env.put(Context.PROVIDER_URL, "localhost");
+                InitialContext ctx = new InitialContext(env);
+                RegistryHelper.registerRepository(ctx, repName, repConfig, repHome, true);
+
+                repository = (Repository) ctx.lookup(repName);
+            } catch (Exception e) {
+                throw new RepositoryException(e.toString());
+            }
+            service = new RepositoryServiceImpl(repository, new BatchReadConfig());
+        }
+        return service;
+    }
+
+    public Credentials getAdminCredentials() {
+        if (adminCredentials == null) {
+            adminCredentials = new SimpleCredentials(getProperty(PROP_PREFIX + "." + PROP_ADMIN_NAME),
+                    getProperty(PROP_PREFIX + "." + PROP_ADMIN_PWD).toCharArray());
+        }
+        return adminCredentials;
+    }
+
+    public Credentials getReadOnlyCredentials() {
+        if (readOnlyCredentials == null) {
+            readOnlyCredentials = new SimpleCredentials(getProperty(PROP_PREFIX + "." + PROP_READONLY_NAME),
+                getProperty(PROP_PREFIX + "." + PROP_READONLY_PWD).toCharArray());
+        }
+        return readOnlyCredentials;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.spi2jcr.jcr2spi;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/** <code>TestAll</code>... */
+public class TestAll extends TestCase {
+
+    public static Test suite() {
+        return new Jcr2SpiTestSuite();
+    }
+
+    private static class Jcr2SpiTestSuite extends TestSuite {
+
+        private Jcr2SpiTestSuite() {
+            super("JCR2SPI tests");
+
+            // all jcr2spi tests
+            addTest(org.apache.jackrabbit.jcr2spi.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.lock.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.name.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.nodetype.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.query.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.version.TestAll.suite());
+            addTest(org.apache.jackrabbit.jcr2spi.xml.TestAll.suite());
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/jcr2spi/TestAll.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,40 @@
+/*
+ * 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.spi2jcr.spi;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.jackrabbit.spi2jcr.jcr2spi.*;
+
+/** <code>TestAll</code>... */
+public class TestAll extends TestCase {
+
+    public static Test suite() {
+        return new SpiTestSuite();
+    }
+
+    private static class SpiTestSuite extends TestSuite {
+
+        private SpiTestSuite() {
+            super("SPI tests");
+
+            // all spi tests
+            addTest(org.apache.jackrabbit.spi.TestAll.suite());
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/spi/TestAll.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java Fri Jul 18 06:50:36 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import org.apache.jackrabbit.benchmark.BenchmarkSuite;
+
+/**
+ * Test suite that includes all test suites from jackrabbit-jcr-benchmark.
+ */
+public class JCRBenchmark extends TestCase {
+
+    public static Test suite() {
+        return new BenchmarkSuite();
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/JCRBenchmark.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java Fri Jul 18 06:50:36 2008
@@ -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.jackrabbit.test;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class TestAll extends TestCase {
+
+    public static Test suite() {
+        return new JCRTestSuite();
+    }
+
+    private static class JCRTestSuite extends TestSuite {
+
+        private JCRTestSuite() {
+            super("JCR API tests");
+            addTest(org.apache.jackrabbit.test.api.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.query.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.nodetype.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.util.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.lock.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.version.TestAll.suite());
+            addTest(org.apache.jackrabbit.test.api.observation.TestAll.suite());
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml Fri Jul 18 06:50:36 2008
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+ -->
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:test="http://www.apache.org/jackrabbit/test" xmlns:mix="http://www.jcp.org/jcr/mix/1.0">
+  <nodeType name="test:versionable" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>mix:versionable</supertype>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDefinition name="test:copyOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDefinition name="test:versionOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" multiple="false" />
+    <propertyDefinition name="test:initializeOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="INITIALIZE" protected="false" multiple="false" />
+    <propertyDefinition name="test:computeOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COMPUTE" protected="false" multiple="false" />
+    <propertyDefinition name="test:ignoreOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="false" multiple="false" />
+    <propertyDefinition name="test:abortOnParentVersionProp" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="ABORT" protected="false" multiple="false" />
+    <childNodeDefinition name="*" defaultPrimaryType="test:versionable" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:copyOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:versionOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:initializeOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="INITIALIZE" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:computeOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="COMPUTE" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:ignoreOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="test:abortOnParentVersion" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="ABORT" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+  </nodeType>
+
+  <!-- Defines a referenceable nodetype for testing purposes -->
+  <nodeType name="test:refTargetNode" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>mix:versionable</supertype>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+  </nodeType>
+
+  <!-- Defines a nodetype for tests of NodeType.canSetProperty(), Property.setValue() and Node.setProperty() -->
+  <nodeType name="test:canSetProperty" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="String" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="StringMultiple" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="StringConstraints" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+        <valueConstraint>def</valueConstraint>
+        <valueConstraint>ghi</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="StringMultipleConstraints" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+        <valueConstraint>def</valueConstraint>
+        <valueConstraint>ghi</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Binary" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="BinaryMultiple" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="BinaryConstraints" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="BinaryMultipleConstraints" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Date" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="DateMultiple" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="DateConstraints" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(1974-02-15T00:00:00.000Z,)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="DateMultipleConstraints" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,1974-02-15T00:00:00.000Z)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Double" requiredType="Double" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="DoubleMultiple" requiredType="Double" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="DoubleConstraints" requiredType="Double" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(100,)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="DoubleMultipleConstraints" requiredType="Double" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Long" requiredType="Long" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="LongMultiple" requiredType="Long" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="LongConstraints" requiredType="Long" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(100,)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="LongMultipleConstraints" requiredType="Long" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Boolean" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="BooleanMultiple" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="BooleanConstraints" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>true</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="BooleanMultipleConstraints" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>true</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Name" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="NameMultiple" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="NameConstraints" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="NameMultipleConstraints" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="Path" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="PathMultiple" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDefinition name="PathConstraints" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>/abc</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="PathMultipleConstraints" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>/abc</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="ReferenceConstraints" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>test:canSetProperty</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="ReferenceMultipleConstraints" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>test:canSetProperty</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+  </nodeType>
+
+  <!-- Defines a nodetype for testing NodeType.canAddChildNode() -->
+  <nodeType name="test:canAddChildNode" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <childNodeDefinition name="testChildWithDefaultType" defaultPrimaryType="nt:base" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+    <childNodeDefinition name="testChildWithoutDefaultType" defaultPrimaryType="" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+  </nodeType>
+
+  <!-- Defines a nodetype for testing Node.setProperty(). -->
+  <nodeType name="test:setProperty" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+      <supertype>mix:referenceable</supertype>
+    </supertypes>
+    <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDefinition name="test:multiProperty" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true" />
+    <childNodeDefinition name="*" defaultPrimaryType="test:setProperty" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false" />
+  </nodeType>
+
+  <!-- Defines a nodetype to test assuming the PropertyType at Node.setProperty(). -->
+  <nodeType name="test:setPropertyAssumingType" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="test:singleProperty" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDefinition name="test:multiProperty" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true" />
+    <childNodeDefinition name="*" defaultPrimaryType="test:setPropertyAssumingType" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false" />
+  </nodeType>
+
+  <!-- Defines a nodetype with a childNodeDefinition that does not allow same name siblings -->
+  <nodeType name="test:sameNameSibsFalseChildNodeDefinition" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <childNodeDefinition name="*" defaultPrimaryType="test:sameNameSibsFalseChildNodeDefinition" autoCreated="false" mandatory="false" onParentVersion="COMPUTE" protected="false" sameNameSiblings="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDefinition>
+  </nodeType>
+
+
+  <!-- ======================================================== -->
+  <!-- Node type definitions only required for jackrabbit core  -->
+  <!-- (internal) test cases.                                   -->
+  <!-- ======================================================== -->
+
+  <!-- Defines a mixin node type that extends mix:referenceable -->
+  <nodeType isMixin="true" name="test:referenceable" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>mix:referenceable</supertype>
+    </supertypes>
+  </nodeType>
+</nodeTypes>

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/custom_nodetypes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/jaas.config
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/jaas.config?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/jaas.config (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/jaas.config Fri Jul 18 06:50:36 2008
@@ -0,0 +1,3 @@
+Jackrabbit {
+  org.apache.jackrabbit.core.security.simple.SimpleLoginModule required anonymousId="anonymous" adminId="admin";
+};
\ No newline at end of file

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties Fri Jul 18 06:50:36 2008
@@ -0,0 +1,36 @@
+#  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.
+
+# Set root logger level to INFO and its only appender to file.
+log4j.rootLogger=INFO, file
+#log4j.rootLogger=DEBUG, stdout, file
+#log4j.rootLogger=ERROR, stdout, file
+
+log4j.logger.org.apache.jackrabbit.test=DEBUG
+
+# 'stdout' is set to be a ConsoleAppender.
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+
+# 'stdout' uses PatternLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n
+
+# 'file' is set to be a FileAppender.
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=target/jcr.log
+
+# 'file' uses PatternLayout.
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn = 

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml Fri Jul 18 06:50:36 2008
@@ -0,0 +1,126 @@
+<?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.5//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.5.dtd">
+<!-- Example Repository Configuration File -->
+<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">
+        <!--
+            security manager:
+            class: FQN of class implementing the JackrabbitSecurityManager interface
+        -->
+        <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
+            <!-- <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"/>
+           <param name="adminId" value="admin"/>
+           <!--
+              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="${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.bundle.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"/>
+        </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.bundle.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: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repository.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties?rev=677908&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties (added)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties Fri Jul 18 06:50:36 2008
@@ -0,0 +1,34 @@
+#  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.
+
+#
+# This is the configuration file for the jackrabbit repositoryservice test stub.
+#
+
+# the ServiceStubImpl used for SPI tests.
+org.apache.jackrabbit.spi.repository_service_stub_impl=org.apache.jackrabbit.spi2jcr.ServiceStubImpl
+
+org.apache.jackrabbit.spi.admin.pwd=admin
+org.apache.jackrabbit.spi.admin.name=admin
+org.apache.jackrabbit.spi.readonly.pwd=anonymous
+org.apache.jackrabbit.spi.readonly.name=
+org.apache.jackrabbit.spi.workspacename=default
+
+
+# config for jackrabbit repository implementation when testing SPI2JCR
+org.apache.jackrabbit.spi2jcr.config=src/test/resources/repository.xml
+org.apache.jackrabbit.spi2jcr.name=repo
+org.apache.jackrabbit.spi2jcr.home=target/spi2jcr-home
+org.apache.jackrabbit.spi2jcr.jaas.config=src/test/resources/jaas.config

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties
------------------------------------------------------------------------------
    svn = 

Propchange: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryServiceStubImpl.properties
------------------------------------------------------------------------------
    svn:eol-style = native