org.apache.jackrabbit.core
Class TestRepository

java.lang.Object
  extended byorg.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

getInstance

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).

Returns:
test repository instance
Throws:
RepositoryException - if a test repository can not be instantiated

setInstance

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.

Parameters:
repository - test repository


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