Testing Solr via Embedded Server

Lici picture Lici · Jun 1, 2009 · Viewed 18.8k times · Source

I'm coding some tests for my solr-indexer application. Following testing best practices, I want to write code self-dependant, just loading the schema.xml and solrconfig.xml and creating a temporary data tree for the indexing-searching tests. As the application is most written in java, I'm dealing with SolrJ library, but I'm getting problems (well, I'm lost in the universe of corecontainers-coredescriptor-coreconfig-solrcore ...) Anyone can place here some code to create an Embedded Server that loads the config and also writes to a parameter-pased data-dir?

Answer

Mauricio Scheffer picture Mauricio Scheffer · Jun 2, 2009

You can start with the SolrExampleTests which extends SolrExampleTestBase which extends AbstractSolrTestCase .

Also this SampleTest.

Also take a look at this and this threads.