Class 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 Detail

      • MockQueryResult

        public MockQueryResult​(List<javax.jcr.Node> nodes)
      • MockQueryResult

        public MockQueryResult​(List<javax.jcr.Node> nodes,
                               List<String> columnNames)
    • Method Detail

      • setSimulateUnknownSize

        public void setSimulateUnknownSize​(boolean simulateUnknownSize)
      • getColumnNames

        public String[] getColumnNames()
                                throws javax.jcr.RepositoryException
        Specified by:
        getColumnNames in interface javax.jcr.query.QueryResult
        Throws:
        javax.jcr.RepositoryException
      • getRows

        public javax.jcr.query.RowIterator getRows()
                                            throws javax.jcr.RepositoryException
        Specified by:
        getRows in interface javax.jcr.query.QueryResult
        Throws:
        javax.jcr.RepositoryException
      • getNodes

        public javax.jcr.NodeIterator getNodes()
                                        throws javax.jcr.RepositoryException
        Specified by:
        getNodes in interface javax.jcr.query.QueryResult
        Throws:
        javax.jcr.RepositoryException
      • getSelectorNames

        public String[] getSelectorNames()
                                  throws javax.jcr.RepositoryException
        Specified by:
        getSelectorNames in interface javax.jcr.query.QueryResult
        Throws:
        javax.jcr.RepositoryException