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 ofQueryResult. 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
Constructors Constructor Description MockQueryResult(List<javax.jcr.Node> nodes)MockQueryResult(List<javax.jcr.Node> nodes, List<String> columnNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getColumnNames()javax.jcr.NodeIteratorgetNodes()javax.jcr.query.RowIteratorgetRows()String[]getSelectorNames()voidsetSimulateUnknownSize(boolean simulateUnknownSize)
-
-
-
Method Detail
-
setSimulateUnknownSize
public void setSimulateUnknownSize(boolean simulateUnknownSize)
-
getColumnNames
public String[] getColumnNames() throws javax.jcr.RepositoryException
- 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
public String[] getSelectorNames() throws javax.jcr.RepositoryException
- Specified by:
getSelectorNamesin interfacejavax.jcr.query.QueryResult- Throws:
javax.jcr.RepositoryException
-
-