Cleanup unnecessary modules and use current version across the board (elastic/elasticsearch#2556)
Followup for elastic/elasticsearchelastic/elasticsearch#18969 Original commit: elastic/x-pack-elasticsearch@c86a5969c7
This commit is contained in:
parent
24e9baeefb
commit
0fcbf8c6ca
|
@ -7,7 +7,6 @@ package org.elasticsearch.marvel;
|
||||||
|
|
||||||
import org.apache.lucene.util.IOUtils;
|
import org.apache.lucene.util.IOUtils;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.CollectionUtils;
|
import org.elasticsearch.common.util.CollectionUtils;
|
||||||
import org.elasticsearch.node.MockNode;
|
import org.elasticsearch.node.MockNode;
|
||||||
|
@ -39,7 +38,7 @@ public class MonitoringF {
|
||||||
}
|
}
|
||||||
|
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
final Node node = new MockNode(settings.build(), Version.CURRENT,
|
final Node node = new MockNode(settings.build(),
|
||||||
Arrays.asList(XPackPlugin.class, XPackPlugin.class, XPackPlugin.class));
|
Arrays.asList(XPackPlugin.class, XPackPlugin.class, XPackPlugin.class));
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class SecurityModule extends AbstractShieldModule {
|
||||||
bind(ShieldLifecycleService.class).asEagerSingleton();
|
bind(ShieldLifecycleService.class).asEagerSingleton();
|
||||||
bind(InternalClient.Secure.class).asEagerSingleton();
|
bind(InternalClient.Secure.class).asEagerSingleton();
|
||||||
bind(InternalClient.class).to(InternalClient.Secure.class);
|
bind(InternalClient.class).to(InternalClient.Secure.class);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
bind(SecurityContext.class).toInstance(SecurityContext.Insecure.INSTANCE);
|
bind(SecurityContext.class).toInstance(SecurityContext.Insecure.INSTANCE);
|
||||||
bind(InternalClient.Insecure.class).asEagerSingleton();
|
bind(InternalClient.Insecure.class).asEagerSingleton();
|
||||||
|
|
|
@ -84,10 +84,10 @@ public class ShieldNettyTransport extends NettyTransport {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ShieldNettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays,
|
public ShieldNettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays,
|
||||||
Version version, @Nullable IPFilter authenticator, @Nullable ServerSSLService serverSSLService,
|
@Nullable IPFilter authenticator, @Nullable ServerSSLService serverSSLService,
|
||||||
ClientSSLService clientSSLService, NamedWriteableRegistry namedWriteableRegistry,
|
ClientSSLService clientSSLService, NamedWriteableRegistry namedWriteableRegistry,
|
||||||
CircuitBreakerService circuitBreakerService) {
|
CircuitBreakerService circuitBreakerService) {
|
||||||
super(settings, threadPool, networkService, bigArrays, version, namedWriteableRegistry, circuitBreakerService);
|
super(settings, threadPool, networkService, bigArrays, namedWriteableRegistry, circuitBreakerService);
|
||||||
this.authenticator = authenticator;
|
this.authenticator = authenticator;
|
||||||
this.ssl = SSL_SETTING.get(settings);
|
this.ssl = SSL_SETTING.get(settings);
|
||||||
this.serverSslService = serverSSLService;
|
this.serverSslService = serverSSLService;
|
||||||
|
|
|
@ -7,7 +7,6 @@ package org.elasticsearch.shield;
|
||||||
|
|
||||||
import org.apache.lucene.util.IOUtils;
|
import org.apache.lucene.util.IOUtils;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.node.MockNode;
|
import org.elasticsearch.node.MockNode;
|
||||||
|
@ -63,7 +62,7 @@ public class ShieldF {
|
||||||
writeFile(folder, "roles.yml", ShieldSettingsSource.CONFIG_ROLE_ALLOW_ALL));
|
writeFile(folder, "roles.yml", ShieldSettingsSource.CONFIG_ROLE_ALLOW_ALL));
|
||||||
|
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
final Node node = new MockNode(settings.build(), Version.CURRENT, Arrays.asList(XPackPlugin.class));
|
final Node node = new MockNode(settings.build(), Arrays.asList(XPackPlugin.class));
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -70,8 +70,7 @@ public class AuditTrailModuleTests extends ESTestCase {
|
||||||
b.bind(CircuitBreakerService.class).toInstance(Node.createCircuitBreakerService(settingsModule.getSettings(),
|
b.bind(CircuitBreakerService.class).toInstance(Node.createCircuitBreakerService(settingsModule.getSettings(),
|
||||||
settingsModule.getClusterSettings()));
|
settingsModule.getClusterSettings()));
|
||||||
b.bind(ThreadPool.class).toInstance(pool);
|
b.bind(ThreadPool.class).toInstance(pool);
|
||||||
},
|
}
|
||||||
new Version.Module(Version.CURRENT)
|
|
||||||
);
|
);
|
||||||
AuditTrail auditTrail = injector.getInstance(AuditTrail.class);
|
AuditTrail auditTrail = injector.getInstance(AuditTrail.class);
|
||||||
assertThat(auditTrail, instanceOf(AuditTrailService.class));
|
assertThat(auditTrail, instanceOf(AuditTrailService.class));
|
||||||
|
|
|
@ -14,7 +14,6 @@ import com.unboundid.ldap.sdk.LDAPConnectionPoolHealthCheck;
|
||||||
import com.unboundid.ldap.sdk.SimpleBindRequest;
|
import com.unboundid.ldap.sdk.SimpleBindRequest;
|
||||||
import com.unboundid.ldap.sdk.SingleServerSet;
|
import com.unboundid.ldap.sdk.SingleServerSet;
|
||||||
import org.elasticsearch.ElasticsearchSecurityException;
|
import org.elasticsearch.ElasticsearchSecurityException;
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
@ -539,7 +538,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTestCase {
|
||||||
// having a quick start/stop cycle like below
|
// having a quick start/stop cycle like below
|
||||||
builder.put(XPackPlugin.featureEnabledSetting(Watcher.NAME), false);
|
builder.put(XPackPlugin.featureEnabledSetting(Watcher.NAME), false);
|
||||||
|
|
||||||
try (Node node = new MockNode(builder.build(), Version.CURRENT, Collections.singletonList(XPackPlugin.class))) {
|
try (Node node = new MockNode(builder.build(), Collections.singletonList(XPackPlugin.class))) {
|
||||||
node.start();
|
node.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.transport;
|
package org.elasticsearch.shield.transport;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.common.network.NetworkAddress;
|
import org.elasticsearch.common.network.NetworkAddress;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -105,7 +104,7 @@ public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase {
|
||||||
.put(NetworkModule.HTTP_ENABLED.getKey(), false)
|
.put(NetworkModule.HTTP_ENABLED.getKey(), false)
|
||||||
.put(InternalCryptoService.FILE_SETTING.getKey(), systemKeyFile)
|
.put(InternalCryptoService.FILE_SETTING.getKey(), systemKeyFile)
|
||||||
.build();
|
.build();
|
||||||
try (Node node = new MockNode(nodeSettings, Version.CURRENT, Collections.singletonList(XPackPlugin.class))) {
|
try (Node node = new MockNode(nodeSettings, Collections.singletonList(XPackPlugin.class))) {
|
||||||
node.start();
|
node.start();
|
||||||
assertGreenClusterState(node.client());
|
assertGreenClusterState(node.client());
|
||||||
}
|
}
|
||||||
|
@ -138,7 +137,7 @@ public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase {
|
||||||
.put("path.home", createTempDir())
|
.put("path.home", createTempDir())
|
||||||
.put(Node.NODE_MASTER_SETTING.getKey(), false)
|
.put(Node.NODE_MASTER_SETTING.getKey(), false)
|
||||||
.build();
|
.build();
|
||||||
try (Node node = new MockNode(nodeSettings, Version.CURRENT, Collections.singletonList(XPackPlugin.class))) {
|
try (Node node = new MockNode(nodeSettings, Collections.singletonList(XPackPlugin.class))) {
|
||||||
node.start();
|
node.start();
|
||||||
|
|
||||||
// assert that node is not connected by waiting for the timeout
|
// assert that node is not connected by waiting for the timeout
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
public void testThatSSLCanBeDisabledByProfile() throws Exception {
|
public void testThatSSLCanBeDisabledByProfile() throws Exception {
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
||||||
|
@ -63,7 +63,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
public void testThatSSLCanBeEnabledByProfile() throws Exception {
|
public void testThatSSLCanBeEnabledByProfile() throws Exception {
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), false).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), false).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
||||||
|
@ -74,7 +74,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
public void testThatProfileTakesDefaultSSLSetting() throws Exception {
|
public void testThatProfileTakesDefaultSSLSetting() throws Exception {
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
||||||
|
@ -84,7 +84,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
public void testDefaultClientAuth() throws Exception {
|
public void testDefaultClientAuth() throws Exception {
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
||||||
|
@ -98,7 +98,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
||||||
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
||||||
|
@ -112,7 +112,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
||||||
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
||||||
|
@ -126,7 +126,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
.put(ShieldNettyTransport.SSL_SETTING.getKey(), true)
|
||||||
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
.put(ShieldNettyTransport.CLIENT_AUTH_SETTING.getKey(), value).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", Settings.EMPTY);
|
||||||
|
@ -138,7 +138,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
String value = randomFrom(SSLClientAuth.REQUIRED.name(), SSLClientAuth.REQUIRED.name().toLowerCase(Locale.ROOT), "true", "TRUE");
|
String value = randomFrom(SSLClientAuth.REQUIRED.name(), SSLClientAuth.REQUIRED.name().toLowerCase(Locale.ROOT), "true", "TRUE");
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
||||||
|
@ -151,7 +151,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
String value = randomFrom(SSLClientAuth.NO.name(), "false", "FALSE", SSLClientAuth.NO.name().toLowerCase(Locale.ROOT));
|
String value = randomFrom(SSLClientAuth.NO.name(), "false", "FALSE", SSLClientAuth.NO.name().toLowerCase(Locale.ROOT));
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class),
|
||||||
mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
mock(BigArrays.class), null, serverSSLService, clientSSLService, mock(NamedWriteableRegistry.class),
|
||||||
mock(CircuitBreakerService.class));
|
mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
||||||
|
@ -164,7 +164,7 @@ public class ShieldNettyTransportTests extends ESTestCase {
|
||||||
String value = randomFrom(SSLClientAuth.OPTIONAL.name(), SSLClientAuth.OPTIONAL.name().toLowerCase(Locale.ROOT));
|
String value = randomFrom(SSLClientAuth.OPTIONAL.name(), SSLClientAuth.OPTIONAL.name().toLowerCase(Locale.ROOT));
|
||||||
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
Settings settings = Settings.builder().put(ShieldNettyTransport.SSL_SETTING.getKey(), true).build();
|
||||||
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class),
|
ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class),
|
||||||
mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, serverSSLService, clientSSLService,
|
mock(NetworkService.class), mock(BigArrays.class), null, serverSSLService, clientSSLService,
|
||||||
mock(NamedWriteableRegistry.class), mock(CircuitBreakerService.class));
|
mock(NamedWriteableRegistry.class), mock(CircuitBreakerService.class));
|
||||||
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
NettyMockUtil.setOpenChannelsHandlerToMock(transport);
|
||||||
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client",
|
||||||
|
|
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.watcher;
|
||||||
|
|
||||||
import org.apache.lucene.util.IOUtils;
|
import org.apache.lucene.util.IOUtils;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.node.MockNode;
|
import org.elasticsearch.node.MockNode;
|
||||||
|
@ -58,7 +57,7 @@ public class WatcherF {
|
||||||
"fc082467005d4072a914e0bb041882d0");
|
"fc082467005d4072a914e0bb041882d0");
|
||||||
|
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
final Node node = new MockNode(settings.build(), Version.CURRENT, Arrays.asList(XPackPlugin.class, XPackPlugin.class));
|
final Node node = new MockNode(settings.build(), Arrays.asList(XPackPlugin.class, XPackPlugin.class));
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.test.bench;
|
package org.elasticsearch.xpack.watcher.test.bench;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.action.search.SearchRequest;
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
|
@ -59,7 +58,7 @@ public class WatcherExecutorServiceBenchmark {
|
||||||
private static ScheduleTriggerEngineMock scheduler;
|
private static ScheduleTriggerEngineMock scheduler;
|
||||||
|
|
||||||
protected static void start() throws Exception {
|
protected static void start() throws Exception {
|
||||||
Node node = new MockNode(Settings.builder().put(SETTINGS).put("node.data", false).build(), Version.CURRENT,
|
Node node = new MockNode(Settings.builder().put(SETTINGS).put("node.data", false).build(),
|
||||||
Arrays.asList(XPackBenchmarkPlugin.class));
|
Arrays.asList(XPackBenchmarkPlugin.class));
|
||||||
client = node.client();
|
client = node.client();
|
||||||
client.admin().cluster().prepareHealth("*").setWaitForGreenStatus().get();
|
client.admin().cluster().prepareHealth("*").setWaitForGreenStatus().get();
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.test.bench;
|
package org.elasticsearch.xpack.watcher.test.bench;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||||
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
|
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
|
||||||
|
@ -138,7 +137,7 @@ public class WatcherScheduleEngineBenchmark {
|
||||||
.put("xpack.watcher.trigger.schedule.engine", engine)
|
.put("xpack.watcher.trigger.schedule.engine", engine)
|
||||||
.put("node.data", false)
|
.put("node.data", false)
|
||||||
.build();
|
.build();
|
||||||
try (Node node = new MockNode(settings, Version.CURRENT, Arrays.asList(XPackPlugin.class, XPackPlugin.class))) {
|
try (Node node = new MockNode(settings, Arrays.asList(XPackPlugin.class, XPackPlugin.class))) {
|
||||||
try (final Client client = node.client()) {
|
try (final Client client = node.client()) {
|
||||||
client.admin().cluster().prepareHealth().setWaitForNodes("2").get();
|
client.admin().cluster().prepareHealth().setWaitForNodes("2").get();
|
||||||
client.admin().indices().prepareDelete(HistoryStore.INDEX_PREFIX + "*").get();
|
client.admin().indices().prepareDelete(HistoryStore.INDEX_PREFIX + "*").get();
|
||||||
|
|
Loading…
Reference in New Issue