You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/12/13 00:03:40 UTC

[Solr Wiki] Update of "TestingSolr" by chrismattmann

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "TestingSolr" page has been changed by chrismattmann.
The comment on this change is: testing page, with contributions from Shalin..
http://wiki.apache.org/solr/TestingSolr

--------------------------------------------------

New page:
= How to run Solr unit tests =

If you're going to be using or modifying Solr's source, unit tests are critical as they help uncover potential downstream runtime errors that you might encounter, and they help to isolate problems in any new functionality you're adding. The question is, how do you run Solr's unit tests? Read on below to find out.

= Ant and Junit =

Solr uses the [[http://ant.apache.org|Ant]] build system and leverages [[http://junit.org|Junit]] as its testing harness plugin. A description of these technologies is outside the scope of this page, but we recommend you go check out each individual project as they have their share of testing tutorials. This guide is meant as a quick and dirty path to testing out Solr using what's been chosen to test it.

= Running all tests =

ant test

Yes, it's that simple.

= Running a single unit test =

Run a single test using:
ant -Dtestcase=TestDistributedSearch clean test

Run tests inside a package (recursively):
ant -Dtestpackage=org.apache.solr.handler clean test

Run tests in package root:
ant -Dtestpackageroot=org.apache.solr.handler clean test

The above will exclude packages inside handler such as admin and component.