Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: panguixin <[email protected]>
  • Loading branch information
bugmakerrrrrr committed Dec 16, 2024
1 parent 6550f60 commit 92843d0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ setup:
- length: {hits.hits: 4 }
- match: { hits.hits.0._index: double_sort }
- match: { hits.hits.0._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.0.sort: [ 900719925474099.2 ] }
- match: { hits.hits.0.sort.0: 900719925474099.2 }
- match: { hits.hits.1._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.1.sort: [ 900719925474099.1 ] }
- match: { hits.hits.1.sort.0: 900719925474099.1 }
- match: { hits.hits.2._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.2.sort: [ 450359962737049.7 ] }
- match: { hits.hits.2.sort.0: 450359962737049.7 }
- match: { hits.hits.3._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.3.sort: [ 450359962737049.4 ] }
- match: { hits.hits.3.sort.0: 450359962737049.4 }

- do:
search:
Expand All @@ -55,13 +55,13 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: double_sort }
- match: { hits.hits.0._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.0.sort: [ 450359962737049.4 ] }
- match: { hits.hits.0.sort.0: 450359962737049.4 }
- match: { hits.hits.1._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.1.sort: [ 450359962737049.7 ] }
- match: { hits.hits.1.sort.0: 450359962737049.7 }
- match: { hits.hits.2._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.2.sort: [ 900719925474099.1 ] }
- match: { hits.hits.2.sort.0: 900719925474099.1 }
- match: { hits.hits.3._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.3.sort: [ 900719925474099.2 ] }
- match: { hits.hits.3.sort.0: 900719925474099.2 }

- do:
search:
Expand All @@ -75,11 +75,11 @@ setup:
- match: { hits.hits.0._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.0.sort: [ -2.0 ] }
- match: { hits.hits.1._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.1.sort: [ 1.1 ] }
- match: { hits.hits.1.sort.0: 1.1 }
- match: { hits.hits.2._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.2.sort: [ 3.5 ] }
- match: { hits.hits.2.sort.0: 3.5 }
- match: { hits.hits.3._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.3.sort: [ 900719925474099.2 ] }
- match: { hits.hits.3.sort.0: 900719925474099.2 }

- do:
search:
Expand All @@ -91,13 +91,13 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: double_sort }
- match: { hits.hits.0._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.0.sort: [ 900719925474099.2 ] }
- match: { hits.hits.0.sort.0: 900719925474099.2 }
- match: { hits.hits.1._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.1.sort: [ 450359962737050.1 ] }
- match: { hits.hits.1.sort.0: 450359962737050.1 }
- match: { hits.hits.2._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.2.sort: [ 4.6 ] }
- match: { hits.hits.2.sort.0: 4.6 }
- match: { hits.hits.3._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.3.sort: [ 1.95 ] }
- match: { hits.hits.3.sort.0: 1.95 }

- do:
search:
Expand All @@ -109,13 +109,13 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: double_sort }
- match: { hits.hits.0._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.0.sort: [ 112589990684262.89 ] }
- match: { hits.hits.0.sort.0: 112589990684262.89 }
- match: { hits.hits.1._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.1.sort: [ 150119987579019.16 ] }
- match: { hits.hits.1.sort.0: 150119987579019.16 }
- match: { hits.hits.2._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.2.sort: [ 450359962737050.1 ] }
- match: { hits.hits.2.sort.0: 450359962737050.1 }
- match: { hits.hits.3._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.3.sort: [ 900719925474099.2 ] }
- match: { hits.hits.3.sort.0: 900719925474099.2 }

