Fix tests overriding mock engine to avoid builtin mock

This commit is contained in:
Ryan Ernst 2016-11-08 16:13:16 -08:00
parent 6ecb023468
commit 05e96089e1
2 changed files with 20 additions and 2 deletions

View File

@ -50,8 +50,10 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful;
@ -63,7 +65,14 @@ import static org.hamcrest.Matchers.equalTo;
public class RandomExceptionCircuitBreakerIT extends ESIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class, MockEngineFactoryPlugin.class);
return Arrays.asList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class);
}
@Override
protected Collection<Class<? extends Plugin>> getMockPlugins() {
Set<Class<? extends Plugin>> mocks = new HashSet<>(super.getMockPlugins());
mocks.remove(MockEngineFactoryPlugin.class);
return mocks;
}
public void testBreakerWithRandomExceptions() throws IOException, InterruptedException, ExecutionException {

View File

@ -47,8 +47,10 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
@ -57,7 +59,14 @@ public class SearchWithRandomExceptionsIT extends ESIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class, MockEngineFactoryPlugin.class);
return Arrays.asList(RandomExceptionDirectoryReaderWrapper.TestPlugin.class);
}
@Override
protected Collection<Class<? extends Plugin>> getMockPlugins() {
Set<Class<? extends Plugin>> mocks = new HashSet<>(super.getMockPlugins());
mocks.remove(MockEngineFactoryPlugin.class);
return mocks;
}
public void testRandomExceptions() throws IOException, InterruptedException, ExecutionException {