From 47988e644596a168b8e826129f5debb07fe705fc Mon Sep 17 00:00:00 2001 From: Himanshu Setia <58999915+setiah@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:47:07 -0700 Subject: [PATCH] Reverts the rename for test/fixtures/old-elasticsearch done in #370 (#402) Signed-off-by: Himanshu Setia --- .../build.gradle | 3 +-- .../main/java/oldes/OldElasticsearch.java} | 20 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) rename test/fixtures/{old-opensearch => old-elasticsearch}/build.gradle (91%) rename test/fixtures/{old-opensearch/src/main/java/oldes/OldOpenSearch.java => old-elasticsearch/src/main/java/oldes/OldElasticsearch.java} (82%) diff --git a/test/fixtures/old-opensearch/build.gradle b/test/fixtures/old-elasticsearch/build.gradle similarity index 91% rename from test/fixtures/old-opensearch/build.gradle rename to test/fixtures/old-elasticsearch/build.gradle index 79b858bedadb4..ca0000666ccf0 100644 --- a/test/fixtures/old-opensearch/build.gradle +++ b/test/fixtures/old-elasticsearch/build.gradle @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,6 @@ * under the License. */ -//TODO(OpenSearch): Remove later if not needed. description = """\ Launches versions of Elasticsearch prior to 5.0 for testing. These need special handling because they do not support writing diff --git a/test/fixtures/old-opensearch/src/main/java/oldes/OldOpenSearch.java b/test/fixtures/old-elasticsearch/src/main/java/oldes/OldElasticsearch.java similarity index 82% rename from test/fixtures/old-opensearch/src/main/java/oldes/OldOpenSearch.java rename to test/fixtures/old-elasticsearch/src/main/java/oldes/OldElasticsearch.java index bfae46e5c0bfd..9ec916727d03b 100644 --- a/test/fixtures/old-opensearch/src/main/java/oldes/OldOpenSearch.java +++ b/test/fixtures/old-elasticsearch/src/main/java/oldes/OldElasticsearch.java @@ -37,13 +37,13 @@ import java.util.regex.Pattern; /** - * Starts a version of OpenSearch that has been unzipped into an empty directory, + * Starts a version of Elasticsearch that has been unzipped into an empty directory, * instructing it to ask the OS for an unused port, grepping the logs for the port * it actually got, and writing a {@code ports} file with the port. This is only - * required for versions of OpenSearch before 5.0 because they do not support + * required for versions of Elasticsearch before 5.0 because they do not support * writing a "ports" file. */ -public class OldOpenSearch { +public class OldElasticsearch { public static void main(String[] args) throws IOException { Path baseDir = Paths.get(args[0]); Path unzipDir = Paths.get(args[1]); @@ -65,22 +65,22 @@ public static void main(String[] args) throws IOException { Iterator children = Files.list(unzipDir).iterator(); if (false == children.hasNext()) { - System.err.println("expected the opensearch directory to contain a single child directory but contained none."); + System.err.println("expected the es directory to contain a single child directory but contained none."); System.exit(1); } - Path opensearchDir= children.next(); + Path esDir= children.next(); if (children.hasNext()) { - System.err.println("expected the opensearch directory to contains a single child directory but contained [" + opensearchDir+ "] and [" + System.err.println("expected the es directory to contains a single child directory but contained [" + esDir+ "] and [" + children.next() + "]."); System.exit(1); } - if (false == Files.isDirectory(opensearchDir)) { - System.err.println("expected the opensearch directory to contains a single child directory but contained a single child file."); + if (false == Files.isDirectory(esDir)) { + System.err.println("expected the es directory to contains a single child directory but contained a single child file."); System.exit(1); } - Path bin = opensearchDir.resolve("bin").resolve("opensearch" + (Constants.WINDOWS ? ".bat" : "")); - Path config = opensearchDir.resolve("config").resolve("opensearch.yml"); + Path bin = esDir.resolve("bin").resolve("elasticsearch" + (Constants.WINDOWS ? ".bat" : "")); + Path config = esDir.resolve("config").resolve("elasticsearch.yml"); Files.write(config, Arrays.asList("http.port: 0", "transport.tcp.port: 0", "network.host: 127.0.0.1"), StandardCharsets.UTF_8);