- do:
search:
Expand All @@ -127,10 +127,10 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: double_sort }
- match: { hits.hits.0._source.field: [ 900719925474099.2, 900719925474099.2 ] }
- match: { hits.hits.0.sort: [ 1801439850948198.5 ] }
- match: { hits.hits.0.sort.0: 1801439850948198.5 }
- match: { hits.hits.1._source.field: [ 900719925474099.1, 1.1 ] }
- match: { hits.hits.1.sort: [ 900719925474100.2 ] }
- match: { hits.hits.1.sort.0: 900719925474100.2 }
- match: { hits.hits.2._source.field: [ 450359962737049.4, 3.5, 4.6 ] }
- match: { hits.hits.2.sort: [ 450359962737057.5 ] }
- match: { hits.hits.2.sort.0: 450359962737057.5 }
- match: { hits.hits.3._source.field: [ 450359962737049.7, 5.8, -1.9, -2.0 ] }
- match: { hits.hits.3.sort: [ 450359962737051.56 ] }
- match: { hits.hits.3.sort.0: 450359962737051.56 }
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ setup:
- length: {hits.hits: 4 }
- match: { hits.hits.0._index: long_sort }
- match: { hits.hits.0._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.0.sort: [ 9223372036854775807 ] }
- match: { hits.hits.0.sort.0: 9223372036854775807 }
- match: { hits.hits.1._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.1.sort: [ 922337203685477777 ] }
- match: { hits.hits.1.sort.0: 922337203685477777 }
- match: { hits.hits.2._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.2.sort: [ 2147483648 ] }
- match: { hits.hits.2.sort.0: 2147483648 }
- match: { hits.hits.3._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.3.sort: [ 2147483647 ] }
- match: { hits.hits.3.sort.0: 2147483647 }

- do:
search:
Expand All @@ -55,13 +55,13 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: long_sort }
- match: { hits.hits.0._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.0.sort: [ 2147483647 ] }
- match: { hits.hits.0.sort.0: 2147483647 }
- match: { hits.hits.1._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.1.sort: [ 2147483648 ] }
- match: { hits.hits.1.sort.0: 2147483648 }
- match: { hits.hits.2._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.2.sort: [ 922337203685477777 ] }
- match: { hits.hits.2.sort.0: 922337203685477777 }
- match: { hits.hits.3._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.3.sort: [ 9223372036854775807 ] }
- match: { hits.hits.3.sort.0: 9223372036854775807 }


- do:
Expand All @@ -74,11 +74,11 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: long_sort }
- match: { hits.hits.0._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.0.sort: [ 3 ] }
- match: { hits.hits.0.sort.0: 3 }
- match: { hits.hits.1._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.1.sort: [ 2 ] }
- match: { hits.hits.1.sort.0: 2 }
- match: { hits.hits.2._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.2.sort: [ 1 ] }
- match: { hits.hits.2.sort.0: 1 }
- match: { hits.hits.3._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.3.sort: [ -2 ] }

Expand All @@ -92,13 +92,13 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: long_sort }
- match: { hits.hits.0._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.0.sort: [ 2 ] }
- match: { hits.hits.0.sort.0: 2 }
- match: { hits.hits.1._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.1.sort: [ 4 ] }
- match: { hits.hits.1.sort.0: 4 }
- match: { hits.hits.2._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.2.sort: [ 461168601842738880 ] }
- match: { hits.hits.2.sort.0: 461168601842738880 }
- match: { hits.hits.3._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.3.sort: [ 4611686018427387904 ] }
- match: { hits.hits.3.sort.0: 4611686018427387904 }

- do:
search:
Expand All @@ -110,11 +110,11 @@ setup:
- length: { hits.hits: 4 }
- match: { hits.hits.0._index: long_sort }
- match: { hits.hits.0._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.0.sort: [ 461168601842738880 ] }
- match: { hits.hits.0.sort.0: 461168601842738880 }
- match: { hits.hits.1._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.1.sort: [ 715827885 ] }
- match: { hits.hits.1.sort.0: 715827885 }
- match: { hits.hits.2._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.2.sort: [ 536870913 ] }
- match: { hits.hits.2.sort.0: 536870913 }
- match: { hits.hits.3._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.3.sort: [ -4611686018427387904 ] }

