Class MockQueryResult
java.lang.Object
org.apache.sling.testing.mock.jcr.MockQueryResult
- All Implemented Interfaces:
javax.jcr.query.QueryResult
@ProviderType
public final class MockQueryResult
extends Object
implements javax.jcr.query.QueryResult
Mock implementation of
QueryResult.
Allows to manually set the expected result, optional with column names
(which are interpreted as property names of the nodes of the result list).-
Constructor Summary
ConstructorsConstructorDescriptionMockQueryResult(List<javax.jcr.Node> nodes) MockQueryResult(List<javax.jcr.Node> nodes, List<String> columnNames) -
Method Summary
Modifier and TypeMethodDescriptionString[]javax.jcr.NodeIteratorgetNodes()javax.jcr.query.RowIteratorgetRows()String[]voidsetSimulateUnknownSize(boolean simulateUnknownSize)
-
Constructor Details
-
MockQueryResult
-
MockQueryResult
-
-
Method Details
-
setSimulateUnknownSize
public void setSimulateUnknownSize(boolean simulateUnknownSize) -
getColumnNames
- Specified by:
getColumnNamesin interfacejavax.jcr.query.QueryResult- Throws:
javax.jcr.RepositoryException
-
getRows
public javax.jcr.query.RowIterator getRows() throws javax.jcr.RepositoryException- Specified by:
getRowsin interfacejavax.jcr.query.QueryResult- Throws:
javax.jcr.RepositoryException
-
getNodes
public javax.jcr.NodeIterator getNodes() throws javax.jcr.RepositoryException- Specified by:
getNodesin interfacejavax.jcr.query.QueryResult- Throws:
javax.jcr.RepositoryException
-
getSelectorNames
- Specified by:
getSelectorNamesin interfacejavax.jcr.query.QueryResult- Throws:
javax.jcr.RepositoryException
-