@ConsumerType
public final class MockJcr
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_USER_ID
Default user id
|
static java.lang.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 java.lang.String userId,
@Nullable java.lang.String workspaceName)
Create a new mocked in-memory JCR session.
|
static void |
setQueryResult(@NotNull javax.jcr.query.QueryManager queryManager,
@NotNull java.util.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 java.lang.String statement,
@NotNull java.lang.String language,
@NotNull java.util.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 java.util.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 java.lang.String statement,
@NotNull java.lang.String language,
@NotNull java.util.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 java.lang.String DEFAULT_WORKSPACE
public static final java.lang.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 java.lang.String userId,
@Nullable
@Nullable java.lang.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 java.util.List<javax.jcr.Node> resultList)
session - JCR sessionresultList - Result listpublic static void setQueryResult(@NotNull
@NotNull javax.jcr.query.QueryManager queryManager,
@NotNull
@NotNull java.util.List<javax.jcr.Node> resultList)
queryManager - Mocked query managerresultList - Result listpublic static void setQueryResult(@NotNull
@NotNull javax.jcr.Session session,
@NotNull
@NotNull java.lang.String statement,
@NotNull
@NotNull java.lang.String language,
@NotNull
@NotNull java.util.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 java.lang.String statement,
@NotNull
@NotNull java.lang.String language,
@NotNull
@NotNull java.util.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 © 2014–2021 wcm.io. All rights reserved.