diff --git a/server/src/test/java/org/elasticsearch/bootstrap/BootstrapChecksTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/bootstrap/BootstrapChecksTests.java rename to server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java index 2b4d697271c..4d68019a613 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/BootstrapChecksTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.Constants; -import org.elasticsearch.cluster.coordination.ClusterBootstrapService; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.CheckedConsumer; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.BoundTransportAddress; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.discovery.DiscoveryModule; -import org.elasticsearch.discovery.SettingsBasedSeedHostsProvider; -import org.elasticsearch.monitor.jvm.JvmInfo; -import org.elasticsearch.node.NodeValidationException; -import org.elasticsearch.test.AbstractBootstrapCheckTestCase; +import org.opensearch.cluster.coordination.ClusterBootstrapService; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.CheckedConsumer; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.transport.BoundTransportAddress; +import org.opensearch.common.transport.TransportAddress; +import org.opensearch.discovery.DiscoveryModule; +import org.opensearch.discovery.SettingsBasedSeedHostsProvider; +import org.opensearch.monitor.jvm.JvmInfo; +import org.opensearch.node.NodeValidationException; +import org.opensearch.test.AbstractBootstrapCheckTestCase; import org.hamcrest.Matcher; import java.net.InetAddress; @@ -45,8 +45,8 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; -import static org.elasticsearch.discovery.DiscoveryModule.ZEN2_DISCOVERY_TYPE; -import static org.elasticsearch.discovery.DiscoveryModule.ZEN_DISCOVERY_TYPE; +import static org.opensearch.discovery.DiscoveryModule.ZEN2_DISCOVERY_TYPE; +import static org.opensearch.discovery.DiscoveryModule.ZEN_DISCOVERY_TYPE; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; @@ -287,7 +287,7 @@ public class BootstrapChecksTests extends AbstractBootstrapCheckTestCase { Collections.singletonList(check))); assertThat( e.getMessage(), - containsString("memory locking requested for elasticsearch process but memory is not locked")); + containsString("memory locking requested for opensearch process but memory is not locked")); } else { // nothing should happen BootstrapChecks.check(bootstrapContext, true, Collections.singletonList(check)); diff --git a/server/src/test/java/org/elasticsearch/bootstrap/BootstrapSettingsTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapSettingsTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/bootstrap/BootstrapSettingsTests.java rename to server/src/test/java/org/opensearch/bootstrap/BootstrapSettingsTests.java index fb3d3628dd1..cf49efb9e77 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/BootstrapSettingsTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapSettingsTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.OpenSearchTestCase; -public class BootstrapSettingsTests extends ESTestCase { +public class BootstrapSettingsTests extends OpenSearchTestCase { public void testDefaultSettings() { assertTrue(BootstrapSettings.SECURITY_FILTER_BAD_DEFAULTS_SETTING.get(Settings.EMPTY)); diff --git a/server/src/test/java/org/elasticsearch/bootstrap/JNANativesTests.java b/server/src/test/java/org/opensearch/bootstrap/JNANativesTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/bootstrap/JNANativesTests.java rename to server/src/test/java/org/opensearch/bootstrap/JNANativesTests.java index 47683702324..b1d9e818072 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/JNANativesTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/JNANativesTests.java @@ -17,14 +17,14 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; import org.apache.lucene.util.Constants; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import static org.hamcrest.Matchers.equalTo; -public class JNANativesTests extends ESTestCase { +public class JNANativesTests extends OpenSearchTestCase { public void testMlockall() { if (Constants.MAC_OS_X) { assertFalse("Memory locking is not available on OS X platforms", JNANatives.LOCAL_MLOCKALL); diff --git a/server/src/test/java/org/elasticsearch/bootstrap/JavaVersionTests.java b/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/bootstrap/JavaVersionTests.java rename to server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java index 7c65bd716af..71de076d2fa 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/JavaVersionTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.util.List; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -public class JavaVersionTests extends ESTestCase { +public class JavaVersionTests extends OpenSearchTestCase { public void testParse() { JavaVersion javaVersion = JavaVersion.parse("1.7.0"); List version = javaVersion.getVersion(); diff --git a/server/src/test/java/org/elasticsearch/bootstrap/MaxMapCountCheckTests.java b/server/src/test/java/org/opensearch/bootstrap/MaxMapCountCheckTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/bootstrap/MaxMapCountCheckTests.java rename to server/src/test/java/org/opensearch/bootstrap/MaxMapCountCheckTests.java index 0e3842e2dc3..a3421da6ea7 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/MaxMapCountCheckTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/MaxMapCountCheckTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; @@ -25,12 +25,12 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.util.Constants; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.io.PathUtils; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.AbstractBootstrapCheckTestCase; -import org.elasticsearch.test.MockLogAppender; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.io.PathUtils; +import org.opensearch.common.logging.Loggers; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.AbstractBootstrapCheckTestCase; +import org.opensearch.test.MockLogAppender; import java.io.BufferedReader; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java b/server/src/test/java/org/opensearch/bootstrap/OpenSearchCliTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java rename to server/src/test/java/org/opensearch/bootstrap/OpenSearchCliTests.java index ba8c14fb49a..3d5ea1e4291 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/OpenSearchCliTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.Build; -import org.elasticsearch.cli.ExitCodes; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.monitor.jvm.JvmInfo; +import org.opensearch.Build; +import org.opensearch.cli.ExitCodes; +import org.opensearch.common.settings.Settings; +import org.opensearch.monitor.jvm.JvmInfo; import java.nio.file.Path; import java.util.Locale; @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.allOf; -public class ElasticsearchCliTests extends ESElasticsearchCliTestCase { +public class OpenSearchCliTests extends BaseOpenSearchCliTestCase { public void testVersion() throws Exception { runTestThatVersionIsMutuallyExclusiveToOtherOptions("-V", "-d"); @@ -149,7 +149,7 @@ public class ElasticsearchCliTests extends ESElasticsearchCliTestCase { args); } - public void testElasticsearchSettings() throws Exception { + public void testOpenSearchSettings() throws Exception { runTest( ExitCodes.OK, true, @@ -162,7 +162,7 @@ public class ElasticsearchCliTests extends ESElasticsearchCliTestCase { "-Efoo=bar", "-E", "baz=qux"); } - public void testElasticsearchSettingCanNotBeEmpty() throws Exception { + public void testOpenSearchSettingCanNotBeEmpty() throws Exception { runTest( ExitCodes.USAGE, false, @@ -171,7 +171,7 @@ public class ElasticsearchCliTests extends ESElasticsearchCliTestCase { "-E", "foo="); } - public void testElasticsearchSettingCanNotBeDuplicated() throws Exception { + public void testOpenSsearchSettingCanNotBeDuplicated() throws Exception { runTest( ExitCodes.USAGE, false, diff --git a/server/src/test/java/org/elasticsearch/bootstrap/ESPolicyTests.java b/server/src/test/java/org/opensearch/bootstrap/OpenSearchPolicyTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/bootstrap/ESPolicyTests.java rename to server/src/test/java/org/opensearch/bootstrap/OpenSearchPolicyTests.java index cc1134e594a..6358f6d1f10 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/ESPolicyTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/OpenSearchPolicyTests.java @@ -17,9 +17,9 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.security.AccessControlContext; import java.security.AccessController; @@ -28,12 +28,12 @@ import java.security.Permissions; import java.security.PrivilegedAction; import java.security.ProtectionDomain; -/** - * Tests for ESPolicy +/** + * Tests for OpenSearchPolicy */ -public class ESPolicyTests extends ESTestCase { +public class OpenSearchPolicyTests extends OpenSearchTestCase { - /** + /** * test restricting privileges to no permissions actually works */ public void testRestrictPrivileges() { diff --git a/server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchUncaughtExceptionHandlerTests.java b/server/src/test/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandlerTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchUncaughtExceptionHandlerTests.java rename to server/src/test/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandlerTests.java index a6e50170d7e..58c31d01425 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/ElasticsearchUncaughtExceptionHandlerTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandlerTests.java @@ -17,9 +17,9 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.junit.Before; import java.io.IOError; @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicReference; import static org.hamcrest.CoreMatchers.equalTo; -public class ElasticsearchUncaughtExceptionHandlerTests extends ESTestCase { +public class OpenSearchUncaughtExceptionHandlerTests extends OpenSearchTestCase { private Map, Integer> expectedStatus; @@ -65,7 +65,7 @@ public class ElasticsearchUncaughtExceptionHandlerTests extends ESTestCase { final AtomicInteger observedStatus = new AtomicInteger(); final AtomicReference threadNameReference = new AtomicReference<>(); final AtomicReference throwableReference = new AtomicReference<>(); - thread.setUncaughtExceptionHandler(new ElasticsearchUncaughtExceptionHandler() { + thread.setUncaughtExceptionHandler(new OpenSearchUncaughtExceptionHandler() { @Override void halt(int status) { @@ -106,7 +106,7 @@ public class ElasticsearchUncaughtExceptionHandlerTests extends ESTestCase { thread.setName(name); final AtomicReference threadNameReference = new AtomicReference<>(); final AtomicReference throwableReference = new AtomicReference<>(); - thread.setUncaughtExceptionHandler(new ElasticsearchUncaughtExceptionHandler() { + thread.setUncaughtExceptionHandler(new OpenSearchUncaughtExceptionHandler() { @Override void halt(int status) { fail(); @@ -140,11 +140,11 @@ public class ElasticsearchUncaughtExceptionHandlerTests extends ESTestCase { } private void assertFatal(Throwable cause) { - assertTrue(ElasticsearchUncaughtExceptionHandler.isFatalUncaught(cause)); + assertTrue(OpenSearchUncaughtExceptionHandler.isFatalUncaught(cause)); } private void assertNonFatal(Throwable cause) { - assertFalse(ElasticsearchUncaughtExceptionHandler.isFatalUncaught(cause)); + assertFalse(OpenSearchUncaughtExceptionHandler.isFatalUncaught(cause)); } } diff --git a/server/src/test/java/org/elasticsearch/bootstrap/SecurityTests.java b/server/src/test/java/org/opensearch/bootstrap/SecurityTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/bootstrap/SecurityTests.java rename to server/src/test/java/org/opensearch/bootstrap/SecurityTests.java index 132e46c7b90..52ec382fdf2 100644 --- a/server/src/test/java/org/elasticsearch/bootstrap/SecurityTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/SecurityTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.bootstrap; +package org.opensearch.bootstrap; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -public class SecurityTests extends ESTestCase { - +public class SecurityTests extends OpenSearchTestCase { + public void testEnsureExists() throws IOException { Path p = createTempDir(); @@ -36,8 +36,8 @@ public class SecurityTests extends ESTestCase { Security.ensureDirectoryExists(exists); Files.createTempFile(exists, null, null); } - - public void testEnsureNotExists() throws IOException { + + public void testEnsureNotExists() throws IOException { Path p = createTempDir(); // directory does not exist: create it @@ -45,7 +45,7 @@ public class SecurityTests extends ESTestCase { Security.ensureDirectoryExists(notExists); Files.createTempFile(notExists, null, null); } - + public void testEnsureRegularFile() throws IOException { Path p = createTempDir(); @@ -57,7 +57,7 @@ public class SecurityTests extends ESTestCase { fail("didn't get expected exception"); } catch (IOException expected) {} } - + /** can't execute processes */ public void testProcessExecution() throws Exception { assumeTrue("test requires security manager", System.getSecurityManager() != null); diff --git a/test/framework/src/main/java/org/elasticsearch/bootstrap/ESElasticsearchCliTestCase.java b/test/framework/src/main/java/org/elasticsearch/bootstrap/ESOpenSearchCliTestCase.java similarity index 100% rename from test/framework/src/main/java/org/elasticsearch/bootstrap/ESElasticsearchCliTestCase.java rename to test/framework/src/main/java/org/elasticsearch/bootstrap/ESOpenSearchCliTestCase.java