You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2019/08/12 11:05:29 UTC
[wicket] branch master updated: Use UCT for Java 12- and UTC for
Java 13+ in ZonedDateTimeConverterTest
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new 810ac70 Use UCT for Java 12- and UTC for Java 13+ in ZonedDateTimeConverterTest
810ac70 is described below
commit 810ac70d77e0816ac44eae8d8a38113c25d7e982
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Aug 12 14:04:24 2019 +0300
Use UCT for Java 12- and UTC for Java 13+ in ZonedDateTimeConverterTest
---
.../converter/ZonedDateTimeConverterTest.java | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/wicket-util/src/test/java/org/apache/wicket/util/convert/converter/ZonedDateTimeConverterTest.java b/wicket-util/src/test/java/org/apache/wicket/util/convert/converter/ZonedDateTimeConverterTest.java
index 0761b85..771175c 100644
--- a/wicket-util/src/test/java/org/apache/wicket/util/convert/converter/ZonedDateTimeConverterTest.java
+++ b/wicket-util/src/test/java/org/apache/wicket/util/convert/converter/ZonedDateTimeConverterTest.java
@@ -18,6 +18,8 @@ package org.apache.wicket.util.convert.converter;
import org.apache.wicket.util.convert.ConversionException;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledOnJre;
+import org.junit.jupiter.api.condition.JRE;
import java.time.ZoneId;
import java.time.ZonedDateTime;
@@ -30,22 +32,32 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
public class ZonedDateTimeConverterTest
{
- private ZoneId zone = ZoneId.of("Etc/UCT");
+ private final ZoneId zoneUCT = ZoneId.of("Etc/UCT");
+ private final ZoneId zoneUTC = ZoneId.of("Etc/UTC");
@Test
public void convertToString() {
ZonedDateTimeConverter converter = new ZonedDateTimeConverter();
- String date = converter.convertToString(ZonedDateTime.of(2016, 7, 11, 1, 2, 3, 0, zone), Locale.ENGLISH);
+ String date = converter.convertToString(ZonedDateTime.of(2016, 7, 11, 1, 2, 3, 0, zoneUCT), Locale.ENGLISH);
assertEquals(date, "Jul 11, 2016, 1:02:03 AM Coordinated Universal Time");
}
+ @EnabledOnJre({JRE.JAVA_11, JRE.JAVA_12})
@Test
- public void convertToObject() {
+ public void convertToObject_java12Minus() {
ZonedDateTimeConverter converter = new ZonedDateTimeConverter();
ZonedDateTime date = converter.convertToObject("Jul 11, 2016, 1:02:03 AM Coordinated Universal Time", Locale.ENGLISH);
- assertEquals(date, ZonedDateTime.of(2016, 7, 11, 1, 2, 3, 0, zone));
+ assertEquals(ZonedDateTime.of(2016, 7, 11, 1, 2, 3, 0, zoneUCT), date);
}
-
+
+ @EnabledOnJre({JRE.JAVA_13})
+ @Test
+ public void convertToObject_java13Plus() {
+ ZonedDateTimeConverter converter = new ZonedDateTimeConverter();
+ ZonedDateTime date = converter.convertToObject("Jul 11, 2016, 1:02:03 AM Coordinated Universal Time", Locale.ENGLISH);
+ assertEquals(ZonedDateTime.of(2016, 7, 11, 1, 2, 3, 0, zoneUTC), date);
+ }
+
@Test
public void convertFails() {
ZonedDateTimeConverter converter = new ZonedDateTimeConverter();