-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Java.time] Calculate week of a year with ISO rules #48209
Changes from all commits
8c90164
8696ec7
dc0c953
352344b
8ca12f0
2eb27f5
88dc041
ac5b55b
b7ae80c
207a8ea
963e3f1
acc28fc
ac60ba3
45fe6f7
4cf85c1
c003a41
7dc8c07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.elasticsearch.common.time.IsoCalendarDataProvider |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,23 +17,11 @@ | |
/** | ||
* Due to changes in JDK9 where locale data is used from CLDR, the licence message will differ in jdk 8 and jdk9+ | ||
* https://openjdk.java.net/jeps/252 | ||
* We run ES with -Djava.locale.providers=SPI,COMPAT and same option has to be applied when running this test from IDE | ||
*/ | ||
public class LicenseServiceTests extends ESTestCase { | ||
|
||
public void testLogExpirationWarningOnJdk9AndNewer() { | ||
assumeTrue("this is for JDK9+", JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0); | ||
|
||
long time = LocalDate.of(2018, 11, 15).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli(); | ||
final boolean expired = randomBoolean(); | ||
final String message = LicenseService.buildExpirationMessage(time, expired).toString(); | ||
if (expired) { | ||
assertThat(message, startsWith("LICENSE [EXPIRED] ON [THU, NOV 15, 2018].\n")); | ||
} else { | ||
assertThat(message, startsWith("License [will expire] on [Thu, Nov 15, 2018].\n")); | ||
} | ||
} | ||
|
||
public void testLogExpirationWarningOnJdk8() { | ||
public void testLogExpirationWarning() { | ||
assumeTrue("this is for JDK8 only", JavaVersion.current().equals(JavaVersion.parse("8"))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pgomulka I think this part of the change might have been incorrect... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tvernum you are right, the same applies to 7.x branch as the output should be the same. |
||
|
||
long time = LocalDate.of(2018, 11, 15).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli(); | ||
|
@@ -45,5 +33,4 @@ public void testLogExpirationWarningOnJdk8() { | |
assertThat(message, startsWith("License [will expire] on [Thursday, November 15, 2018].\n")); | ||
} | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment that this won't be needed once we include jvm.options in tests sysprops?