You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Yonatan Nakar <sn...@gmail.com> on 2014/08/30 23:17:11 UTC

Testing a custom distributed component

I'm trying to write unit tests for a search component of my own. My
component is intended to run in a distributed setting only. The problem is
that it seems like Solr's testing framework doesn't make it easy to write
unit tests for distributed test components. What is the right way to test
such a component?

More details about my problem here:
http://stackoverflow.com/questions/25586021/testing-a-solr-distributed-component

Re: Testing a custom distributed component

Posted by Mark Miller <ma...@gmail.com>.
bq.  so helper methods aren't there

Yeah, it would be nice to pull those out so they can easily be used in both
cases.

-- 
- Mark

http://about.me/markrmiller

On Sat, Aug 30, 2014 at 8:11 PM, Steve Davids <sd...@gmail.com> wrote:

> If you don't want to use the BaseDistributedSearchTestCase
> <http://lucene.apache.org/solr/4_9_0/solr-test-framework/org/apache/solr/BaseDistributedSearchTestCase.html> you
> can utilize the newly introduced MiniSolrCloudCluster (
> http://lucene.apache.org/solr/4_9_0/solr-test-framework/org/apache/solr/cloud/MiniSolrCloudCluster.html)
> it works rather well. This class doesn't extend the base solr tests case so
> helper methods aren't there, instead you can use that class to spin up a
> CloudSolrServer to index/query to your liking within the test.
>
> Sent from my iPhone
>
> On Aug 30, 2014, at 5:17 PM, Yonatan Nakar <sn...@gmail.com> wrote:
>
> I'm trying to write unit tests for a search component of my own. My
> component is intended to run in a distributed setting only. The problem is
> that it seems like Solr's testing framework doesn't make it easy to write
> unit tests for distributed test components. What is the right way to test
> such a component?
>
> More details about my problem here:
> http://stackoverflow.com/questions/25586021/testing-a-solr-distributed-component
>
>

Re: Testing a custom distributed component

Posted by Steve Davids <sd...@gmail.com>.
If you don't want to use the BaseDistributedSearchTestCase you can utilize the newly introduced MiniSolrCloudCluster (http://lucene.apache.org/solr/4_9_0/solr-test-framework/org/apache/solr/cloud/MiniSolrCloudCluster.html) it works rather well. This class doesn't extend the base solr tests case so helper methods aren't there, instead you can use that class to spin up a CloudSolrServer to index/query to your liking within the test.

Sent from my iPhone

> On Aug 30, 2014, at 5:17 PM, Yonatan Nakar <sn...@gmail.com> wrote:
> 
> I'm trying to write unit tests for a search component of my own. My component is intended to run in a distributed setting only. The problem is that it seems like Solr's testing framework doesn't make it easy to write unit tests for distributed test components. What is the right way to test such a component?
> 
> More details about my problem here: http://stackoverflow.com/questions/25586021/testing-a-solr-distributed-component
>