fixed tests

Original commit: elastic/x-pack-elasticsearch@bea8d61278
This commit is contained in:
uboness 2015-09-23 18:02:57 +02:00
parent 57561f9a03
commit 1c5e03a239
3 changed files with 20 additions and 1 deletions

View File

@ -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<Class<? extends Plugin>> 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()

View File

@ -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<Class<? extends Plugin>> 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()

View File

@ -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 {