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.NodeIterator
getNodes()
javax.jcr.query.RowIterator
getRows()
String[]
getSelectorNames()
void
setSimulateUnknownSize(boolean simulateUnknownSize)
-
-
-
Method Detail
-
setSimulateUnknownSize
public void setSimulateUnknownSize(boolean simulateUnknownSize)
-
getColumnNames
public String[] getColumnNames() throws javax.jcr.RepositoryException
- Specified by:
getColumnNames
in interfacejavax.jcr.query.QueryResult
- Throws:
javax.jcr.RepositoryException
-
getRows
public javax.jcr.query.RowIterator getRows() throws javax.jcr.RepositoryException
- Specified by:
getRows
in interfacejavax.jcr.query.QueryResult
- Throws:
javax.jcr.RepositoryException
-
getNodes
public javax.jcr.NodeIterator getNodes() throws javax.jcr.RepositoryException
- Specified by:
getNodes
in interfacejavax.jcr.query.QueryResult
- Throws:
javax.jcr.RepositoryException
-
getSelectorNames
public String[] getSelectorNames() throws javax.jcr.RepositoryException
- Specified by:
getSelectorNames
in interfacejavax.jcr.query.QueryResult
- Throws:
javax.jcr.RepositoryException
-
-