From 023bdb72b23d28672396747abd6032b441c25e66 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 15 Sep 2017 09:25:36 +0200 Subject: [PATCH] Add common-analysis plugin to several xpack integ tests (elastic/x-pack-elasticsearch#2501) Several tests miss the common-analysis plugin in the old-style integ tests causing odd exceptions in the test logs. This adds the missing plugin reference. relates elastic/x-pack-elasticsearch#2363 Original commit: elastic/x-pack-elasticsearch@e4e673540804157b83a5b59daea7e64660a910dd --- .../integration/DocumentLevelSecurityTests.java | 5 ++--- .../elasticsearch/integration/FieldLevelSecurityTests.java | 3 ++- .../license/AbstractLicensesIntegrationTestCase.java | 4 +++- .../license/LicenseServiceClusterNotRecoveredTests.java | 3 ++- .../elasticsearch/license/LicenseServiceClusterTests.java | 3 ++- .../org/elasticsearch/license/TribeTransportTestCase.java | 2 ++ .../elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java | 4 +++- .../xpack/upgrade/IndexUpgradeIntegTestCase.java | 4 +++- .../xpack/upgrade/InternalIndexReindexerIT.java | 3 ++- 9 files changed, 21 insertions(+), 10 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java b/plugin/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java index 1cab06d7c3d..5715f5b574b 100644 --- a/plugin/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java +++ b/plugin/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java @@ -18,6 +18,7 @@ import org.elasticsearch.action.termvectors.MultiTermVectorsResponse; import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.action.termvectors.TermVectorsResponse; import org.elasticsearch.action.update.UpdateRequest; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.client.Requests; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; @@ -61,7 +62,6 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFa import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits; import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER; import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; @@ -73,8 +73,7 @@ public class DocumentLevelSecurityTests extends SecurityIntegTestCase { @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class, - InternalSettingsPlugin.class); + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class, ParentJoinPlugin.class, InternalSettingsPlugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java b/plugin/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java index 81416305994..d0727a1e90d 100644 --- a/plugin/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java +++ b/plugin/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java @@ -18,6 +18,7 @@ import org.elasticsearch.action.termvectors.MultiTermVectorsResponse; import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.action.termvectors.TermVectorsResponse; import org.elasticsearch.action.update.UpdateRequest; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.client.Requests; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; @@ -72,7 +73,7 @@ public class FieldLevelSecurityTests extends SecurityIntegTestCase { @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class, + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class, ParentJoinPlugin.class, InternalSettingsPlugin.class); } diff --git a/plugin/src/test/java/org/elasticsearch/license/AbstractLicensesIntegrationTestCase.java b/plugin/src/test/java/org/elasticsearch/license/AbstractLicensesIntegrationTestCase.java index e7b990723a6..4adf914121a 100644 --- a/plugin/src/test/java/org/elasticsearch/license/AbstractLicensesIntegrationTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/license/AbstractLicensesIntegrationTestCase.java @@ -5,10 +5,12 @@ */ package org.elasticsearch.license; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.concurrent.CountDownLatch; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.MetaData; @@ -37,7 +39,7 @@ public abstract class AbstractLicensesIntegrationTestCase extends ESIntegTestCas @Override protected Collection> nodePlugins() { - return Collections.>singletonList(XPackPlugin.class); + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterNotRecoveredTests.java b/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterNotRecoveredTests.java index 22a514a8462..b16244419fc 100644 --- a/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterNotRecoveredTests.java +++ b/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterNotRecoveredTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.license; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; @@ -36,7 +37,7 @@ public class LicenseServiceClusterNotRecoveredTests extends AbstractLicensesInte @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, Netty4Plugin.class); + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class, Netty4Plugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterTests.java b/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterTests.java index 0fe8018bad9..44ed4f0d8e2 100644 --- a/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterTests.java +++ b/plugin/src/test/java/org/elasticsearch/license/LicenseServiceClusterTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.license; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; @@ -42,7 +43,7 @@ public class LicenseServiceClusterTests extends AbstractLicensesIntegrationTestC @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, Netty4Plugin.class); + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class, Netty4Plugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java b/plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java index 172cecba185..ecb290e07c6 100644 --- a/plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java @@ -9,6 +9,7 @@ import org.elasticsearch.action.Action; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.client.Client; import org.elasticsearch.client.Requests; import org.elasticsearch.cluster.health.ClusterHealthStatus; @@ -111,6 +112,7 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { plugins.add(MockTribePlugin.class); plugins.add(TribeAwareTestZenDiscoveryPlugin.class); plugins.add(XPackPlugin.class); + plugins.add(CommonAnalysisPlugin.class); return plugins; } diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java index ef38ff9c99b..1e35ea10179 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java @@ -12,6 +12,7 @@ import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.settings.Settings; @@ -93,7 +94,8 @@ public abstract class BaseMlIntegTestCase extends ESIntegTestCase { @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, ReindexPlugin.class); + return Arrays.asList(XPackPlugin.class, CommonAnalysisPlugin.class, + ReindexPlugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIntegTestCase.java b/plugin/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIntegTestCase.java index 98053e257d5..b9abf187317 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIntegTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIntegTestCase.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.xpack.upgrade; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.reindex.ReindexPlugin; @@ -52,7 +53,8 @@ public abstract class IndexUpgradeIntegTestCase extends AbstractLicensesIntegrat @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, ReindexPlugin.class, MockPainlessScriptEngine.TestPlugin.class); + return Arrays.asList(XPackPlugin.class, ReindexPlugin.class, MockPainlessScriptEngine.TestPlugin.class, + CommonAnalysisPlugin.class); } @Override diff --git a/plugin/src/test/java/org/elasticsearch/xpack/upgrade/InternalIndexReindexerIT.java b/plugin/src/test/java/org/elasticsearch/xpack/upgrade/InternalIndexReindexerIT.java index 2307dd125f2..838e13f8b87 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/upgrade/InternalIndexReindexerIT.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/upgrade/InternalIndexReindexerIT.java @@ -12,6 +12,7 @@ import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.WriteRequest; +import org.elasticsearch.analysis.common.CommonAnalysisPlugin; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.metadata.AliasMetaData; @@ -52,7 +53,7 @@ public class InternalIndexReindexerIT extends IndexUpgradeIntegTestCase { @Override protected Collection> nodePlugins() { - return Arrays.asList(XPackPlugin.class, ReindexPlugin.class, CustomScriptPlugin.class); + return Arrays.asList(XPackPlugin.class, ReindexPlugin.class, CustomScriptPlugin.class, CommonAnalysisPlugin.class); } public static class CustomScriptPlugin extends MockScriptPlugin {