Hello, Pratick. Welcome to mysterious world of Solr testing. The best way is to find existing test closest to your problem field, copy in and amend necessarily. What about https://github.com/apache/lucene-solr/blob/master/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java ?
On Fri, May 10, 2019 at 11:36 PM Pratik Patel <pra...@semandex.net> wrote: > Hello Everyone, > > I want to write unit tests for some solr queries which are being triggered > through java code. These queries includes complex streaming expressions and > faceting queries which requires large number of documents to be present in > solr index. I can not create and push so many documents programmatically > through my tests. > > I am trying to find a way to test these queries without depending on > externally running solr instance. I found following approach which is using > classes like EmbeddedSolrServer and CoreContainer. We can put index files > and solr configuration on classpath and run the tests against them. > > https://dzone.com/articles/junit-testing-for-solr-6 > > However, this seems to be an old approach and I am trying to find a way to > do it using latest solr-test-framework. I also can not use old approach > because I want to test Streaming Expressions as well and I need > SolrCloudClient for that. > In solr-test-framework, I found MiniSolrCloudCluster class but I don't know > how to use pre-created index files and configuration with that. > > Does anyone know how we can use pre-created index files and configuration > with latest test-framework? What is the recommended way to do such kind of > testing? Any direction with this would be really helpful. > > Thanks! > Pratik > -- Sincerely yours Mikhail Khludnev