Package org.apache.jackrabbit.test
Class RepositoryHelper
- java.lang.Object
- 
- org.apache.jackrabbit.test.RepositoryHelper
 
- 
- 
Constructor SummaryConstructors Constructor Description RepositoryHelper()Creates a repository helper with configuration fromrepositoryStubImpl.propertiesfile.RepositoryHelper(Map config)Creates a repository helper with additional configuration parameters.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description PrincipalgetKnownPrincipal(Session session)Returns aPrincipalidentifying a known user.StringgetProperty(String name)Returns the value of the configuration property with specifiedname.CredentialsgetReadOnlyCredentials()Returns the read-only credentials created from the username and password specified in the configuration properties.SessiongetReadOnlySession()Returns aSessionof the default workspace with read only access to the workspace.SessiongetReadOnlySession(String workspaceName)Returns aSessionof the workspace with nameworkspaceNamewith read only access to the workspace.CredentialsgetReadWriteCredentials()Returns the read-write credentials created from the username and password specified in the configuration properties.SessiongetReadWriteSession()Returns aSessionof the default workspace with read and write access to the workspace.SessiongetReadWriteSession(String workspaceName)Returns aSessionof the workspace with nameworkspaceNamewith read and write access to the workspace.RepositorygetRepository()Returns the repository instance to test.CredentialsgetSuperuserCredentials()Returns the superuser credentials created from the username and password specified in the configuration properties.SessiongetSuperuserSession()Returns a superuserSessionof the default workspace.SessiongetSuperuserSession(String workspaceName)Returns a superuserSessionof the workspace with nameworkspaceName.PrincipalgetUnknownPrincipal(Session session)Returns aPrincipalidentifiying an unknown user.
 
- 
- 
- 
Constructor Detail- 
RepositoryHelperpublic RepositoryHelper() Creates a repository helper with configuration fromrepositoryStubImpl.propertiesfile.
 - 
RepositoryHelperpublic RepositoryHelper(Map config) Creates a repository helper with additional configuration parameters.- Parameters:
- config- configuration which overlays the values from the property file.
 
 
- 
 - 
Method Detail- 
getRepositorypublic Repository getRepository() throws RepositoryException Returns the repository instance to test.- Returns:
- the repository instance to test.
- Throws:
- RepositoryException- if the repository could not be obtained.
 
 - 
getSuperuserSessionpublic Session getSuperuserSession() throws RepositoryException Returns a superuserSessionof the default workspace. The returnedSessionhas read and write access to the whole workspace.- Returns:
- a superuser Session.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getSuperuserSessionpublic Session getSuperuserSession(String workspaceName) throws RepositoryException Returns a superuserSessionof the workspace with nameworkspaceName. The returnedSessionhas read and write access to the whole workspace.- Returns:
- a superuser Session.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getReadWriteSessionpublic Session getReadWriteSession() throws RepositoryException Returns aSessionof the default workspace with read and write access to the workspace.- Returns:
- a Sessionwith read and write access.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getReadWriteSessionpublic Session getReadWriteSession(String workspaceName) throws RepositoryException Returns aSessionof the workspace with nameworkspaceNamewith read and write access to the workspace.- Returns:
- a Sessionwith read and write access.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getReadOnlySessionpublic Session getReadOnlySession() throws RepositoryException Returns aSessionof the default workspace with read only access to the workspace.- Returns:
- a Sessionwith read only.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getReadOnlySessionpublic Session getReadOnlySession(String workspaceName) throws RepositoryException Returns aSessionof the workspace with nameworkspaceNamewith read only access to the workspace.- Returns:
- a Sessionwith read only access.
- Throws:
- RepositoryException- if login to the repository failed.
 
 - 
getPropertypublic String getProperty(String name) throws RepositoryException Returns the value of the configuration property with specifiedname. If the property does not existnullis returned.Configuration properties are defined in the file: repositoryStubImpl.properties.- Parameters:
- name- the name of the property to retrieve.
- Returns:
- the value of the property or nullif non existent.
- Throws:
- RepositoryException- if the configuration file cannot be found.
 
 - 
getReadOnlyCredentialspublic Credentials getReadOnlyCredentials() Returns the read-only credentials created from the username and password specified in the configuration properties. Configuration properties are defined in the file:repositoryStubImpl.properties.- Returns:
- read-only Credentials
 
 - 
getReadWriteCredentialspublic Credentials getReadWriteCredentials() Returns the read-write credentials created from the username and password specified in the configuration properties. Configuration properties are defined in the file:repositoryStubImpl.properties.- Returns:
- read-write Credentials
 
 - 
getSuperuserCredentialspublic Credentials getSuperuserCredentials() Returns the superuser credentials created from the username and password specified in the configuration properties. Configuration properties are defined in the file:repositoryStubImpl.properties.- Returns:
- superuser Credentials
 
 - 
getKnownPrincipalpublic Principal getKnownPrincipal(Session session) throws RepositoryException Returns aPrincipalidentifying a known user.- Parameters:
- session-
- Throws:
- RepositoryException
 
 - 
getUnknownPrincipalpublic Principal getUnknownPrincipal(Session session) throws NotExecutableException, RepositoryException Returns aPrincipalidentifiying an unknown user.- Parameters:
- session-
- Throws:
- NotExecutableException
- RepositoryException
 
 
- 
 
-