SOLR-9976: Fix init bug in SegmentsInfoRequestHandlerTest

This commit is contained in:
Chris Hostetter 2017-01-17 14:42:41 -07:00
parent e816fbe233
commit 39eec660ca
2 changed files with 18 additions and 7 deletions

View File

@ -90,6 +90,11 @@ Jetty 9.3.14.v20161028
Detailed Change List Detailed Change List
---------------------- ----------------------
Bug Fixes
----------------------
* SOLR-9976: Fix init bug in SegmentsInfoRequestHandlerTest (hossman)
Optimizations Optimizations
---------------------- ----------------------

View File

@ -16,9 +16,11 @@
*/ */
package org.apache.solr.handler.admin; package org.apache.solr.handler.admin;
import org.apache.lucene.index.LogDocMergePolicy;
import org.apache.lucene.util.Version; import org.apache.lucene.util.Version;
import org.apache.solr.index.LogDocMergePolicyFactory;
import org.apache.solr.util.AbstractSolrTestCase; import org.apache.solr.util.AbstractSolrTestCase;
import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
@ -32,13 +34,17 @@ public class SegmentsInfoRequestHandlerTest extends AbstractSolrTestCase {
@BeforeClass @BeforeClass
public static void beforeClass() throws Exception { public static void beforeClass() throws Exception {
System.setProperty("enable.update.log", "false");
System.setProperty("solr.tests.useMergePolicy", "false");
initCore("solrconfig.xml", "schema12.xml");
}
@Before // we need a consistent segmentation to ensure we don't get a random
public void before() throws Exception { // merge that reduces the total num docs in all segments, or the number of deletes
//
systemSetPropertySolrTestsMergePolicy(LogDocMergePolicy.class.getName());
systemSetPropertySolrTestsMergePolicyFactory(LogDocMergePolicyFactory.class.getName());
System.setProperty("enable.update.log", "false"); // no _version_ in our schema
initCore("solrconfig.xml", "schema12.xml"); // segments API shouldn't depend on _version_ or ulog
// build up an index with at least 2 segments and some deletes
for (int i = 0; i < DOC_COUNT; i++) { for (int i = 0; i < DOC_COUNT; i++) {
assertU(adoc("id","SOLR100" + i, "name","Apache Solr:" + i)); assertU(adoc("id","SOLR100" + i, "name","Apache Solr:" + i));
} }