From 1c5e03a239b86f72250285d6e05b70ce12d352c8 Mon Sep 17 00:00:00 2001 From: uboness Date: Wed, 23 Sep 2015 18:02:57 +0200 Subject: [PATCH] fixed tests Original commit: elastic/x-pack-elasticsearch@bea8d61278b1260fec7cb783dba88f19a626b9eb --- .../agent/collector/AbstractCollectorTestCase.java | 10 ++++++++++ .../marvel/license/LicenseIntegrationTests.java | 9 +++++++++ .../elasticsearch/marvel/test/MarvelIntegTestCase.java | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java index c993d90fc35..b00b7a18c25 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java @@ -28,6 +28,7 @@ import org.elasticsearch.marvel.shield.SecuredClient; import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.node.Node; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.Before; @@ -39,6 +40,15 @@ import java.util.concurrent.TimeUnit; @ClusterScope(scope = ESIntegTestCase.Scope.SUITE, randomDynamicTemplates = false, transportClientRatio = 0.0) public class AbstractCollectorTestCase extends MarvelIntegTestCase { + @Override + protected Collection> nodePlugins() { + if (shieldEnabled) { + return Arrays.asList(LicensePluginForCollectors.class, MarvelPlugin.class, ShieldPlugin.class); + } + return Arrays.asList(LicensePluginForCollectors.class, MarvelPlugin.class); + } + + @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() diff --git a/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java b/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java index c7705979032..98f7a5d82a3 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java @@ -19,6 +19,7 @@ import org.elasticsearch.marvel.MarvelPlugin; import org.elasticsearch.marvel.mode.Mode; import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.Test; @@ -31,6 +32,14 @@ import static org.hamcrest.Matchers.*; @ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0) public class LicenseIntegrationTests extends MarvelIntegTestCase { + @Override + protected Collection> nodePlugins() { + if (shieldEnabled) { + return Arrays.asList(MockLicensePlugin.class, MarvelPlugin.class, ShieldPlugin.class); + } + return Arrays.asList(MockLicensePlugin.class, MarvelPlugin.class); + } + @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() diff --git a/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java b/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java index 4593872a9b7..2f30f1cd006 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java @@ -35,7 +35,7 @@ import java.util.Collection; */ public class MarvelIntegTestCase extends ESIntegTestCase { - private static Boolean shieldEnabled; + protected static Boolean shieldEnabled; @Override protected TestCluster buildTestCluster(Scope scope, long seed) throws IOException {