On 5/13/2014 12:46 PM, Vijay Balakrishnan wrote: > Is there any way to run self-contained JUnit tests for say a Solr dependent > class where it doesn't depend on Solr being up and running at > localhost:8983 ? I have a collection etc. setup on the Solr server. > > Is it possible to mockit with an EmbeddedSolr easily with a @Before or > @BeforeClass annotation in JUnit4 ? > > Any pointers to examples would be awesome(I am also trying to look in the > source).
An example of a Solr unit test that fires up Jetty (actually, more than one instance of Jetty) before testing is located here in the source download or checkout: solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java Thanks, Shawn