Class RepositoryStub
- java.lang.Object
-
- org.apache.jackrabbit.test.RepositoryStub
-
- Direct Known Subclasses:
JackrabbitRepositoryStub
,JNDIRepositoryStub
public abstract class RepositoryStub extends Object
TheRepositoryStub
is the entry point to the JCR Repository for the TCK Test harness.Implementors of the JCR specification need to provide an implementation for the abstract methods defined in this class.
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
RepositoryStub(Properties env)
Implementations of this class must overwrite this constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static RepositoryStub
getInstance(Map configuration)
Creates and/or returns the configuredRepositryStub
implementation.abstract Principal
getKnownPrincipal(Session session)
Returns aPrincipal
identifiying a known user (not group)String
getProperty(String name)
Returns the property with the specifiedname
.Credentials
getReadOnlyCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.Credentials
getReadWriteCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.abstract Repository
getRepository()
Returns a reference to theRepository
provided by thisRepositoryStub
.Credentials
getSuperuserCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.abstract Principal
getUnknownPrincipal(Session session)
Returns aPrincipal
identifiying an unknown user.
-
-
-
Field Detail
-
STUB_IMPL_PROPS
public static final String STUB_IMPL_PROPS
- See Also:
- Constant Field Values
-
PROP_PREFIX
public static final String PROP_PREFIX
- See Also:
- Constant Field Values
-
STUB_IMPL_SYS_PROPS
public static final String STUB_IMPL_SYS_PROPS
- See Also:
- Constant Field Values
-
PROP_STUB_IMPL_CLASS
public static final String PROP_STUB_IMPL_CLASS
- See Also:
- Constant Field Values
-
PROP_SUPERUSER_PWD
public static final String PROP_SUPERUSER_PWD
- See Also:
- Constant Field Values
-
PROP_SUPERUSER_NAME
public static final String PROP_SUPERUSER_NAME
- See Also:
- Constant Field Values
-
PROP_READONLY_PWD
public static final String PROP_READONLY_PWD
- See Also:
- Constant Field Values
-
PROP_READONLY_NAME
public static final String PROP_READONLY_NAME
- See Also:
- Constant Field Values
-
PROP_READWRITE_PWD
public static final String PROP_READWRITE_PWD
- See Also:
- Constant Field Values
-
PROP_READWRITE_NAME
public static final String PROP_READWRITE_NAME
- See Also:
- Constant Field Values
-
PROP_NODETYPE
public static final String PROP_NODETYPE
- See Also:
- Constant Field Values
-
PROP_NODETYPETESTROOT
public static final String PROP_NODETYPETESTROOT
- See Also:
- Constant Field Values
-
PROP_NODETYPENOCHILDREN
public static final String PROP_NODETYPENOCHILDREN
- See Also:
- Constant Field Values
-
PROP_TESTROOT
public static final String PROP_TESTROOT
- See Also:
- Constant Field Values
-
PROP_NODE_NAME1
public static final String PROP_NODE_NAME1
- See Also:
- Constant Field Values
-
PROP_NODE_NAME2
public static final String PROP_NODE_NAME2
- See Also:
- Constant Field Values
-
PROP_NODE_NAME3
public static final String PROP_NODE_NAME3
- See Also:
- Constant Field Values
-
PROP_NODE_NAME4
public static final String PROP_NODE_NAME4
- See Also:
- Constant Field Values
-
PROP_PROP_NAME1
public static final String PROP_PROP_NAME1
- See Also:
- Constant Field Values
-
PROP_PROP_NAME2
public static final String PROP_PROP_NAME2
- See Also:
- Constant Field Values
-
PROP_PROP_VALUE1
public static final String PROP_PROP_VALUE1
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_PROP_VALUE2
public static final String PROP_PROP_VALUE2
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_PROP_TYPE1
public static final String PROP_PROP_TYPE1
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_PROP_TYPE2
public static final String PROP_PROP_TYPE2
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_WORKSPACE_NAME
public static final String PROP_WORKSPACE_NAME
- See Also:
- Constant Field Values
-
PROP_NAMESPACES
public static final String PROP_NAMESPACES
- See Also:
- Constant Field Values
-
PROP_LOCK_TIMEOUT
public static final String PROP_LOCK_TIMEOUT
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_LOCK_OWNER
public static final String PROP_LOCK_OWNER
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_OPEN_SCOPED_LOCK_MULTIPLE
public static final String PROP_OPEN_SCOPED_LOCK_MULTIPLE
Determines whether the repository implementation allows open scoped locks to be owned by multiple sessions (see JCR 2.0 Section 17.3).- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
PROP_HOLD_NAME
public static final String PROP_HOLD_NAME
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
RETENTION_POLICY_HOLDER
public static final String RETENTION_POLICY_HOLDER
- See Also:
- Constant Field Values
-
REPOSITORY_FACTORY
public static final String REPOSITORY_FACTORY
- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
environment
protected final Properties environment
-
superuser
protected SimpleCredentials superuser
-
readonly
protected SimpleCredentials readonly
-
readwrite
protected SimpleCredentials readwrite
-
-
Constructor Detail
-
RepositoryStub
protected RepositoryStub(Properties env)
Implementations of this class must overwrite this constructor.- Parameters:
env
- the environment variables. This parameter must not be null.
-
-
Method Detail
-
getInstance
public static RepositoryStub getInstance(Map configuration) throws RepositoryStubException
Creates and/or returns the configuredRepositryStub
implementation.The property file is located in the following sequence:
- If the system property
-Djavax.jcr.tck.properties
is set, then the accroding file is used as configuration. - If the system property
-Djavax.jcr.tck.properties
is not set, then the TCK tries to load the filerepositoryStubImpl.properties
as a resource from the ClassLoader of thisRepositryStub
class.
configuration
map.- Parameters:
configuration
- aMap
of additional configuration entries.- Returns:
- a
RepositoryStub
implementation. - Throws:
RepositoryStubException
- If the system property
-
getRepository
public abstract Repository getRepository() throws RepositoryStubException
Returns a reference to theRepository
provided by thisRepositoryStub
.- Returns:
- Throws:
RepositoryStubException
-
getSuperuserCredentials
public Credentials getSuperuserCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.The
Credentials
returned has 'superuser' rights. That is, theSession
object returned byRepository.login(Credentials)
has read write access to the whole Content Repository.- Returns:
- a
Credentials
object, that allows to login to theRepository
as 'superuser'.
-
getReadWriteCredentials
public Credentials getReadWriteCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.The
Credentials
returned has read/write rights. That is, theSession
object returned byRepository.login(Credentials)
has read write access to theNode
configured in the JCR TCK Interview.For details, see: JCR TCK User Guide.
- Returns:
- a
Credentials
object, that allows to login to theRepository
with read/write right.
-
getReadOnlyCredentials
public Credentials getReadOnlyCredentials()
Returns aCredentials
object, that can be used to login to theRepository
returned bygetRepository()
.The
Credentials
returned must have read-only rights. That is, theSession
object returned byRepository.login()
has read-only access to theNode
configured in the JCR TCK Interview.For details, see: JCR TCK User Guide.
- Returns:
- a
Credentials
object, that allows to login to theRepository
with read-only right.
-
getProperty
public String getProperty(String name)
Returns the property with the specifiedname
. If a property with the given name does not exist,null
is returned.- Parameters:
name
- the name of the property.- Returns:
- the property, or
null
if the property does not exist.
-
getKnownPrincipal
public abstract Principal getKnownPrincipal(Session session) throws RepositoryException
Returns aPrincipal
identifiying a known user (not group)- Parameters:
session
-- Throws:
RepositoryException
-
getUnknownPrincipal
public abstract Principal getUnknownPrincipal(Session session) throws RepositoryException, NotExecutableException
Returns aPrincipal
identifiying an unknown user.- Parameters:
session
-- Throws:
NotExecutableException
- if the implementation can not provide an instance of Principal for unkwnown usersRepositoryException
-
-