| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.commons.testing.jcr.RepositoryUtil
public class RepositoryUtil
Utility class for managing JCR repositories, used to initialize temporary Jackrabbit repositories for testing.
| Nested Class Summary | |
|---|---|
| static class | RepositoryUtil.RepositoryWrapper | 
| Field Summary | |
|---|---|
| static String | ADMIN_NAME | 
| static String | ADMIN_PASSWORD | 
| static String | CONFIG_FILE | 
| static String | HOME_DIR | 
| Constructor Summary | |
|---|---|
| RepositoryUtil() | |
| Method Summary | |
|---|---|
| static SlingRepository | getRepository()Get a repository | 
| static boolean | registerNodeType(javax.jcr.Session session,
                 InputStream source)Registers node types from the CND file read from the sourcewith the node type manager available from the givensession. | 
| static void | registerSlingNodeTypes(javax.jcr.Session adminSession) | 
| static void | startRepository()Start a new repository | 
| static void | stopRepository()Stop a repository. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String ADMIN_NAME
public static final String ADMIN_PASSWORD
public static final String HOME_DIR
public static final String CONFIG_FILE
| Constructor Detail | 
|---|
public RepositoryUtil()
| Method Detail | 
|---|
public static void startRepository()
                            throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - when it is not possible to start the
             repository.
public static void stopRepository()
                           throws NamingException
NamingExceptionpublic static SlingRepository getRepository()
public static boolean registerNodeType(javax.jcr.Session session,
                                       InputStream source)
                                throws IOException,
                                       javax.jcr.RepositoryException
source
 with the node type manager available from the given session.
 This method is not synchronized. It is up to the calling method to prevent paralell execution.
session - The Session providing the node type manager
            through which the node type is to be registered.source - The InputStream from which the CND file is
            read.
true if registration of all node types succeeded.
IOException
javax.jcr.RepositoryException
public static void registerSlingNodeTypes(javax.jcr.Session adminSession)
                                   throws IOException,
                                          javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||