Remove mock Netty plugins

These mock Netty plugins were needed to assist in setting
sun.nio.ch.bugLevel. Yet, settings this property should no longer be
needed on JDK 8 and the missing privileged block when writing this
property can be fixed upstream.

Relates elastic/elasticsearch#3047

Original commit: elastic/x-pack-elasticsearch@e2aa4f6fb5
This commit is contained in:
Jason Tedor 2016-08-05 14:58:50 -04:00 committed by GitHub
parent 656a6bb624
commit 7b7411f78d
12 changed files with 37 additions and 74 deletions

View File

@ -11,8 +11,8 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackPlugin;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -49,7 +49,7 @@ public class LicenseServiceClusterTests extends AbstractLicensesIntegrationTestC
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(XPackPlugin.class, MockNetty3Plugin.class, MockNetty4Plugin.class); return Arrays.asList(XPackPlugin.class, Netty3Plugin.class, Netty4Plugin.class);
} }
@Override @Override

View File

@ -12,8 +12,8 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.monitoring.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.xpack.monitoring.agent.AgentService; import org.elasticsearch.xpack.monitoring.agent.AgentService;
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
@ -52,8 +52,8 @@ public class MonitoringSettingsTests extends MonitoringIntegTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -12,8 +12,8 @@ import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.monitoring.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.elasticsearch.xpack.security.authc.support.SecuredString;
@ -49,8 +49,8 @@ public class MonitoringSettingsFilterTests extends MonitoringIntegTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -11,8 +11,8 @@ import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.elasticsearch.xpack.security.authc.support.SecuredString;
import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken; import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken;
import org.junit.Before; import org.junit.Before;
@ -138,8 +138,8 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -28,9 +28,9 @@ import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecurityIntegTestCase;
import org.elasticsearch.test.SecuritySettingsSource; import org.elasticsearch.test.SecuritySettingsSource;
import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.transport.Transport; import org.elasticsearch.transport.Transport;
import org.elasticsearch.xpack.MockNetty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin;
import org.elasticsearch.xpack.XPackTransportClient; import org.elasticsearch.xpack.XPackTransportClient;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;
import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken; import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken;
@ -102,8 +102,8 @@ public class LicensingTests extends SecurityIntegTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -11,8 +11,8 @@ import org.elasticsearch.common.io.PathUtils;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.discovery.DiscoveryModule;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.xpack.monitoring.Monitoring;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase.Scope; import org.elasticsearch.test.ESIntegTestCase.Scope;
@ -162,7 +162,7 @@ public class SecuritySettingsSource extends ClusterDiscoveryConfiguration.Unicas
@Override @Override
public Collection<Class<? extends Plugin>> nodePlugins() { public Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(xpackPluginClass(), MockNetty3Plugin.class, MockNetty4Plugin.class); return Arrays.asList(xpackPluginClass(), Netty3Plugin.class, Netty4Plugin.class);
} }
@Override @Override

View File

@ -1,17 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.transport.Netty3Plugin;
public final class MockNetty3Plugin extends Netty3Plugin {
// se Netty3Plugin.... this runs without the permission from the netty3 module so it will fail since reindex can't set the property
// to make it still work we disable that check for pseudo integ tests
public MockNetty3Plugin(Settings settings) {
super(Settings.builder().put(settings).put("netty.assert.buglevel", false).build());
}
}

View File

@ -1,20 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.transport.Netty4Plugin;
public final class MockNetty4Plugin extends Netty4Plugin {
// see Netty4Plugin.... this runs without the permission from the netty4 module so it will fail since reindex can't set the property
// to make it still work we disable that check for pseudo integ tests
public MockNetty4Plugin(Settings settings) {
super(Settings.builder().put(settings).put("netty.assert.buglevel", false).build());
}
}

View File

@ -11,8 +11,8 @@ import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.client.ResponseException; import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.xpack.monitoring.Monitoring;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;
@ -52,7 +52,7 @@ public class WatcherPluginDisableTests extends ESIntegTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(XPackPlugin.class, MockNetty3Plugin.class, MockNetty4Plugin.class); return Arrays.asList(XPackPlugin.class, Netty3Plugin.class, Netty4Plugin.class);
} }
@Override @Override

View File

@ -10,8 +10,8 @@ import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.watcher.input.http.HttpInput; import org.elasticsearch.xpack.watcher.input.http.HttpInput;
import org.elasticsearch.xpack.common.http.HttpRequestTemplate; import org.elasticsearch.xpack.common.http.HttpRequestTemplate;
import org.elasticsearch.xpack.common.http.auth.basic.BasicAuth; import org.elasticsearch.xpack.common.http.auth.basic.BasicAuth;
@ -48,8 +48,8 @@ public class ChainIntegrationTests extends AbstractWatcherIntegrationTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -12,8 +12,8 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.client.WatcherClient;
import org.elasticsearch.xpack.watcher.condition.compare.CompareCondition; import org.elasticsearch.xpack.watcher.condition.compare.CompareCondition;
import org.elasticsearch.xpack.watcher.history.HistoryStore; import org.elasticsearch.xpack.watcher.history.HistoryStore;
@ -55,8 +55,8 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }

View File

@ -15,8 +15,8 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.MockNetty3Plugin; import org.elasticsearch.transport.Netty3Plugin;
import org.elasticsearch.xpack.MockNetty4Plugin; import org.elasticsearch.transport.Netty4Plugin;
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.elasticsearch.xpack.security.authc.support.SecuredString;
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
@ -55,8 +55,8 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins()); ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
plugins.add(MockNetty3Plugin.class); // for http plugins.add(Netty3Plugin.class); // for http
plugins.add(MockNetty4Plugin.class); // for http plugins.add(Netty4Plugin.class); // for http
return plugins; return plugins;
} }