Expand All @@ -130,8 +130,8 @@ setup:
- match: { hits.hits.0._source.field: [ 9223372036854775807, 1 ] }
- match: { hits.hits.0.sort: [ -9223372036854775808 ] }
- match: { hits.hits.1._source.field: [ 2147483648, 5, -1, -2 ] }
- match: { hits.hits.1.sort: [ 2147483650 ] }
- match: { hits.hits.1.sort.0: 2147483650 }
- match: { hits.hits.2._source.field: [ 2147483647, 3, 4 ] }
- match: { hits.hits.2.sort: [ 2147483654 ] }
- match: { hits.hits.2.sort.0: 2147483654 }
- match: { hits.hits.3._source.field: [ 922337203685477777, 2 ] }
- match: { hits.hits.3.sort: [ 922337203685477779 ] }
- match: { hits.hits.3.sort.0: 922337203685477779 }
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ setup:
- length: {hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.0.sort: [ 13835058055282163722 ] }
- match: { hits.hits.0.sort.0: 13835058055282163722 }
- match: { hits.hits.1._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.1.sort: [ 13835058055282163721 ] }
- match: { hits.hits.1.sort.0: 13835058055282163721 }
- match: { hits.hits.2._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.2.sort: [ 13835058055282163719 ] }
- match: { hits.hits.2.sort.0: 13835058055282163719 }
- match: { hits.hits.3._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.3.sort: [ 13835058055282163716 ] }
- match: { hits.hits.3.sort.0: 13835058055282163716 }
- match: { hits.hits.4._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.4.sort: [ 13835058055282163714 ] }
- match: { hits.hits.4.sort.0: 13835058055282163714 }
- match: { hits.hits.5._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.5.sort: [ 13835058055282163712 ] }
- match: { hits.hits.5.sort.0: 13835058055282163712 }

- do:
search:
Expand All @@ -66,17 +66,17 @@ setup:
- length: {hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.0.sort: [ 13835058055282163712 ] }
- match: { hits.hits.0.sort.0: 13835058055282163712 }
- match: { hits.hits.1._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.1.sort: [ 13835058055282163714 ] }
- match: { hits.hits.1.sort.0: 13835058055282163714 }
- match: { hits.hits.2._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.2.sort: [ 13835058055282163716 ] }
- match: { hits.hits.2.sort.0: 13835058055282163716 }
- match: { hits.hits.3._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.3.sort: [ 13835058055282163719 ] }
- match: { hits.hits.3.sort.0: 13835058055282163719 }
- match: { hits.hits.4._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.4.sort: [ 13835058055282163721 ] }
- match: { hits.hits.4.sort.0: 13835058055282163721 }
- match: { hits.hits.5._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.5.sort: [ 13835058055282163722 ] }
- match: { hits.hits.5.sort.0: 13835058055282163722 }

- do:
search:
Expand All @@ -88,17 +88,17 @@ setup:
- length: { hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.0.sort: [ 7 ] }
- match: { hits.hits.0.sort.0: 7 }
- match: { hits.hits.1._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.1.sort: [ 4611686018427387906 ] }
- match: { hits.hits.1.sort.0: 4611686018427387906 }
- match: { hits.hits.2._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.2.sort: [ 6917529027641081857 ] }
- match: { hits.hits.2.sort.0: 6917529027641081857 }
- match: { hits.hits.3._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.3.sort: [ 6917529027641081862 ] }
- match: { hits.hits.3.sort.0: 6917529027641081862 }
- match: { hits.hits.4._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.4.sort: [ 13835058055282163715 ] }
- match: { hits.hits.4.sort.0: 13835058055282163715 }
- match: { hits.hits.5._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.5.sort: [ 13835058055282163718 ] }
- match: { hits.hits.5.sort.0: 13835058055282163718 }

- do:
search:
Expand All @@ -110,17 +110,17 @@ setup:
- length: { hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.0.sort: [ 13835058055282163740 ] }
- match: { hits.hits.0.sort.0: 13835058055282163740 }
- match: { hits.hits.1._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.1.sort: [ 13835058055282163713 ] }
- match: { hits.hits.1.sort.0: 13835058055282163713 }
- match: { hits.hits.2._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.2.sort: [ 9223372036854775832 ] }
- match: { hits.hits.2.sort.0: 9223372036854775832 }
- match: { hits.hits.3._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.3.sort: [ 9223372036854775817 ] }
- match: { hits.hits.3.sort.0: 9223372036854775817 }
- match: { hits.hits.4._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.4.sort: [ 9223372036854775811 ] }
- match: { hits.hits.4.sort.0: 9223372036854775811 }
- match: { hits.hits.5._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.5.sort: [ 4611686018427387922 ] }
- match: { hits.hits.5.sort.0: 4611686018427387922 }

