@@ -1914,8 +1914,14 @@ public void testRangeQueryWithTimeZone() throws Exception {
1914
1914
* Test range with a custom locale, e.g. "de" in this case. Documents here mention the day of week
1915
1915
* as "Mi" for "Mittwoch (Wednesday" and "Do" for "Donnerstag (Thursday)" and the month in the query
1916
1916
* as "Dez" for "Dezember (December)".
1917
+ * Note: this test currently needs the JVM arg `-Djava.locale.providers=SPI,COMPAT` to be set.
1918
+ * When running with gradle this is done implicitly through the BuildPlugin, but when running from
1919
+ * an IDE this might need to be set manually in the run configuration. See also CONTRIBUTING.md section
1920
+ * on "Configuring IDEs And Running Tests".
1917
1921
*/
1918
1922
public void testRangeQueryWithLocaleMapping () throws Exception {
1923
+ assert ("SPI,COMPAT" .equals (System .getProperty ("java.locale.providers" ))) : "`-Djava.locale.providers=SPI,COMPAT` needs to be set" ;
1924
+
1919
1925
assertAcked (
1920
1926
prepareCreate ("test" ).setMapping (
1921
1927
jsonBuilder ().startObject ()
@@ -1932,21 +1938,17 @@ public void testRangeQueryWithLocaleMapping() throws Exception {
1932
1938
1933
1939
indexRandom (
1934
1940
true ,
1935
- client ().prepareIndex ("test" ).setId ("1" ).setSource ("date_field" , "Mi. , 06 Dez. 2000 02:55:00 -0800" ),
1936
- client ().prepareIndex ("test" ).setId ("2" ).setSource ("date_field" , "Do. , 07 Dez. 2000 02:55:00 -0800" )
1941
+ client ().prepareIndex ("test" ).setId ("1" ).setSource ("date_field" , "Mi, 06 Dez 2000 02:55:00 -0800" ),
1942
+ client ().prepareIndex ("test" ).setId ("2" ).setSource ("date_field" , "Do, 07 Dez 2000 02:55:00 -0800" )
1937
1943
);
1938
1944
1939
1945
SearchResponse searchResponse = client ().prepareSearch ("test" )
1940
- .setQuery (
1941
- QueryBuilders .rangeQuery ("date_field" ).gte ("Di., 05 Dez. 2000 02:55:00 -0800" ).lte ("Do., 07 Dez. 2000 00:00:00 -0800" )
1942
- )
1946
+ .setQuery (QueryBuilders .rangeQuery ("date_field" ).gte ("Di, 05 Dez 2000 02:55:00 -0800" ).lte ("Do, 07 Dez 2000 00:00:00 -0800" ))
1943
1947
.get ();
1944
1948
assertHitCount (searchResponse , 1L );
1945
1949
1946
1950
searchResponse = client ().prepareSearch ("test" )
1947
- .setQuery (
1948
- QueryBuilders .rangeQuery ("date_field" ).gte ("Di., 05 Dez. 2000 02:55:00 -0800" ).lte ("Fr., 08 Dez. 2000 00:00:00 -0800" )
1949
- )
1951
+ .setQuery (QueryBuilders .rangeQuery ("date_field" ).gte ("Di, 05 Dez 2000 02:55:00 -0800" ).lte ("Fr, 08 Dez 2000 00:00:00 -0800" ))
1950
1952
.get ();
1951
1953
assertHitCount (searchResponse , 2L );
1952
1954
}
0 commit comments