[Rename] server/src/test/java/org/elasticsearch/(cli,client,deps,env) (#219)

Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
This commit is contained in:
Abbas Hussain 2021-03-08 20:50:48 +05:30 committed by Nick Knize
parent ccefe895d2
commit 8c2f6f9d1e
21 changed files with 274 additions and 274 deletions

View File

@ -17,13 +17,13 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.cli; package org.opensearch.cli;
import joptsimple.OptionException; import joptsimple.OptionException;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
public class CommandTests extends ESTestCase { public class CommandTests extends OpenSearchTestCase {
static class UserErrorCommand extends Command { static class UserErrorCommand extends Command {

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.cli; package org.opensearch.cli;
import joptsimple.ArgumentAcceptingOptionSpec; import joptsimple.ArgumentAcceptingOptionSpec;
import joptsimple.OptionSet; import joptsimple.OptionSet;

View File

@ -17,17 +17,17 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.cli; package org.opensearch.cli;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.StringReader; import java.io.StringReader;
import static org.elasticsearch.cli.Terminal.readLineToCharArray; import static org.opensearch.cli.Terminal.readLineToCharArray;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class TerminalTests extends ESTestCase { public class TerminalTests extends OpenSearchTestCase {
public void testVerbosity() throws Exception { public void testVerbosity() throws Exception {
MockTerminal terminal = new MockTerminal(); MockTerminal terminal = new MockTerminal();

View File

@ -17,29 +17,29 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client; package org.opensearch.client;
import org.elasticsearch.ExceptionsHelper; import org.opensearch.ExceptionsHelper;
import org.elasticsearch.action.ActionType; import org.opensearch.action.ActionType;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteAction; import org.opensearch.action.admin.cluster.reroute.ClusterRerouteAction;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotAction;
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; import org.opensearch.action.admin.cluster.stats.ClusterStatsAction;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptAction; import org.opensearch.action.admin.cluster.storedscripts.DeleteStoredScriptAction;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheAction; import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheAction;
import org.elasticsearch.action.admin.indices.create.CreateIndexAction; import org.opensearch.action.admin.indices.create.CreateIndexAction;
import org.elasticsearch.action.admin.indices.flush.FlushAction; import org.opensearch.action.admin.indices.flush.FlushAction;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsAction; import org.opensearch.action.admin.indices.stats.IndicesStatsAction;
import org.elasticsearch.action.delete.DeleteAction; import org.opensearch.action.delete.DeleteAction;
import org.elasticsearch.action.get.GetAction; import org.opensearch.action.get.GetAction;
import org.elasticsearch.action.index.IndexAction; import org.opensearch.action.index.IndexAction;
import org.elasticsearch.action.search.SearchAction; import org.opensearch.action.search.SearchAction;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.env.Environment; import org.opensearch.env.Environment;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -49,7 +49,7 @@ import java.util.stream.Collectors;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
public abstract class AbstractClientHeadersTestCase extends ESTestCase { public abstract class AbstractClientHeadersTestCase extends OpenSearchTestCase {
protected static final Settings HEADER_SETTINGS = Settings.builder() protected static final Settings HEADER_SETTINGS = Settings.builder()
.put(ThreadContext.PREFIX + ".key1", "val1") .put(ThreadContext.PREFIX + ".key1", "val1")

View File

@ -17,20 +17,20 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client; package org.opensearch.client;
import org.elasticsearch.action.ActionType; import org.opensearch.action.ActionType;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest; import org.opensearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse; import org.opensearch.action.ActionResponse;
import org.elasticsearch.action.bulk.BulkRequest; import org.opensearch.action.bulk.BulkRequest;
import org.elasticsearch.action.search.ClearScrollRequest; import org.opensearch.action.search.ClearScrollRequest;
import org.elasticsearch.action.search.SearchRequest; import org.opensearch.action.search.SearchRequest;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.test.client.NoOpClient; import org.opensearch.test.client.NoOpClient;
public class OriginSettingClientTests extends ESTestCase { public class OriginSettingClientTests extends OpenSearchTestCase {
public void testSetsParentId() { public void testSetsParentId() {
String origin = randomAlphaOfLength(7); String origin = randomAlphaOfLength(7);

View File

@ -17,20 +17,20 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client; package org.opensearch.client;
import org.elasticsearch.action.ActionType; import org.opensearch.action.ActionType;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest; import org.opensearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse; import org.opensearch.action.ActionResponse;
import org.elasticsearch.action.bulk.BulkRequest; import org.opensearch.action.bulk.BulkRequest;
import org.elasticsearch.action.search.ClearScrollRequest; import org.opensearch.action.search.ClearScrollRequest;
import org.elasticsearch.action.search.SearchRequest; import org.opensearch.action.search.SearchRequest;
import org.elasticsearch.tasks.TaskId; import org.opensearch.tasks.TaskId;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.test.client.NoOpClient; import org.opensearch.test.client.NoOpClient;
public class ParentTaskAssigningClientTests extends ESTestCase { public class ParentTaskAssigningClientTests extends OpenSearchTestCase {
public void testSetsParentId() { public void testSetsParentId() {
TaskId[] parentTaskId = new TaskId[] {new TaskId(randomAlphaOfLength(3), randomLong())}; TaskId[] parentTaskId = new TaskId[] {new TaskId(randomAlphaOfLength(3), randomLong())};

View File

@ -17,20 +17,20 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client.node; package org.opensearch.client.node;
import org.elasticsearch.action.ActionType; import org.opensearch.action.ActionType;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest; import org.opensearch.action.ActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.opensearch.action.support.ActionFilters;
import org.elasticsearch.action.support.TransportAction; import org.opensearch.action.support.TransportAction;
import org.elasticsearch.client.AbstractClientHeadersTestCase; import org.opensearch.client.AbstractClientHeadersTestCase;
import org.elasticsearch.client.Client; import org.opensearch.client.Client;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.tasks.Task; import org.opensearch.tasks.Task;
import org.elasticsearch.tasks.TaskManager; import org.opensearch.tasks.TaskManager;
import org.elasticsearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View File

@ -17,34 +17,34 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client.transport; package org.opensearch.client.transport;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.node.liveness.LivenessResponse; import org.opensearch.action.admin.cluster.node.liveness.LivenessResponse;
import org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction; import org.opensearch.action.admin.cluster.node.liveness.TransportLivenessAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.opensearch.action.admin.cluster.state.ClusterStateAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.opensearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.cluster.ClusterName; import org.opensearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.opensearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.component.Lifecycle; import org.opensearch.common.component.Lifecycle;
import org.elasticsearch.common.component.LifecycleListener; import org.opensearch.common.component.LifecycleListener;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.transport.BoundTransportAddress; import org.opensearch.common.transport.BoundTransportAddress;
import org.elasticsearch.common.transport.TransportAddress; import org.opensearch.common.transport.TransportAddress;
import org.elasticsearch.transport.CloseableConnection; import org.opensearch.transport.CloseableConnection;
import org.elasticsearch.transport.ConnectTransportException; import org.opensearch.transport.ConnectTransportException;
import org.elasticsearch.transport.ConnectionProfile; import org.opensearch.transport.ConnectionProfile;
import org.elasticsearch.transport.Transport; import org.opensearch.transport.Transport;
import org.elasticsearch.transport.TransportException; import org.opensearch.transport.TransportException;
import org.elasticsearch.transport.TransportMessageListener; import org.opensearch.transport.TransportMessageListener;
import org.elasticsearch.transport.TransportRequest; import org.opensearch.transport.TransportRequest;
import org.elasticsearch.transport.TransportRequestOptions; import org.opensearch.transport.TransportRequestOptions;
import org.elasticsearch.transport.TransportResponse; import org.opensearch.transport.TransportResponse;
import org.elasticsearch.transport.TransportResponseHandler; import org.opensearch.transport.TransportResponseHandler;
import org.elasticsearch.transport.TransportService; import org.opensearch.transport.TransportService;
import org.elasticsearch.transport.TransportStats; import org.opensearch.transport.TransportStats;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.Collections; import java.util.Collections;

View File

@ -17,42 +17,42 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client.transport; package org.opensearch.client.transport;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.action.ActionType; import org.opensearch.action.ActionType;
import org.elasticsearch.action.admin.cluster.node.liveness.LivenessResponse; import org.opensearch.action.admin.cluster.node.liveness.LivenessResponse;
import org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction; import org.opensearch.action.admin.cluster.node.liveness.TransportLivenessAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.opensearch.action.admin.cluster.state.ClusterStateAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.opensearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.client.AbstractClientHeadersTestCase; import org.opensearch.client.AbstractClientHeadersTestCase;
import org.elasticsearch.client.Client; import org.opensearch.client.Client;
import org.elasticsearch.cluster.ClusterName; import org.opensearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.opensearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.network.NetworkModule; import org.opensearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress; import org.opensearch.common.transport.TransportAddress;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.env.Environment; import org.opensearch.env.Environment;
import org.elasticsearch.plugins.NetworkPlugin; import org.opensearch.plugins.NetworkPlugin;
import org.elasticsearch.plugins.Plugin; import org.opensearch.plugins.Plugin;
import org.elasticsearch.plugins.PluginsService; import org.opensearch.plugins.PluginsService;
import org.elasticsearch.test.transport.MockTransportService; import org.opensearch.test.transport.MockTransportService;
import org.elasticsearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.transport.MockTransportClient; import org.opensearch.transport.MockTransportClient;
import org.elasticsearch.transport.Transport; import org.opensearch.transport.Transport;
import org.elasticsearch.transport.TransportException; import org.opensearch.transport.TransportException;
import org.elasticsearch.transport.TransportInterceptor; import org.opensearch.transport.TransportInterceptor;
import org.elasticsearch.transport.TransportRequest; import org.opensearch.transport.TransportRequest;
import org.elasticsearch.transport.TransportRequestHandler; import org.opensearch.transport.TransportRequestHandler;
import org.elasticsearch.transport.TransportRequestOptions; import org.opensearch.transport.TransportRequestOptions;
import org.elasticsearch.transport.TransportResponse; import org.opensearch.transport.TransportResponse;
import org.elasticsearch.transport.TransportResponseHandler; import org.opensearch.transport.TransportResponseHandler;
import org.elasticsearch.transport.TransportService; import org.opensearch.transport.TransportService;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View File

@ -17,41 +17,41 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client.transport; package org.opensearch.client.transport;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.node.liveness.LivenessResponse; import org.opensearch.action.admin.cluster.node.liveness.LivenessResponse;
import org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction; import org.opensearch.action.admin.cluster.node.liveness.TransportLivenessAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.opensearch.action.admin.cluster.state.ClusterStateAction;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; import org.opensearch.action.admin.cluster.state.ClusterStateRequest;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.opensearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.support.PlainActionFuture; import org.opensearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.ClusterName; import org.opensearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.opensearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.UUIDs; import org.opensearch.common.UUIDs;
import org.elasticsearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress; import org.opensearch.common.transport.TransportAddress;
import org.elasticsearch.common.unit.TimeValue; import org.opensearch.common.unit.TimeValue;
import org.elasticsearch.node.Node; import org.opensearch.node.Node;
import org.elasticsearch.tasks.Task; import org.opensearch.tasks.Task;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.test.transport.MockTransportService; import org.opensearch.test.transport.MockTransportService;
import org.elasticsearch.threadpool.TestThreadPool; import org.opensearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool;
import org.elasticsearch.transport.Transport; import org.opensearch.transport.Transport;
import org.elasticsearch.transport.TransportChannel; import org.opensearch.transport.TransportChannel;
import org.elasticsearch.transport.TransportException; import org.opensearch.transport.TransportException;
import org.elasticsearch.transport.TransportInterceptor; import org.opensearch.transport.TransportInterceptor;
import org.elasticsearch.transport.TransportRequest; import org.opensearch.transport.TransportRequest;
import org.elasticsearch.transport.TransportRequestHandler; import org.opensearch.transport.TransportRequestHandler;
import org.elasticsearch.transport.TransportRequestOptions; import org.opensearch.transport.TransportRequestOptions;
import org.elasticsearch.transport.TransportResponse; import org.opensearch.transport.TransportResponse;
import org.elasticsearch.transport.TransportResponseHandler; import org.opensearch.transport.TransportResponseHandler;
import org.hamcrest.CustomMatcher; import org.hamcrest.CustomMatcher;
import java.io.Closeable; import java.io.Closeable;
@ -67,7 +67,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import static org.elasticsearch.test.transport.MockTransportService.createNewService; import static org.opensearch.test.transport.MockTransportService.createNewService;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.everyItem; import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.hasItem;
@ -78,7 +78,7 @@ import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
public class TransportClientNodesServiceTests extends ESTestCase { public class TransportClientNodesServiceTests extends OpenSearchTestCase {
private static class TestIteration implements Closeable { private static class TestIteration implements Closeable {
private final ThreadPool threadPool; private final ThreadPool threadPool;

View File

@ -17,21 +17,21 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.client.transport; package org.opensearch.client.transport;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.common.io.stream.NamedWriteable; import org.opensearch.common.io.stream.NamedWriteable;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; import org.opensearch.common.io.stream.NamedWriteableRegistry.Entry;
import org.elasticsearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.env.Environment; import org.opensearch.env.Environment;
import org.elasticsearch.plugins.Plugin; import org.opensearch.plugins.Plugin;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.transport.MockTransportClient; import org.opensearch.transport.MockTransportClient;
import org.elasticsearch.transport.TransportSettings; import org.opensearch.transport.TransportSettings;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -43,7 +43,7 @@ import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.object.HasToString.hasToString; import static org.hamcrest.object.HasToString.hasToString;
public class TransportClientTests extends ESTestCase { public class TransportClientTests extends OpenSearchTestCase {
public void testThatUsingAClosedClientThrowsAnException() throws ExecutionException, InterruptedException { public void testThatUsingAClosedClientThrowsAnException() throws ExecutionException, InterruptedException {
final TransportClient client = new MockTransportClient(Settings.EMPTY); final TransportClient client = new MockTransportClient(Settings.EMPTY);

View File

@ -17,20 +17,20 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.deps.jackson; package org.opensearch.deps.jackson;
import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.JsonToken;
import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.IOException; import java.io.IOException;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class JacksonLocationTests extends ESTestCase { public class JacksonLocationTests extends OpenSearchTestCase {
public void testLocationExtraction() throws IOException { public void testLocationExtraction() throws IOException {
// { // {
// "index" : "test", // "index" : "test",

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.deps.lucene; package org.opensearch.deps.lucene;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
@ -45,15 +45,15 @@ import org.apache.lucene.search.TopFieldDocs;
import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.ByteBuffersDirectory;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.lucene.Lucene; import org.opensearch.common.lucene.Lucene;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class SimpleLuceneTests extends ESTestCase { public class SimpleLuceneTests extends OpenSearchTestCase {
public void testSortValues() throws Exception { public void testSortValues() throws Exception {
Directory dir = new ByteBuffersDirectory(); Directory dir = new ByteBuffersDirectory();
IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.STANDARD_ANALYZER)); IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.STANDARD_ANALYZER));

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
package org.elasticsearch.deps.lucene; package org.opensearch.deps.lucene;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
@ -37,14 +37,14 @@ import org.apache.lucene.search.vectorhighlight.CustomFieldQuery;
import org.apache.lucene.search.vectorhighlight.FastVectorHighlighter; import org.apache.lucene.search.vectorhighlight.FastVectorHighlighter;
import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.ByteBuffersDirectory;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.elasticsearch.common.lucene.Lucene; import org.opensearch.common.lucene.Lucene;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.nullValue;
public class VectorHighlighterTests extends ESTestCase { public class VectorHighlighterTests extends OpenSearchTestCase {
public void testVectorHighlighter() throws Exception { public void testVectorHighlighter() throws Exception {
Directory dir = new ByteBuffersDirectory(); Directory dir = new ByteBuffersDirectory();
IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.STANDARD_ANALYZER)); IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.STANDARD_ANALYZER));

View File

@ -16,23 +16,23 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.nio.file.FileStore; import java.nio.file.FileStore;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
public class ESFileStoreTests extends ESTestCase { public class OpenSearchFileStoreTests extends OpenSearchTestCase {
public void testNegativeSpace() throws Exception { public void testNegativeSpace() throws Exception {
FileStore mocked = mock(FileStore.class); FileStore mocked = mock(FileStore.class);
when(mocked.getUsableSpace()).thenReturn(-1L); when(mocked.getUsableSpace()).thenReturn(-1L);
when(mocked.getTotalSpace()).thenReturn(-1L); when(mocked.getTotalSpace()).thenReturn(-1L);
when(mocked.getUnallocatedSpace()).thenReturn(-1L); when(mocked.getUnallocatedSpace()).thenReturn(-1L);
assertEquals(-1, mocked.getUsableSpace()); assertEquals(-1, mocked.getUsableSpace());
FileStore store = new ESFileStore(mocked); FileStore store = new OpenSearchFileStore(mocked);
assertEquals(Long.MAX_VALUE, store.getUsableSpace()); assertEquals(Long.MAX_VALUE, store.getUsableSpace());
assertEquals(Long.MAX_VALUE, store.getTotalSpace()); assertEquals(Long.MAX_VALUE, store.getTotalSpace());
assertEquals(Long.MAX_VALUE, store.getUnallocatedSpace()); assertEquals(Long.MAX_VALUE, store.getUnallocatedSpace());

View File

@ -16,12 +16,12 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import org.elasticsearch.common.io.PathUtils; import org.opensearch.common.io.PathUtils;
import org.elasticsearch.common.settings.Setting; import org.opensearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.hasToString;
/** /**
* Simple unit-tests for Environment.java * Simple unit-tests for Environment.java
*/ */
public class EnvironmentTests extends ESTestCase { public class EnvironmentTests extends OpenSearchTestCase {
public Environment newEnvironment() { public Environment newEnvironment() {
return newEnvironment(Settings.EMPTY); return newEnvironment(Settings.EMPTY);
} }

View File

@ -16,26 +16,26 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.common.SuppressForbidden; import org.opensearch.common.SuppressForbidden;
import org.elasticsearch.common.io.PathUtils; import org.opensearch.common.io.PathUtils;
import org.elasticsearch.common.settings.Setting; import org.opensearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.AbstractRunnable;
import org.elasticsearch.common.util.set.Sets; import org.opensearch.common.util.set.Sets;
import org.elasticsearch.core.internal.io.IOUtils; import org.opensearch.core.internal.io.IOUtils;
import org.elasticsearch.gateway.MetadataStateFormat; import org.opensearch.gateway.MetadataStateFormat;
import org.elasticsearch.index.Index; import org.opensearch.index.Index;
import org.elasticsearch.index.IndexSettings; import org.opensearch.index.IndexSettings;
import org.elasticsearch.index.shard.ShardId; import org.opensearch.index.shard.ShardId;
import org.elasticsearch.node.Node; import org.opensearch.node.Node;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.test.IndexSettingsModule; import org.opensearch.test.IndexSettingsModule;
import org.elasticsearch.test.NodeRoles; import org.opensearch.test.NodeRoles;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
@ -52,8 +52,8 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import static org.elasticsearch.test.NodeRoles.nonDataNode; import static org.opensearch.test.NodeRoles.nonDataNode;
import static org.elasticsearch.test.NodeRoles.nonMasterNode; import static org.opensearch.test.NodeRoles.nonMasterNode;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
@ -62,7 +62,7 @@ import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.startsWith; import static org.hamcrest.Matchers.startsWith;
@LuceneTestCase.SuppressFileSystems("ExtrasFS") // TODO: fix test to allow extras @LuceneTestCase.SuppressFileSystems("ExtrasFS") // TODO: fix test to allow extras
public class NodeEnvironmentTests extends ESTestCase { public class NodeEnvironmentTests extends OpenSearchTestCase {
private final IndexSettings idxSettings = IndexSettingsModule.newIndexSettings("foo", Settings.EMPTY); private final IndexSettings idxSettings = IndexSettingsModule.newIndexSettings("foo", Settings.EMPTY);
public void testNodeLockSillySettings() { public void testNodeLockSillySettings() {
@ -79,7 +79,7 @@ public class NodeEnvironmentTests extends ESTestCase {
int max = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.get( int max = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.get(
Settings.builder().put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), value).build()); Settings.builder().put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), value).build());
assertEquals(value, max); assertEquals(value, max);
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in OpenSearch and will be removed in a future release! " +
"See the breaking changes documentation for the next major version."); "See the breaking changes documentation for the next major version.");
} }
@ -103,7 +103,7 @@ public class NodeEnvironmentTests extends ESTestCase {
} }
env.close(); env.close();
assertThat(env.lockedShards(), empty()); assertThat(env.lockedShards(), empty());
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in OpenSearch and will be removed in a future release! " +
"See the breaking changes documentation for the next major version."); "See the breaking changes documentation for the next major version.");
} }
@ -139,7 +139,7 @@ public class NodeEnvironmentTests extends ESTestCase {
assertEquals(first.nodeDataPaths()[i].getParent(), second.nodeDataPaths()[i].getParent()); assertEquals(first.nodeDataPaths()[i].getParent(), second.nodeDataPaths()[i].getParent());
} }
IOUtils.close(first, second); IOUtils.close(first, second);
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in OpenSearch and will be removed in a future release! " +
"See the breaking changes documentation for the next major version."); "See the breaking changes documentation for the next major version.");
} }

View File

@ -16,14 +16,14 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.common.collect.Tuple; import org.opensearch.common.collect.Tuple;
import org.elasticsearch.gateway.MetadataStateFormat; import org.opensearch.gateway.MetadataStateFormat;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.opensearch.test.EqualsHashCodeTestUtils;
import org.elasticsearch.test.VersionUtils; import org.opensearch.test.VersionUtils;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.startsWith; import static org.hamcrest.Matchers.startsWith;
public class NodeMetadataTests extends ESTestCase { public class NodeMetadataTests extends OpenSearchTestCase {
private Version randomVersion() { private Version randomVersion() {
// VersionUtils.randomVersion() only returns known versions, which are necessarily no later than Version.CURRENT; however we want // VersionUtils.randomVersion() only returns known versions, which are necessarily no later than Version.CURRENT; however we want
// also to consider our behaviour with all versions, so occasionally pick up a truly random version. // also to consider our behaviour with all versions, so occasionally pick up a truly random version.

View File

@ -16,27 +16,27 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import org.elasticsearch.OpenSearchException; import org.opensearch.OpenSearchException;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.cli.MockTerminal; import org.opensearch.cli.MockTerminal;
import org.elasticsearch.cli.Terminal; import org.opensearch.cli.Terminal;
import org.elasticsearch.cluster.ClusterName; import org.opensearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.opensearch.cluster.ClusterState;
import org.elasticsearch.cluster.coordination.OpenSearchNodeCommand; import org.opensearch.cluster.coordination.OpenSearchNodeCommand;
import org.elasticsearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.Metadata; import org.opensearch.cluster.metadata.Metadata;
import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.common.CheckedConsumer; import org.opensearch.common.CheckedConsumer;
import org.elasticsearch.common.CheckedRunnable; import org.opensearch.common.CheckedRunnable;
import org.elasticsearch.common.settings.ClusterSettings; import org.opensearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.util.BigArrays; import org.opensearch.common.util.BigArrays;
import org.elasticsearch.gateway.PersistedClusterStateService; import org.opensearch.gateway.PersistedClusterStateService;
import org.elasticsearch.index.Index; import org.opensearch.index.Index;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.junit.Before; import org.junit.Before;
@ -48,18 +48,18 @@ import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.stream.Stream; import java.util.stream.Stream;
import static org.elasticsearch.env.NodeRepurposeCommand.NO_CLEANUP; import static org.opensearch.env.NodeRepurposeCommand.NO_CLEANUP;
import static org.elasticsearch.env.NodeRepurposeCommand.NO_DATA_TO_CLEAN_UP_FOUND; import static org.opensearch.env.NodeRepurposeCommand.NO_DATA_TO_CLEAN_UP_FOUND;
import static org.elasticsearch.env.NodeRepurposeCommand.NO_SHARD_DATA_TO_CLEAN_UP_FOUND; import static org.opensearch.env.NodeRepurposeCommand.NO_SHARD_DATA_TO_CLEAN_UP_FOUND;
import static org.elasticsearch.test.NodeRoles.masterNode; import static org.opensearch.test.NodeRoles.masterNode;
import static org.elasticsearch.test.NodeRoles.nonDataNode; import static org.opensearch.test.NodeRoles.nonDataNode;
import static org.elasticsearch.test.NodeRoles.nonMasterNode; import static org.opensearch.test.NodeRoles.nonMasterNode;
import static org.elasticsearch.test.NodeRoles.removeRoles; import static org.opensearch.test.NodeRoles.removeRoles;
import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.not;
public class NodeRepurposeCommandTests extends ESTestCase { public class NodeRepurposeCommandTests extends OpenSearchTestCase {
private static final Index INDEX = new Index("testIndex", "testUUID"); private static final Index INDEX = new Index("testIndex", "testUUID");
private Settings dataMasterSettings; private Settings dataMasterSettings;

View File

@ -16,21 +16,21 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.elasticsearch.env; package org.opensearch.env;
import joptsimple.OptionParser; import joptsimple.OptionParser;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import org.elasticsearch.OpenSearchException; import org.opensearch.OpenSearchException;
import org.elasticsearch.Version; import org.opensearch.Version;
import org.elasticsearch.cli.MockTerminal; import org.opensearch.cli.MockTerminal;
import org.elasticsearch.cluster.ClusterName; import org.opensearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.opensearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.Metadata; import org.opensearch.cluster.metadata.Metadata;
import org.elasticsearch.common.settings.ClusterSettings; import org.opensearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.elasticsearch.common.util.BigArrays; import org.opensearch.common.util.BigArrays;
import org.elasticsearch.gateway.PersistedClusterStateService; import org.opensearch.gateway.PersistedClusterStateService;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class OverrideNodeVersionCommandTests extends ESTestCase { public class OverrideNodeVersionCommandTests extends OpenSearchTestCase {
private Environment environment; private Environment environment;
private Path[] nodePaths; private Path[] nodePaths;