Class TestRepository

  extended by org.apache.jackrabbit.core.TestRepository

public class TestRepository
extends Object

Utility class for easy handling a test repository. This class contains a static test repository instance for use by test cases. The Repository.login() method of the test repository instance should return a session with full read-write access.

Method Summary
static Repository getInstance()
          Returns the test repository instance.
static void setInstance(Repository repository)
          Sets the given repository as the test repository instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static Repository getInstance()
                              throws RepositoryException
Returns the test repository instance. If a repository instance has not yet been registered using setInstance(Repository) as the test repostitory, then a simple TransientRepository instance is created with the standard test repository configuration and the test repository location (either "jackrabbit-test-repository" or the value of the "org.apache.jackrabbit.test.repository.home" system property).

test repository instance
RepositoryException - if a test repository can not be instantiated


public static void setInstance(Repository repository)
Sets the given repository as the test repository instance. This method is designed for use by the main Jackrabbit test suite to facilitate smooth integration of standalone test cases.

repository - test repository

Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.