nuke more cwd usage
This commit is contained in:
parent
c0587cb244
commit
9dec558ea1
|
@ -103,14 +103,6 @@ public class TransportClient extends AbstractClient {
|
||||||
private final TransportClientNodesService nodesService;
|
private final TransportClientNodesService nodesService;
|
||||||
private final InternalTransportClient internalClient;
|
private final InternalTransportClient internalClient;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new transport client with settings loaded either from the classpath or the file system (the
|
|
||||||
* <tt>elasticsearch.(yml|json)</tt> files optionally prefixed with <tt>config/</tt>).
|
|
||||||
*/
|
|
||||||
public TransportClient() {
|
|
||||||
this(ImmutableSettings.Builder.EMPTY_SETTINGS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new transport client with explicit settings and settings loaded either from the classpath or the file
|
* Constructs a new transport client with explicit settings and settings loaded either from the classpath or the file
|
||||||
* system (the <tt>elasticsearch.(yml|json)</tt> files optionally prefixed with <tt>config/</tt>).
|
* system (the <tt>elasticsearch.(yml|json)</tt> files optionally prefixed with <tt>config/</tt>).
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
@ -157,7 +158,10 @@ public class BulkProcessorTests extends ElasticsearchIntegrationTest {
|
||||||
//https://github.com/elasticsearch/elasticsearch/issues/5038
|
//https://github.com/elasticsearch/elasticsearch/issues/5038
|
||||||
public void testBulkProcessorConcurrentRequestsNoNodeAvailableException() throws Exception {
|
public void testBulkProcessorConcurrentRequestsNoNodeAvailableException() throws Exception {
|
||||||
//we create a transport client with no nodes to make sure it throws NoNodeAvailableException
|
//we create a transport client with no nodes to make sure it throws NoNodeAvailableException
|
||||||
Client transportClient = new TransportClient();
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
Client transportClient = new TransportClient(settings);
|
||||||
|
|
||||||
int bulkActions = randomIntBetween(10, 100);
|
int bulkActions = randomIntBetween(10, 100);
|
||||||
int numDocs = randomIntBetween(bulkActions, bulkActions + 100);
|
int numDocs = randomIntBetween(bulkActions, bulkActions + 100);
|
||||||
|
|
|
@ -23,6 +23,8 @@ import org.elasticsearch.action.support.QuerySourceBuilder;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||||
|
@ -46,7 +48,10 @@ public class CountRequestBuilderTests extends ElasticsearchTestCase {
|
||||||
public static void initClient() {
|
public static void initClient() {
|
||||||
//this client will not be hit by any request, but it needs to be a non null proper client
|
//this client will not be hit by any request, but it needs to be a non null proper client
|
||||||
//that is why we create it but we don't add any transport address to it
|
//that is why we create it but we don't add any transport address to it
|
||||||
client = new TransportClient();
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
client = new TransportClient(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
|
|
@ -21,6 +21,8 @@ package org.elasticsearch.action.search;
|
||||||
|
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||||
|
@ -45,7 +47,10 @@ public class SearchRequestBuilderTests extends ElasticsearchTestCase {
|
||||||
public static void initClient() {
|
public static void initClient() {
|
||||||
//this client will not be hit by any request, but it needs to be a non null proper client
|
//this client will not be hit by any request, but it needs to be a non null proper client
|
||||||
//that is why we create it but we don't add any transport address to it
|
//that is why we create it but we don't add any transport address to it
|
||||||
client = new TransportClient();
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
client = new TransportClient(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
|
|
@ -88,7 +88,11 @@ public abstract class AbstractClientHeadersTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void initClient() {
|
public void initClient() {
|
||||||
client = buildClient(HEADER_SETTINGS, ACTIONS);
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put(HEADER_SETTINGS)
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
client = buildClient(settings, ACTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class TransportClientHeadersTests extends AbstractClientHeadersTests {
|
||||||
.put("client.transport.sniff", false)
|
.put("client.transport.sniff", false)
|
||||||
.put("node.name", "transport_client_" + this.getTestName())
|
.put("node.name", "transport_client_" + this.getTestName())
|
||||||
.put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, InternalTransportService.class.getName())
|
.put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, InternalTransportService.class.getName())
|
||||||
.put(HEADER_SETTINGS)
|
.put(headersSettings)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
client.addTransportAddress(address);
|
client.addTransportAddress(address);
|
||||||
|
@ -75,6 +75,7 @@ public class TransportClientHeadersTests extends AbstractClientHeadersTests {
|
||||||
.put("client.transport.nodes_sampler_interval", "1s")
|
.put("client.transport.nodes_sampler_interval", "1s")
|
||||||
.put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, InternalTransportService.class.getName())
|
.put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, InternalTransportService.class.getName())
|
||||||
.put(HEADER_SETTINGS)
|
.put(HEADER_SETTINGS)
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build());
|
.build());
|
||||||
try {
|
try {
|
||||||
client.addTransportAddress(address);
|
client.addTransportAddress(address);
|
||||||
|
|
|
@ -54,73 +54,73 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsErrorMessageOnFail() throws Exception {
|
public void testThatCommandLogsErrorMessageOnFail() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(captureOutputTerminal, Mode.CHANGE));
|
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.CHANGE));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(containsString("Please ensure that the user account running Elasticsearch has read access to this file")));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(containsString("Please ensure that the user account running Elasticsearch has read access to this file")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingWhenPermissionRemains() throws Exception {
|
public void testThatCommandLogsNothingWhenPermissionRemains() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(captureOutputTerminal, Mode.KEEP));
|
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.KEEP));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingWhenDisabled() throws Exception {
|
public void testThatCommandLogsNothingWhenDisabled() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfiguration, new PermissionCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfFilesystemDoesNotSupportPermissions() throws Exception {
|
public void testThatCommandLogsNothingIfFilesystemDoesNotSupportPermissions() throws Exception {
|
||||||
executeCommand(jimFsConfigurationWithoutPermissions, new PermissionCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfigurationWithoutPermissions, new PermissionCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsOwnerChange() throws Exception {
|
public void testThatCommandLogsOwnerChange() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(captureOutputTerminal, Mode.CHANGE));
|
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.CHANGE));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(allOf(containsString("Owner of file ["), containsString("] used to be ["), containsString("], but now is ["))));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(allOf(containsString("Owner of file ["), containsString("] used to be ["), containsString("], but now is ["))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfOwnerRemainsSame() throws Exception {
|
public void testThatCommandLogsNothingIfOwnerRemainsSame() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(captureOutputTerminal, Mode.KEEP));
|
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.KEEP));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfOwnerIsDisabled() throws Exception {
|
public void testThatCommandLogsNothingIfOwnerIsDisabled() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfiguration, new OwnerCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfFileSystemDoesNotSupportOwners() throws Exception {
|
public void testThatCommandLogsNothingIfFileSystemDoesNotSupportOwners() throws Exception {
|
||||||
executeCommand(jimFsConfigurationWithoutPermissions, new OwnerCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfigurationWithoutPermissions, new OwnerCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsIfGroupChanges() throws Exception {
|
public void testThatCommandLogsIfGroupChanges() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(captureOutputTerminal, Mode.CHANGE));
|
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.CHANGE));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(allOf(containsString("Group of file ["), containsString("] used to be ["), containsString("], but now is ["))));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasItem(allOf(containsString("Group of file ["), containsString("] used to be ["), containsString("], but now is ["))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfGroupRemainsSame() throws Exception {
|
public void testThatCommandLogsNothingIfGroupRemainsSame() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(captureOutputTerminal, Mode.KEEP));
|
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.KEEP));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfGroupIsDisabled() throws Exception {
|
public void testThatCommandLogsNothingIfGroupIsDisabled() throws Exception {
|
||||||
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfiguration, new GroupCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatCommandLogsNothingIfFileSystemDoesNotSupportGroups() throws Exception {
|
public void testThatCommandLogsNothingIfFileSystemDoesNotSupportGroups() throws Exception {
|
||||||
executeCommand(jimFsConfigurationWithoutPermissions, new GroupCheckFileCommand(captureOutputTerminal, Mode.DISABLED));
|
executeCommand(jimFsConfigurationWithoutPermissions, new GroupCheckFileCommand(createTempDir(), captureOutputTerminal, Mode.DISABLED));
|
||||||
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
assertThat(captureOutputTerminal.getTerminalOutput(), hasSize(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,10 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
try (FileSystem fs = Jimfs.newFileSystem(configuration)) {
|
try (FileSystem fs = Jimfs.newFileSystem(configuration)) {
|
||||||
Path path = fs.getPath(randomAsciiOfLength(10));
|
Path path = fs.getPath(randomAsciiOfLength(10));
|
||||||
new CreateFileCommand(captureOutputTerminal, path).execute(ImmutableSettings.EMPTY, new Environment(ImmutableSettings.EMPTY));
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
new CreateFileCommand(captureOutputTerminal, path).execute(settings, new Environment(settings));
|
||||||
assertThat(Files.exists(path), is(true));
|
assertThat(Files.exists(path), is(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +148,10 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
Path path = fs.getPath(randomAsciiOfLength(10));
|
Path path = fs.getPath(randomAsciiOfLength(10));
|
||||||
Files.write(path, "anything".getBytes(Charsets.UTF_8));
|
Files.write(path, "anything".getBytes(Charsets.UTF_8));
|
||||||
|
|
||||||
new DeleteFileCommand(captureOutputTerminal, path).execute(ImmutableSettings.EMPTY, new Environment(ImmutableSettings.EMPTY));
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
new DeleteFileCommand(captureOutputTerminal, path).execute(settings, new Environment(settings));
|
||||||
assertThat(Files.exists(path), is(false));
|
assertThat(Files.exists(path), is(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,16 +169,21 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
protected final Mode mode;
|
protected final Mode mode;
|
||||||
protected FileSystem fs;
|
protected FileSystem fs;
|
||||||
protected Path[] paths;
|
protected Path[] paths;
|
||||||
|
final Path baseDir;
|
||||||
|
|
||||||
public AbstractTestCheckFileCommand(Terminal terminal, Mode mode) throws IOException {
|
public AbstractTestCheckFileCommand(Path baseDir, Terminal terminal, Mode mode) throws IOException {
|
||||||
super(terminal);
|
super(terminal);
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
this.baseDir = baseDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CliTool.ExitStatus execute(FileSystem fs) throws Exception {
|
public CliTool.ExitStatus execute(FileSystem fs) throws Exception {
|
||||||
this.fs = fs;
|
this.fs = fs;
|
||||||
this.paths = new Path[] { writePath(fs, "p1", "anything"), writePath(fs, "p2", "anything"), writePath(fs, "p3", "anything") };
|
this.paths = new Path[] { writePath(fs, "p1", "anything"), writePath(fs, "p2", "anything"), writePath(fs, "p3", "anything") };
|
||||||
return super.execute(ImmutableSettings.EMPTY, new Environment(ImmutableSettings.EMPTY));
|
Settings settings = ImmutableSettings.settingsBuilder()
|
||||||
|
.put("path.home", baseDir.toString())
|
||||||
|
.build();
|
||||||
|
return super.execute(ImmutableSettings.EMPTY, new Environment(settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Path writePath(FileSystem fs, String name, String content) throws IOException {
|
private Path writePath(FileSystem fs, String name, String content) throws IOException {
|
||||||
|
@ -192,8 +203,8 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
*/
|
*/
|
||||||
class PermissionCheckFileCommand extends AbstractTestCheckFileCommand {
|
class PermissionCheckFileCommand extends AbstractTestCheckFileCommand {
|
||||||
|
|
||||||
public PermissionCheckFileCommand(Terminal terminal, Mode mode) throws IOException {
|
public PermissionCheckFileCommand(Path baseDir, Terminal terminal, Mode mode) throws IOException {
|
||||||
super(terminal, mode);
|
super(baseDir, terminal, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -221,8 +232,8 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
*/
|
*/
|
||||||
class OwnerCheckFileCommand extends AbstractTestCheckFileCommand {
|
class OwnerCheckFileCommand extends AbstractTestCheckFileCommand {
|
||||||
|
|
||||||
public OwnerCheckFileCommand(Terminal terminal, Mode mode) throws IOException {
|
public OwnerCheckFileCommand(Path baseDir, Terminal terminal, Mode mode) throws IOException {
|
||||||
super(terminal, mode);
|
super(baseDir, terminal, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -251,8 +262,8 @@ public class CheckFileCommandTests extends ElasticsearchTestCase {
|
||||||
*/
|
*/
|
||||||
class GroupCheckFileCommand extends AbstractTestCheckFileCommand {
|
class GroupCheckFileCommand extends AbstractTestCheckFileCommand {
|
||||||
|
|
||||||
public GroupCheckFileCommand(Terminal terminal, Mode mode) throws IOException {
|
public GroupCheckFileCommand(Path baseDir, Terminal terminal, Mode mode) throws IOException {
|
||||||
super(terminal, mode);
|
super(baseDir, terminal, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class Log4jESLoggerTests extends ElasticsearchTestCase {
|
||||||
// Need to set custom path.conf so we can use a custom logging.yml file for the test
|
// Need to set custom path.conf so we can use a custom logging.yml file for the test
|
||||||
Settings settings = ImmutableSettings.builder()
|
Settings settings = ImmutableSettings.builder()
|
||||||
.put("path.conf", configDir.toAbsolutePath())
|
.put("path.conf", configDir.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build();
|
.build();
|
||||||
LogConfigurator.configure(settings);
|
LogConfigurator.configure(settings);
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
Path configDir = getDataPath("config");
|
Path configDir = getDataPath("config");
|
||||||
Settings settings = ImmutableSettings.builder()
|
Settings settings = ImmutableSettings.builder()
|
||||||
.put("path.conf", configDir.toAbsolutePath())
|
.put("path.conf", configDir.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build();
|
.build();
|
||||||
LogConfigurator.configure(settings);
|
LogConfigurator.configure(settings);
|
||||||
|
|
||||||
|
@ -87,7 +88,10 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
Path loggingConf = tmpDir.resolve(loggingConfiguration("json"));
|
Path loggingConf = tmpDir.resolve(loggingConfiguration("json"));
|
||||||
Files.write(loggingConf, "{\"json\": \"foo\"}".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf, "{\"json\": \"foo\"}".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
ImmutableSettings.builder().put("path.conf", tmpDir.toAbsolutePath()).build());
|
ImmutableSettings.builder()
|
||||||
|
.put("path.conf", tmpDir.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build());
|
||||||
|
|
||||||
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
||||||
LogConfigurator.resolveConfig(environment, builder);
|
LogConfigurator.resolveConfig(environment, builder);
|
||||||
|
@ -102,7 +106,10 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
Path loggingConf = tmpDir.resolve(loggingConfiguration("properties"));
|
Path loggingConf = tmpDir.resolve(loggingConfiguration("properties"));
|
||||||
Files.write(loggingConf, "key: value".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf, "key: value".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
ImmutableSettings.builder().put("path.conf", tmpDir.toAbsolutePath()).build());
|
ImmutableSettings.builder()
|
||||||
|
.put("path.conf", tmpDir.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build());
|
||||||
|
|
||||||
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
||||||
LogConfigurator.resolveConfig(environment, builder);
|
LogConfigurator.resolveConfig(environment, builder);
|
||||||
|
@ -119,7 +126,10 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
Files.write(loggingConf1, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf1, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
||||||
Files.write(loggingConf2, "yaml: bar".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf2, "yaml: bar".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
ImmutableSettings.builder().put("path.conf", tmpDir.toAbsolutePath()).build());
|
ImmutableSettings.builder()
|
||||||
|
.put("path.conf", tmpDir.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build());
|
||||||
|
|
||||||
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
||||||
LogConfigurator.resolveConfig(environment, builder);
|
LogConfigurator.resolveConfig(environment, builder);
|
||||||
|
@ -135,7 +145,10 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
Path invalidSuffix = tmpDir.resolve(loggingConfiguration(randomFrom(LogConfigurator.ALLOWED_SUFFIXES)) + randomInvalidSuffix());
|
Path invalidSuffix = tmpDir.resolve(loggingConfiguration(randomFrom(LogConfigurator.ALLOWED_SUFFIXES)) + randomInvalidSuffix());
|
||||||
Files.write(invalidSuffix, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
Files.write(invalidSuffix, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
ImmutableSettings.builder().put("path.conf", invalidSuffix.toAbsolutePath()).build());
|
ImmutableSettings.builder()
|
||||||
|
.put("path.conf", invalidSuffix.toAbsolutePath())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build());
|
||||||
|
|
||||||
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
ImmutableSettings.Builder builder = ImmutableSettings.builder();
|
||||||
LogConfigurator.resolveConfig(environment, builder);
|
LogConfigurator.resolveConfig(environment, builder);
|
||||||
|
|
|
@ -77,8 +77,11 @@ public class AnalysisModuleTests extends ElasticsearchTestCase {
|
||||||
return injector.getInstance(AnalysisService.class);
|
return injector.getInstance(AnalysisService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Settings loadFromClasspath(String path) {
|
private Settings loadFromClasspath(String path) {
|
||||||
return settingsBuilder().loadFromClasspath(path).put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
return settingsBuilder().loadFromClasspath(path)
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,8 +106,11 @@ public class AnalysisModuleTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionedAnalyzers() throws Exception {
|
public void testVersionedAnalyzers() throws Exception {
|
||||||
Settings settings2 = settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/test1.yml")
|
Settings settings2 = settingsBuilder()
|
||||||
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_0_90_0).build();
|
.loadFromClasspath("org/elasticsearch/index/analysis/test1.yml")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_0_90_0)
|
||||||
|
.build();
|
||||||
AnalysisService analysisService2 = getAnalysisService(settings2);
|
AnalysisService analysisService2 = getAnalysisService(settings2);
|
||||||
|
|
||||||
// indicesanalysisservice always has the current version
|
// indicesanalysisservice always has the current version
|
||||||
|
@ -202,11 +208,14 @@ public class AnalysisModuleTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWordListPath() throws Exception {
|
public void testWordListPath() throws Exception {
|
||||||
Environment env = new Environment(ImmutableSettings.Builder.EMPTY_SETTINGS);
|
Settings settings = ImmutableSettings.builder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
Environment env = new Environment(settings);
|
||||||
String[] words = new String[]{"donau", "dampf", "schiff", "spargel", "creme", "suppe"};
|
String[] words = new String[]{"donau", "dampf", "schiff", "spargel", "creme", "suppe"};
|
||||||
|
|
||||||
Path wordListFile = generateWordList(words);
|
Path wordListFile = generateWordList(words);
|
||||||
Settings settings = settingsBuilder().loadFromSource("index: \n word_list_path: " + wordListFile.toAbsolutePath()).build();
|
settings = settingsBuilder().loadFromSource("index: \n word_list_path: " + wordListFile.toAbsolutePath()).build();
|
||||||
|
|
||||||
Set<?> wordList = Analysis.getWordSet(env, settings, "index.word_list");
|
Set<?> wordList = Analysis.getWordSet(env, settings, "index.word_list");
|
||||||
MatcherAssert.assertThat(wordList.size(), equalTo(6));
|
MatcherAssert.assertThat(wordList.size(), equalTo(6));
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.inject.Injector;
|
import org.elasticsearch.common.inject.Injector;
|
||||||
import org.elasticsearch.common.inject.ModulesBuilder;
|
import org.elasticsearch.common.inject.ModulesBuilder;
|
||||||
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.settings.SettingsModule;
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
|
@ -49,6 +50,7 @@ public class CharFilterTests extends ElasticsearchTokenStreamTestCase {
|
||||||
.putArray("index.analysis.char_filter.my_mapping.mappings", "ph=>f", "qu=>q")
|
.putArray("index.analysis.char_filter.my_mapping.mappings", "ph=>f", "qu=>q")
|
||||||
.put("index.analysis.analyzer.custom_with_char_filter.tokenizer", "standard")
|
.put("index.analysis.analyzer.custom_with_char_filter.tokenizer", "standard")
|
||||||
.putArray("index.analysis.analyzer.custom_with_char_filter.char_filter", "my_mapping")
|
.putArray("index.analysis.analyzer.custom_with_char_filter.char_filter", "my_mapping")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build();
|
.build();
|
||||||
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
||||||
Injector injector = new ModulesBuilder().add(
|
Injector injector = new ModulesBuilder().add(
|
||||||
|
@ -74,6 +76,7 @@ public class CharFilterTests extends ElasticsearchTokenStreamTestCase {
|
||||||
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
.put("index.analysis.analyzer.custom_with_char_filter.tokenizer", "standard")
|
.put("index.analysis.analyzer.custom_with_char_filter.tokenizer", "standard")
|
||||||
.putArray("index.analysis.analyzer.custom_with_char_filter.char_filter", "html_strip")
|
.putArray("index.analysis.analyzer.custom_with_char_filter.char_filter", "html_strip")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build();
|
.build();
|
||||||
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
||||||
Injector injector = new ModulesBuilder().add(
|
Injector injector = new ModulesBuilder().add(
|
||||||
|
|
|
@ -110,10 +110,18 @@ public class CompoundAnalysisTests extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Settings getJsonSettings() {
|
private Settings getJsonSettings() {
|
||||||
return settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/test1.json").put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
return settingsBuilder()
|
||||||
|
.loadFromClasspath("org/elasticsearch/index/analysis/test1.json")
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Settings getYamlSettings() {
|
private Settings getYamlSettings() {
|
||||||
return settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/test1.yml").put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
return settingsBuilder()
|
||||||
|
.loadFromClasspath("org/elasticsearch/index/analysis/test1.yml")
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,11 @@ public class PatternCaptureTokenFilterTests extends ElasticsearchTokenStreamTest
|
||||||
@Test
|
@Test
|
||||||
public void testPatternCaptureTokenFilter() throws Exception {
|
public void testPatternCaptureTokenFilter() throws Exception {
|
||||||
Index index = new Index("test");
|
Index index = new Index("test");
|
||||||
Settings settings = settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/pattern_capture.json").put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
Settings settings = settingsBuilder()
|
||||||
|
.put("path.home", createTempDir())
|
||||||
|
.loadFromClasspath("org/elasticsearch/index/analysis/pattern_capture.json")
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
.build();
|
||||||
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
||||||
Injector injector = new ModulesBuilder().add(
|
Injector injector = new ModulesBuilder().add(
|
||||||
new IndexSettingsModule(index, settings),
|
new IndexSettingsModule(index, settings),
|
||||||
|
|
|
@ -42,7 +42,11 @@ public class StopAnalyzerTests extends ElasticsearchTokenStreamTestCase {
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultsCompoundAnalysis() throws Exception {
|
public void testDefaultsCompoundAnalysis() throws Exception {
|
||||||
Index index = new Index("test");
|
Index index = new Index("test");
|
||||||
Settings settings = settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/stop.json").put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
Settings settings = settingsBuilder()
|
||||||
|
.loadFromClasspath("org/elasticsearch/index/analysis/stop.json")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
.build();
|
||||||
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
|
||||||
Injector injector = new ModulesBuilder().add(
|
Injector injector = new ModulesBuilder().add(
|
||||||
new IndexSettingsModule(index, settings),
|
new IndexSettingsModule(index, settings),
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class TemplateQueryParserTest extends ElasticsearchTestCase {
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws IOException {
|
public void setup() throws IOException {
|
||||||
Settings settings = ImmutableSettings.settingsBuilder()
|
Settings settings = ImmutableSettings.settingsBuilder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.put("path.conf", this.getDataPath("config"))
|
.put("path.conf", this.getDataPath("config"))
|
||||||
.put("name", getClass().getName())
|
.put("name", getClass().getName())
|
||||||
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
|
|
|
@ -44,11 +44,20 @@ public class InternalSettingsPreparerTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIgnoreSystemProperties() {
|
public void testIgnoreSystemProperties() {
|
||||||
Tuple<Settings, Environment> tuple = InternalSettingsPreparer.prepareSettings(settingsBuilder().put("node.zone", "bar").build(), true);
|
Settings settings = settingsBuilder()
|
||||||
|
.put("node.zone", "bar")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
Tuple<Settings, Environment> tuple = InternalSettingsPreparer.prepareSettings(settings, true);
|
||||||
// Should use setting from the system property
|
// Should use setting from the system property
|
||||||
assertThat(tuple.v1().get("node.zone"), equalTo("foo"));
|
assertThat(tuple.v1().get("node.zone"), equalTo("foo"));
|
||||||
|
|
||||||
tuple = InternalSettingsPreparer.prepareSettings(settingsBuilder().put("config.ignore_system_properties", true).put("node.zone", "bar").build(), true);
|
settings = settingsBuilder()
|
||||||
|
.put("config.ignore_system_properties", true)
|
||||||
|
.put("node.zone", "bar")
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
|
.build();
|
||||||
|
tuple = InternalSettingsPreparer.prepareSettings(settings, true);
|
||||||
// Should use setting from the system property
|
// Should use setting from the system property
|
||||||
assertThat(tuple.v1().get("node.zone"), equalTo("bar"));
|
assertThat(tuple.v1().get("node.zone"), equalTo("bar"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class ScriptServiceTests extends ElasticsearchTestCase {
|
||||||
public void setup() throws IOException {
|
public void setup() throws IOException {
|
||||||
Path genericConfigFolder = createTempDir();
|
Path genericConfigFolder = createTempDir();
|
||||||
baseSettings = settingsBuilder()
|
baseSettings = settingsBuilder()
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.put("path.conf", genericConfigFolder)
|
.put("path.conf", genericConfigFolder)
|
||||||
.build();
|
.build();
|
||||||
resourceWatcherService = new ResourceWatcherService(baseSettings, null);
|
resourceWatcherService = new ResourceWatcherService(baseSettings, null);
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.elasticsearch.stresstest.client;
|
||||||
|
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.node.NodeBuilder;
|
import org.elasticsearch.node.NodeBuilder;
|
||||||
|
@ -38,8 +39,10 @@ public class ClientFailover {
|
||||||
for (int i = 0; i < nodes.length; i++) {
|
for (int i = 0; i < nodes.length; i++) {
|
||||||
nodes[i] = NodeBuilder.nodeBuilder().node();
|
nodes[i] = NodeBuilder.nodeBuilder().node();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: what is this? a public static void main test?!?!
|
||||||
|
|
||||||
final TransportClient client = new TransportClient()
|
final TransportClient client = new TransportClient(ImmutableSettings.EMPTY)
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9301))
|
.addTransportAddress(new InetSocketTransportAddress("localhost", 9301))
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9302));
|
.addTransportAddress(new InetSocketTransportAddress("localhost", 9302));
|
||||||
|
|
|
@ -47,8 +47,9 @@ public class ManyIndicesRemoteStressTest {
|
||||||
|
|
||||||
Client client;
|
Client client;
|
||||||
Node node = null;
|
Node node = null;
|
||||||
|
// TODO: what is this? a public static void main test?!?!?!
|
||||||
if (true) {
|
if (true) {
|
||||||
client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
|
client = new TransportClient(ImmutableSettings.EMPTY).addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
|
||||||
} else {
|
} else {
|
||||||
node = NodeBuilder.nodeBuilder().client(true).node();
|
node = NodeBuilder.nodeBuilder().client(true).node();
|
||||||
client = node.client();
|
client = node.client();
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class NettyTransportMultiPortIntegrationTests extends ElasticsearchIntegr
|
||||||
Settings settings = settingsBuilder()
|
Settings settings = settingsBuilder()
|
||||||
.put("cluster.name", internalCluster().getClusterName())
|
.put("cluster.name", internalCluster().getClusterName())
|
||||||
.put(TransportModule.TRANSPORT_TYPE_KEY, NettyTransport.class.getName())
|
.put(TransportModule.TRANSPORT_TYPE_KEY, NettyTransport.class.getName())
|
||||||
|
.put("path.home", createTempDir().toString())
|
||||||
.build();
|
.build();
|
||||||
try (TransportClient transportClient = new TransportClient(settings, false)) {
|
try (TransportClient transportClient = new TransportClient(settings, false)) {
|
||||||
transportClient.addTransportAddress(new InetSocketTransportAddress("127.0.0.1", randomPort));
|
transportClient.addTransportAddress(new InetSocketTransportAddress("127.0.0.1", randomPort));
|
||||||
|
|
Loading…
Reference in New Issue