Class MockSearchableSolrClient

  • All Implemented Interfaces:
    Closeable, Serializable, AutoCloseable

    public class MockSearchableSolrClient
    extends org.apache.solr.client.solrj.SolrClient
    Simple mock client that collects added documents and supports simple search by id (both {!term f=id} and id: syntax is supported) or *:*.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Map<String,​Map<String,​org.apache.solr.common.SolrInputDocument>> docs  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void close()  
      long getNumQueries()  
      long getNumUpdates()  
      org.apache.solr.common.util.NamedList<Object> request​(org.apache.solr.client.solrj.SolrRequest<?> request, String coll)  
      • Methods inherited from class org.apache.solr.client.solrj.SolrClient

        add, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getBinder, getById, getById, getById, getById, getById, getById, getById, getById, getContext, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
    • Field Detail

      • docs

        public Map<String,​Map<String,​org.apache.solr.common.SolrInputDocument>> docs
    • Constructor Detail

      • MockSearchableSolrClient

        public MockSearchableSolrClient()
    • Method Detail

      • clear

        public void clear()
      • request

        public org.apache.solr.common.util.NamedList<Object> request​(org.apache.solr.client.solrj.SolrRequest<?> request,
                                                                     String coll)
                                                              throws org.apache.solr.client.solrj.SolrServerException,
                                                                     IOException
        Specified by:
        request in class org.apache.solr.client.solrj.SolrClient
        Throws:
        org.apache.solr.client.solrj.SolrServerException
        IOException
      • getNumUpdates

        public long getNumUpdates()
      • getNumQueries

        public long getNumQueries()