: I'm using SolrTestCaseJ4 to do some test for my program. I want to create : core with different core name, shard name, collection name, data dir ect. : But when I change the solr.xml core section. SolrTestCaseJ4 still create : core with default. So can I let SolrTestCaseJ4 use solr.xml information to : create core or is there other way to do it?
A lot of the Solr test infrastructure predates multi-core support in solr. SolrTestCaseJ4 replaced AbstractSolrTestCase in terms of bringing it up to date with "modern" JUnit conventions, but in it's common usage it still assumes you are dealing with a single core. To see an example of a test that deals well with multi-core, take a look at solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java we should really refactor out a new subclass of SolrTestCaseJ4 specificly for tests that just wnat to point to a solr home dir (with a solr.xml) to deal with arbitrary cores and core admin commands, it just hasn't happened yet (If you'd like to take a crack at contributing a patch along this lines, i know it owuld be apprecaited -- lots of people submit bug/feature patches, but test refactoring patches are few and far between) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
