Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rename] server/src/test/java/org/elasticsearch/<files-only> #188

Merged
merged 11 commits into from
Mar 4, 2021
8 changes: 4 additions & 4 deletions server/src/main/java/org/elasticsearch/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static Type fromDisplayName(final String displayName, final boolean stric
type = Type.fromDisplayName(System.getProperty("es.distribution.type", "unknown"), true);

final String esPrefix = "elasticsearch-" + Version.CURRENT;
final URL url = getElasticsearchCodeSourceLocation();
final URL url = getOpenSearchCodeSourceLocation();
final String urlStr = url == null ? "" : url.toString();
if (urlStr.startsWith("file:/") && (
urlStr.endsWith(esPrefix + ".jar") ||
Expand Down Expand Up @@ -148,11 +148,11 @@ public static Type fromDisplayName(final String displayName, final boolean stric
private final boolean isSnapshot;

/**
* The location of the code source for Elasticsearch
* The location of the code source for OpenSearch
*
* @return the location of the code source for Elasticsearch which may be null
* @return the location of the code source for OpenSearch which may be null
*/
static URL getElasticsearchCodeSourceLocation() {
static URL getOpenSearchCodeSourceLocation() {
final CodeSource codeSource = Build.class.getProtectionDomain().getCodeSource();
return codeSource == null ? null : codeSource.getLocation();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* under the License.
*/

package org.elasticsearch;
package org.opensearch;

import org.elasticsearch.common.io.FileSystemUtils;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.EqualsHashCodeTestUtils;
import org.opensearch.common.io.FileSystemUtils;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.EqualsHashCodeTestUtils;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -44,7 +44,7 @@ public class BuildTests extends ESTestCase {

/** Asking for the jar metadata should not throw exception in tests, no matter how configured */
public void testJarMetadata() throws IOException {
URL url = Build.getElasticsearchCodeSourceLocation();
URL url = Build.getOpenSearchCodeSourceLocation();
// throws exception if does not exist, or we cannot access it
try (InputStream ignored = FileSystemUtils.openFileURLStream(url)) {}
// these should never be null
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
* under the License.
*/

package org.elasticsearch;
package org.opensearch;

import com.fasterxml.jackson.core.JsonParseException;
import org.apache.commons.codec.DecoderException;
import org.apache.lucene.index.CorruptIndexException;
import org.elasticsearch.action.OriginalIndices;
import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.search.ShardSearchFailure;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.query.QueryShardException;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.search.SearchShardTarget;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.RemoteClusterAware;
import org.opensearch.action.OriginalIndices;
import org.opensearch.action.ShardOperationFailedException;
import org.opensearch.action.search.ShardSearchFailure;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.ParsingException;
import org.opensearch.common.util.concurrent.EsRejectedExecutionException;
import org.opensearch.index.Index;
import org.opensearch.index.query.QueryShardException;
import org.opensearch.index.shard.ShardId;
import org.opensearch.rest.RestStatus;
import org.opensearch.search.SearchShardTarget;
import org.opensearch.test.ESTestCase;
import org.opensearch.transport.RemoteClusterAware;

import java.io.IOException;
import java.util.Optional;

import static org.elasticsearch.ExceptionsHelper.maybeError;
import static org.opensearch.ExceptionsHelper.maybeError;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.nullValue;
Expand Down
Loading