You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/08/08 00:13:11 UTC

incubator-freemarker git commit: Trying to fix test failing in Travis environment

Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 1785ef025 -> 89d436965


Trying to fix test failing in Travis environment


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/89d43696
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/89d43696
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/89d43696

Branch: refs/heads/3
Commit: 89d4369658ae4e45fd88104f26cdbe4676970337
Parents: 1785ef0
Author: ddekany <dd...@apache.org>
Authored: Tue Aug 8 02:13:05 2017 +0200
Committer: ddekany <dd...@apache.org>
Committed: Tue Aug 8 02:13:05 2017 +0200

----------------------------------------------------------------------
 .../freemarker/core/TemplateConfigurationTest.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/89d43696/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateConfigurationTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateConfigurationTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateConfigurationTest.java
index bd1405c..6d16893 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateConfigurationTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateConfigurationTest.java
@@ -139,6 +139,20 @@ public class TemplateConfigurationTest {
         NON_DEFAULT_TZ = tz;
     }
 
+
+    private static final TimeZone NON_DEFAULT_SQL_TZ;
+    static {
+        TimeZone defaultTZ = DEFAULT_CFG.getSQLDateAndTimeTimeZone();
+        TimeZone tz = TimeZone.getTimeZone("UTC");
+        if (tz.equals(defaultTZ)) {
+            tz = TimeZone.getTimeZone("GMT+01");
+            if (tz.equals(defaultTZ)) {
+                throw new AssertionError("Couldn't chose a non-default SQL time zone");
+            }
+        }
+        NON_DEFAULT_SQL_TZ = tz;
+    }
+
     private static final Locale NON_DEFAULT_LOCALE =
             DEFAULT_CFG.getLocale().equals(Locale.US) ? Locale.GERMAN : Locale.US;
 
@@ -153,7 +167,7 @@ public class TemplateConfigurationTest {
 
         // "MutableProcessingConfiguration" settings:
         SETTING_ASSIGNMENTS.put("APIBuiltinEnabled", true);
-        SETTING_ASSIGNMENTS.put("SQLDateAndTimeTimeZone", NON_DEFAULT_TZ);
+        SETTING_ASSIGNMENTS.put("SQLDateAndTimeTimeZone", NON_DEFAULT_SQL_TZ);
         SETTING_ASSIGNMENTS.put("URLEscapingCharset", StandardCharsets.UTF_16);
         SETTING_ASSIGNMENTS.put("autoFlush", false);
         SETTING_ASSIGNMENTS.put("booleanFormat", "J,N");