- do:
search:
Expand All @@ -132,17 +132,17 @@ setup:
- length: { hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.0.sort: [ 6917529027641081857 ] }
- match: { hits.hits.0.sort.0: 6917529027641081857 }
- match: { hits.hits.1._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.1.sort: [ 4611686018427387906 ] }
- match: { hits.hits.1.sort.0: 4611686018427387906 }
- match: { hits.hits.2._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.2.sort: [ 3458764513820540935 ] }
- match: { hits.hits.2.sort.0: 3458764513820540935 }
- match: { hits.hits.3._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.3.sort: [ 3074457345618258606 ] }
- match: { hits.hits.3.sort.0: 3074457345618258606 }
- match: { hits.hits.4._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.4.sort: [ 2305843009213693958 ] }
- match: { hits.hits.4.sort.0: 2305843009213693958 }
- match: { hits.hits.5._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.5.sort: [ 1537228672809129307 ] }
- match: { hits.hits.5.sort.0: 1537228672809129307 }

- do:
search:
Expand All @@ -154,14 +154,14 @@ setup:
- length: { hits.hits: 6 }
- match: { hits.hits.0._index: unsigned_long_sort }
- match: { hits.hits.0._source.field: [ 13835058055282163712, 1 ] }
- match: { hits.hits.0.sort: [ 1 ] }
- match: { hits.hits.0.sort.0: 1 }
- match: { hits.hits.1._source.field: [ 13835058055282163715, 13835058055282163716, 2 ] }
- match: { hits.hits.1.sort: [ 2 ] }
- match: { hits.hits.1.sort.0: 2 }
- match: { hits.hits.2._source.field: [ 13835058055282163720, 13835058055282163721, 3, 4 ] }
- match: { hits.hits.2.sort: [ 3 ] }
- match: { hits.hits.2.sort.0: 3 }
- match: { hits.hits.3._source.field: [ 13835058055282163722, 5, 6, 7 ] }
- match: { hits.hits.3.sort: [ 5 ] }
- match: { hits.hits.3.sort.0: 5 }
- match: { hits.hits.4._source.field: [ 13835058055282163713, 13835058055282163714 ] }
- match: { hits.hits.4.sort: [ 13835058055282163713 ] }
- match: { hits.hits.4.sort.0: 13835058055282163713 }
- match: { hits.hits.5._source.field: [ 13835058055282163717, 13835058055282163718, 13835058055282163719 ] }
- match: { hits.hits.5.sort: [ 13835058055282163717 ] }
- match: { hits.hits.5.sort.0: 13835058055282163717 }
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.opensearch.test.hamcrest.RegexMatcher;

import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Pattern;

import static org.hamcrest.Matchers.equalTo;
Expand Down Expand Up @@ -111,28 +110,6 @@ protected void doAssert(Object actualValue, Object expectedValue) {
}

if (expectedValue.equals(actualValue) == false) {
if (expectedValue instanceof ArrayList && actualValue instanceof ArrayList) {
ArrayList<?> expectedList = (ArrayList<?>) expectedValue;
ArrayList<?> actualList = (ArrayList<?>) actualValue;
if (expectedList.size() == actualList.size()) {
boolean pass = true;
for (int i = 0; i < expectedList.size(); i++) {
// BigInteger 1 is equal to Integer 1
Object expected = expectedList.get(i);
Object actual = actualList.get(i);
if (expected instanceof Number == false
|| actual instanceof Number == false
|| ((Number) expected).longValue() != ((Number) actual).longValue()) {
pass = false;
break;
}
}
if (pass) {
return;
}
}
}

NotEqualMessageBuilder message = new NotEqualMessageBuilder();
message.compare(getField(), true, actualValue, expectedValue);
throw new AssertionError(getField() + " didn't match expected value:\n" + message);
Expand Down

0 comments on commit 92843d0

Please sign in to comment.