Merge pull request elastic/elasticsearch#1235 from nik9000/more_remove_inject
Stop building query parsers with guice Original commit: elastic/x-pack-elasticsearch@c621cfc94d
This commit is contained in:
commit
1feea91734
|
@ -56,7 +56,7 @@ public class AuditTrailModuleTests extends ESTestCase {
|
|||
try {
|
||||
Injector injector = Guice.createInjector(
|
||||
new SettingsModule(settings, new SettingsFilter(settings)),
|
||||
new NetworkModule(new NetworkService(settings), settings, false) {
|
||||
new NetworkModule(new NetworkService(settings), settings, false, null) {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(Transport.class).to(LocalTransport.class).asEagerSingleton();
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.elasticsearch.action.search.SearchType;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
|
@ -34,7 +33,6 @@ import org.joda.time.DateTime;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -134,7 +132,7 @@ public class WatcherUtilsTests extends ESTestCase {
|
|||
builder = WatcherUtils.writeSearchRequest(expectedRequest, builder, ToXContent.EMPTY_PARAMS);
|
||||
XContentParser parser = XContentHelper.createParser(builder.bytes());
|
||||
assertThat(parser.nextToken(), equalTo(XContentParser.Token.START_OBJECT));
|
||||
IndicesQueriesRegistry registry = new IndicesQueriesRegistry(Settings.EMPTY, Collections.singleton(new MatchAllQueryParser()), new NamedWriteableRegistry());
|
||||
IndicesQueriesRegistry registry = new IndicesQueriesRegistry(Settings.EMPTY, singletonMap("match_all", new MatchAllQueryParser()));
|
||||
QueryParseContext context = new QueryParseContext(registry);
|
||||
context.reset(parser);
|
||||
SearchRequest result = WatcherUtils.readSearchRequest(parser, ExecutableSearchInput.DEFAULT_SEARCH_TYPE, context);
|
||||
|
@ -220,7 +218,7 @@ public class WatcherUtilsTests extends ESTestCase {
|
|||
|
||||
XContentParser parser = XContentHelper.createParser(builder.bytes());
|
||||
assertThat(parser.nextToken(), equalTo(XContentParser.Token.START_OBJECT));
|
||||
IndicesQueriesRegistry registry = new IndicesQueriesRegistry(Settings.EMPTY, Collections.singleton(new MatchAllQueryParser()), new NamedWriteableRegistry());
|
||||
IndicesQueriesRegistry registry = new IndicesQueriesRegistry(Settings.EMPTY, singletonMap("match_all", new MatchAllQueryParser()));
|
||||
QueryParseContext context = new QueryParseContext(registry);
|
||||
context.reset(parser);
|
||||
SearchRequest result = WatcherUtils.readSearchRequest(parser, ExecutableSearchInput.DEFAULT_SEARCH_TYPE, context);
|
||||
|
|
|
@ -7,7 +7,6 @@ package org.elasticsearch.watcher.watch;
|
|||
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
@ -347,7 +346,7 @@ public class WatchTests extends ESTestCase {
|
|||
Map<String, InputFactory> parsers = new HashMap<>();
|
||||
switch (input.type()) {
|
||||
case SearchInput.TYPE:
|
||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry(Settings.EMPTY, Collections.singleton(new MatchAllQueryParser()), new NamedWriteableRegistry());
|
||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry(Settings.EMPTY, singletonMap("match_all", new MatchAllQueryParser()));
|
||||
parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, queryRegistry));
|
||||
return new InputRegistry(parsers);
|
||||
default:
|
||||
|
@ -407,7 +406,7 @@ public class WatchTests extends ESTestCase {
|
|||
}
|
||||
|
||||
private TransformRegistry transformRegistry() {
|
||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry(Settings.EMPTY, Collections.singleton(new MatchAllQueryParser()), new NamedWriteableRegistry());
|
||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry(Settings.EMPTY, singletonMap("match_all", new MatchAllQueryParser()));
|
||||
Map<String, TransformFactory> factories = new HashMap<>();
|
||||
ChainTransformFactory parser = new ChainTransformFactory();
|
||||
factories.put(ChainTransform.TYPE, parser);
|
||||
|
|
Loading…
Reference in New Issue