SOLR-12833: Test should use ExecutorUtil

(cherry picked from commit 1f91932ba4)
This commit is contained in:
David Smiley 2019-05-01 14:30:35 -04:00
parent 559533680c
commit 688c8d285f
1 changed files with 7 additions and 7 deletions

View File

@ -17,23 +17,19 @@
package org.apache.solr.update.processor;
import static org.hamcrest.CoreMatchers.is;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.function.Function;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.ExecutorUtil;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.update.AddUpdateCommand;
@ -49,6 +45,10 @@ import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import static org.hamcrest.CoreMatchers.is;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
public class DistributedUpdateProcessorTest extends SolrTestCaseJ4 {
@Rule
@ -57,10 +57,10 @@ public class DistributedUpdateProcessorTest extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
executor = Executors.newCachedThreadPool();
executor = ExecutorUtil.newMDCAwareCachedThreadPool(getClassName());
initCore("solr/collection1/conf/solrconfig.xml","solr/collection1/conf/schema-minimal-with-another-uniqkey.xml");
}
@AfterClass
public static void AfterClass() {
executor.shutdown();