Skip to content

Commit 80fc530

Browse files
authored
Update tests to account for CLDR and JDK 23 (#113931)
Backport a fix from #110222
1 parent 5e66beb commit 80fc530

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/src/test/java/org/elasticsearch/common/joda/JavaJodaTimeDuellingTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ protected boolean enableWarningsCheck() {
4242
@BeforeClass
4343
public static void checkJvmProperties() {
4444
boolean runtimeJdk8 = JavaVersion.current().getVersion().get(0) == 8;
45-
assert (runtimeJdk8 && ("SPI,JRE".equals(System.getProperty("java.locale.providers"))))
46-
|| (false == runtimeJdk8 && ("SPI,COMPAT".equals(System.getProperty("java.locale.providers"))))
45+
assert (runtimeJdk8 && (System.getProperty("java.locale.providers", "").equals("SPI,JRE")))
46+
|| (false == runtimeJdk8 && (System.getProperty("java.locale.providers", "").contains("SPI")))
4747
: "`-Djava.locale.providers` needs to be set";
4848
assumeFalse(
4949
"won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs",

server/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ public void testChangeLocale() throws IOException {
188188
assumeTrue("need java 9 for testing ", JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0);
189189

190190
DocumentMapper mapper = createDocumentMapper(
191-
fieldMapping(b -> b.field("type", "date").field("format", "E, d MMM yyyy HH:mm:ss Z").field("locale", "de"))
191+
fieldMapping(b -> b.field("type", "date").field("format", "E, d MMM yyyy HH:mm:ss Z").field("locale", "fr"))
192192
);
193193

194-
mapper.parse(source(b -> b.field("field", "Mi, 06 Dez 2000 02:55:00 -0800")));
194+
mapper.parse(source(b -> b.field("field", "mer., 6 déc. 2000 02:55:00 -0800")));
195195
}
196196

197197
public void testNullValue() throws IOException {

0 commit comments

Comments
 (0)