[Rename] server/src/test/java/org/apache (#187)

This commit refactors all instances of elasticsearch in server/src/test/java/org/apache to opensearch.

Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com>
This commit is contained in:
Abbas Hussain 2021-03-04 03:03:47 +05:30 committed by Nick Knize
parent 27bd8cf5cc
commit 89e67c1646
18 changed files with 32 additions and 32 deletions

View File

@ -24,7 +24,7 @@ import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;
@ -57,7 +57,7 @@ public class DeDuplicatingTokenFilterTests extends ESTestCase {
assertThat(output, equalTo(expectedOutput)); assertThat(output, equalTo(expectedOutput));
} }
public void testHitCountLimits() throws IOException { public void testHitCountLimits() throws IOException {
DuplicateByteSequenceSpotter bytesDeDuper = new DuplicateByteSequenceSpotter(); DuplicateByteSequenceSpotter bytesDeDuper = new DuplicateByteSequenceSpotter();
long peakMemoryUsed = 0; long peakMemoryUsed = 0;
@ -111,9 +111,9 @@ public class DeDuplicatingTokenFilterTests extends ESTestCase {
short[] expectedFrequencies = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 2, 2, 2, 2, 2 }; short[] expectedFrequencies = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 2, 2, 2, 2, 2 };
TokenStream test = analyzer.tokenStream("test", input); TokenStream test = analyzer.tokenStream("test", input);
DuplicateSequenceAttribute seqAtt = test.addAttribute(DuplicateSequenceAttribute.class); DuplicateSequenceAttribute seqAtt = test.addAttribute(DuplicateSequenceAttribute.class);
test.reset(); test.reset();
for (int i = 0; i < expectedFrequencies.length; i++) { for (int i = 0; i < expectedFrequencies.length; i++) {
assertThat(test.incrementToken(), equalTo(true)); assertThat(test.incrementToken(), equalTo(true));
assertThat(seqAtt.getNumPriorUsesInASequence(), equalTo(expectedFrequencies[i])); assertThat(seqAtt.getNumPriorUsesInASequence(), equalTo(expectedFrequencies[i]));
@ -124,4 +124,4 @@ public class DeDuplicatingTokenFilterTests extends ESTestCase {
} }
} }
} }

View File

@ -24,7 +24,7 @@ import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -48,9 +48,9 @@ import org.apache.lucene.search.grouping.CollapsingTopDocsCollector;
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.apache.lucene.util.NumericUtils; import org.apache.lucene.util.NumericUtils;
import org.elasticsearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.MockFieldMapper; import org.opensearch.index.mapper.MockFieldMapper;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -23,8 +23,8 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.search.BaseRangeFieldQueryTestCase; import org.apache.lucene.search.BaseRangeFieldQueryTestCase;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.index.mapper.RangeFieldMapper; import org.opensearch.index.mapper.RangeFieldMapper;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@ -26,9 +26,9 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
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.index.mapper.RangeFieldMapper; import org.opensearch.index.mapper.RangeFieldMapper;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -43,10 +43,10 @@ import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.ClassicSimilarity;
import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.opensearch.test.EqualsHashCodeTestUtils;
import org.elasticsearch.test.EqualsHashCodeTestUtils.CopyFunction; import org.opensearch.test.EqualsHashCodeTestUtils.CopyFunction;
import org.elasticsearch.test.EqualsHashCodeTestUtils.MutateFunction; import org.opensearch.test.EqualsHashCodeTestUtils.MutateFunction;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.lucene.queries; package org.apache.lucene.queries;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
public class DoubleRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase { public class DoubleRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase {

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.lucene.queries; package org.apache.lucene.queries;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
public class FloatRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase { public class FloatRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase {

View File

@ -20,7 +20,7 @@ package org.apache.lucene.queries;
import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.document.InetAddressPoint;
import org.apache.lucene.util.FutureArrays; import org.apache.lucene.util.FutureArrays;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;

View File

@ -19,7 +19,7 @@
package org.apache.lucene.queries; package org.apache.lucene.queries;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
public class IntegerRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase { public class IntegerRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase {

View File

@ -19,7 +19,7 @@
package org.apache.lucene.queries; package org.apache.lucene.queries;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.elasticsearch.index.mapper.RangeType; import org.opensearch.index.mapper.RangeType;
public class LongRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase { public class LongRandomBinaryDocValuesRangeQueryTests extends BaseRandomBinaryDocValuesRangeQueryTestCase {

View File

@ -27,7 +27,7 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.QueryUtils;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -40,7 +40,7 @@ import org.apache.lucene.search.TopDocs;
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.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.FixedBitSet;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -36,7 +36,7 @@ import org.apache.lucene.search.spans.SpanOrQuery;
import org.apache.lucene.search.spans.SpanQuery; import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.search.spans.SpanTermQuery; import org.apache.lucene.search.spans.SpanTermQuery;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -19,7 +19,7 @@
package org.apache.lucene.search.uhighlight; package org.apache.lucene.search.uhighlight;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.text.BreakIterator; import java.text.BreakIterator;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -22,7 +22,7 @@ package org.apache.lucene.search.uhighlight;
import org.apache.lucene.search.highlight.DefaultEncoder; import org.apache.lucene.search.highlight.DefaultEncoder;
import org.apache.lucene.search.highlight.SimpleHTMLEncoder; import org.apache.lucene.search.highlight.SimpleHTMLEncoder;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.notNullValue;

View File

@ -45,9 +45,9 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.highlight.DefaultEncoder; import org.apache.lucene.search.highlight.DefaultEncoder;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.elasticsearch.common.Strings; import org.opensearch.common.Strings;
import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery; import org.opensearch.common.lucene.search.MultiPhrasePrefixQuery;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
import java.text.BreakIterator; import java.text.BreakIterator;
import java.util.Locale; import java.util.Locale;

View File

@ -20,7 +20,7 @@
package org.apache.lucene.util; package org.apache.lucene.util;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.elasticsearch.test.ESTestCase; import org.opensearch.test.ESTestCase;
public class CombinedBitSetTests extends ESTestCase { public class CombinedBitSetTests extends ESTestCase {
public void testEmpty() { public void testEmpty() {