diff --git a/src/main/java/rife/config/RifeConfig.java b/src/main/java/rife/config/RifeConfig.java index 69aeb3f..808d156 100644 --- a/src/main/java/rife/config/RifeConfig.java +++ b/src/main/java/rife/config/RifeConfig.java @@ -1076,7 +1076,7 @@ public class ToolsConfig { private String defaultResourceBundle_ = DEFAULT_RESOURCE_BUNDLE; private String defaultLanguage_ = DEFAULT_DEFAULT_LANGUAGE; private String defaultCountry_ = DEFAULT_DEFAULT_COUNTRY; - private TimeZone defaultTimeZone_ = DEFAULT_DEFAULT_TIMEZONE; + private TimeZone defaultTimeZone_ = null; private String defaultShortDateFormat_; private String defaultInputDateFormat_ = DEFAULT_INPUT_DATE_FORMAT; private String defaultInputTimeFormat_ = DEFAULT_INPUT_TIME_FORMAT; @@ -1087,7 +1087,6 @@ public class ToolsConfig { public static final String DEFAULT_RESOURCE_BUNDLE = null; public static final String DEFAULT_DEFAULT_LANGUAGE = "en"; public static final String DEFAULT_DEFAULT_COUNTRY = null; - public static final TimeZone DEFAULT_DEFAULT_TIMEZONE = TimeZone.getTimeZone("EST"); public static final String DEFAULT_INPUT_DATE_FORMAT = "yyyy-MM-dd HH:mm"; public static final String DEFAULT_INPUT_TIME_FORMAT = "HH:mm"; public static final int DEFAULT_MAX_VISUAL_URL_LENGTH = 70; diff --git a/src/test/java/rife/template/TestTemplate.java b/src/test/java/rife/template/TestTemplate.java index e3acfe8..be5d7ba 100644 --- a/src/test/java/rife/template/TestTemplate.java +++ b/src/test/java/rife/template/TestTemplate.java @@ -4,7 +4,10 @@ */ package rife.template; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import rife.config.RifeConfig; import rife.template.exceptions.BlockUnknownException; import rife.template.exceptions.TemplateException; import rife.template.exceptions.ValueUnknownException; @@ -18,6 +21,16 @@ import static org.junit.jupiter.api.Assertions.*; public class TestTemplate { + @BeforeEach + public void setup() { + RifeConfig.tools().setDefaultTimeZone(TimeZone.getTimeZone("EST")); + } + + @AfterEach + public void tearDown() { + RifeConfig.tools().setDefaultTimeZone(null); + } + @Test void testInstantiation() { var template = TemplateFactory.HTML.get("empty"); diff --git a/src/test/java/rife/tools/TestArrayUtils.java b/src/test/java/rife/tools/TestArrayUtils.java index 6c1e783..9177912 100644 --- a/src/test/java/rife/tools/TestArrayUtils.java +++ b/src/test/java/rife/tools/TestArrayUtils.java @@ -4,6 +4,8 @@ */ package rife.tools; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import rife.config.RifeConfig; import rife.validation.ConstrainedProperty; @@ -13,10 +15,21 @@ import java.util.Calendar; import java.util.Date; import java.util.Locale; +import java.util.TimeZone; import static org.junit.jupiter.api.Assertions.*; public class TestArrayUtils { + @BeforeEach + public void setup() { + RifeConfig.tools().setDefaultTimeZone(TimeZone.getTimeZone("EST")); + } + + @AfterEach + public void tearDown() { + RifeConfig.tools().setDefaultTimeZone(null); + } + @Test void testGetArrayType() { assertEquals(ArrayUtils.ArrayType.NO_ARRAY, ArrayUtils.getArrayType(new Object())); diff --git a/src/test/java/rife/tools/TestBeanUtils.java b/src/test/java/rife/tools/TestBeanUtils.java index 8c06c73..09b151b 100644 --- a/src/test/java/rife/tools/TestBeanUtils.java +++ b/src/test/java/rife/tools/TestBeanUtils.java @@ -4,6 +4,8 @@ */ package rife.tools; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import rife.config.RifeConfig; import rife.tools.exceptions.BeanUtilsException; @@ -19,6 +21,16 @@ import static org.junit.jupiter.api.Assertions.*; public class TestBeanUtils { + @BeforeEach + public void setup() { + RifeConfig.tools().setDefaultTimeZone(TimeZone.getTimeZone("EST")); + } + + @AfterEach + public void tearDown() { + RifeConfig.tools().setDefaultTimeZone(null); + } + private BeanImpl getPopulatedBean() { BeanImpl bean = new BeanImpl(); var cal = RifeConfig.tools().getCalendarInstance(2002, Calendar.DECEMBER, 26, 22, 52, 31, 153); diff --git a/src/test/java/rife/tools/TestConvert.java b/src/test/java/rife/tools/TestConvert.java index 4981ad5..f22e44c 100644 --- a/src/test/java/rife/tools/TestConvert.java +++ b/src/test/java/rife/tools/TestConvert.java @@ -4,6 +4,8 @@ */ package rife.tools; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import rife.config.RifeConfig; import rife.tools.exceptions.ConversionException; @@ -17,6 +19,16 @@ import static org.junit.jupiter.api.Assertions.*; public class TestConvert { + @BeforeEach + public void setup() { + RifeConfig.tools().setDefaultTimeZone(TimeZone.getTimeZone("EST")); + } + + @AfterEach + public void tearDown() { + RifeConfig.tools().setDefaultTimeZone(null); + } + @Test void testToType() throws ConversionException {