import org.lilyproject.solrtestfw.SolrProxy;
public class SolrProxyTest {
@Test
public void testDynamicallyChangingNumberOfCores() throws Exception {
SolrProxy solr = new SolrProxy();
solr.start();
testSolrCore("core0", 200);
testSolrCore("core1", 404);
// Increase number of cores
solr.changeSolrDefinition(new SolrDefinition(
SolrDefinition.core("core0"),
SolrDefinition.core("core1")
));
testSolrCore("core0", 200);
testSolrCore("core1", 200);
testSolrCore("core2", 404);
// Reduce number of cores
solr.changeSolrDefinition(new SolrDefinition(
SolrDefinition.core("core0")
));
testSolrCore("core0", 200);
testSolrCore("core1", 404);
// Increase number of cores again
solr.changeSolrDefinition(new SolrDefinition(
SolrDefinition.core("core0"),
SolrDefinition.core("core1"),
SolrDefinition.core("core2")
));
testSolrCore("core0", 200);
testSolrCore("core1", 200);
testSolrCore("core2", 200);
testSolrCore("core3", 404);
solr.stop();
}