metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject metron git commit: METRON-1864 Stellar date format test fails after daylight saving (ottobackwards) closes apache/metron#1258
Date Thu, 08 Nov 2018 19:12:15 GMT
Repository: metron
Updated Branches:
  refs/heads/master 7bba8be0c -> c6b1b3ccd


METRON-1864 Stellar date format test fails after daylight saving (ottobackwards) closes apache/metron#1258


Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/c6b1b3cc
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/c6b1b3cc
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/c6b1b3cc

Branch: refs/heads/master
Commit: c6b1b3ccd7f937342c5723ca0a952a4900efc5cf
Parents: 7bba8be
Author: ottobackwards <ottobackwards@gmail.com>
Authored: Thu Nov 8 13:51:38 2018 -0500
Committer: otto <otto@apache.org>
Committed: Thu Nov 8 13:51:38 2018 -0500

----------------------------------------------------------------------
 .../metron/stellar/dsl/functions/DateFunctionsTest.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/c6b1b3cc/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
----------------------------------------------------------------------
diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
index 959e7ea..48b2995 100644
--- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
+++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/DateFunctionsTest.java
@@ -28,6 +28,8 @@ import org.apache.metron.stellar.dsl.StellarFunctions;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Map;
@@ -233,10 +235,16 @@ public class DateFunctionsTest {
     assertEquals("Thu Aug 25 2016 08:27:10 EST", result);
   }
 
+  /**
+   * Test that the String returned is formatted as specified.
+   * LocalDate.parse will throw if it is not.
+   * @throws Exception
+   */
   @Test
-  public void testDateFormatDefault() {
+  public void testDateFormatDefault() throws Exception {
     Object result = run("DATE_FORMAT('EEE MMM dd yyyy hh:mm:ss zzzz')");
-    assertTrue(result.toString().endsWith(TimeZone.getDefault().getDisplayName(true, 1)));
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE MMM dd yyyy hh:mm:ss zzzz");
+    LocalDate.parse(result.toString(), formatter);
   }
 
   @Test


Mime
View raw message