@ConsumerType public final class MockJcr extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_USER_ID
Default user id
|
static String |
DEFAULT_WORKSPACE
Default workspace name
|
Modifier and Type | Method and Description |
---|---|
static void |
addQueryResultHandler(@NotNull javax.jcr.query.QueryManager queryManager,
@NotNull MockQueryResultHandler resultHandler)
Adds a query result handler for the given query manager which may return query results for certain queries that are executed.
|
static void |
addQueryResultHandler(@NotNull javax.jcr.Session session,
@NotNull MockQueryResultHandler resultHandler)
Adds a query result handler for the given query manager which may return query results for certain queries that are executed.
|
static @NotNull javax.jcr.Repository |
newRepository()
Create a new mocked in-memory JCR repository.
|
static @NotNull javax.jcr.Session |
newSession()
Create a new mocked in-memory JCR session.
|
static @NotNull javax.jcr.Session |
newSession(@Nullable String userId,
@Nullable String workspaceName)
Create a new mocked in-memory JCR session.
|
static void |
setQueryResult(@NotNull javax.jcr.query.QueryManager queryManager,
@NotNull List<javax.jcr.Node> resultList)
Sets the expected result list for all queries executed with the given query manager.
|
static void |
setQueryResult(@NotNull javax.jcr.query.QueryManager queryManager,
@NotNull String statement,
@NotNull String language,
@NotNull List<javax.jcr.Node> resultList)
Sets the expected result list for all queries with the given statement executed with the given query manager.
|
static void |
setQueryResult(@NotNull javax.jcr.Session session,
@NotNull List<javax.jcr.Node> resultList)
Sets the expected result list for all queries executed with the given query manager.
|
static void |
setQueryResult(@NotNull javax.jcr.Session session,
@NotNull String statement,
@NotNull String language,
@NotNull List<javax.jcr.Node> resultList)
Sets the expected result list for all queries with the given statement executed with the given query manager.
|
public static final String DEFAULT_WORKSPACE
public static final String DEFAULT_USER_ID
@NotNull public static @NotNull javax.jcr.Repository newRepository()
@NotNull public static @NotNull javax.jcr.Session newSession()
@NotNull public static @NotNull javax.jcr.Session newSession(@Nullable @Nullable String userId, @Nullable @Nullable String workspaceName)
userId
- User id for the mock environment. If null a dummy value is used.workspaceName
- Workspace name for the mock environment. If null a dummy value is used.public static void setQueryResult(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull List<javax.jcr.Node> resultList)
session
- JCR sessionresultList
- Result listpublic static void setQueryResult(@NotNull @NotNull javax.jcr.query.QueryManager queryManager, @NotNull @NotNull List<javax.jcr.Node> resultList)
queryManager
- Mocked query managerresultList
- Result listpublic static void setQueryResult(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String statement, @NotNull @NotNull String language, @NotNull @NotNull List<javax.jcr.Node> resultList)
session
- JCR sessionstatement
- Query statementlanguage
- Query languageresultList
- Result listpublic static void setQueryResult(@NotNull @NotNull javax.jcr.query.QueryManager queryManager, @NotNull @NotNull String statement, @NotNull @NotNull String language, @NotNull @NotNull List<javax.jcr.Node> resultList)
queryManager
- Mocked query managerstatement
- Query statementlanguage
- Query languageresultList
- Result listpublic static void addQueryResultHandler(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull MockQueryResultHandler resultHandler)
session
- JCR sessionresultHandler
- Mock query result handlerpublic static void addQueryResultHandler(@NotNull @NotNull javax.jcr.query.QueryManager queryManager, @NotNull @NotNull MockQueryResultHandler resultHandler)
queryManager
- Mocked query managerresultHandler
- Mock query result handlerCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.