freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [15/17] incubator-freemarker git commit: Renamed XxxUtil classes to XxxUtils, as this convention is more widespread nowadays.
Date Tue, 08 Aug 2017 17:57:05 GMT
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java
index e9084c9..495a72e 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java
@@ -38,8 +38,8 @@ import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.impl.RationalNumber;
-import org.apache.freemarker.core.util._StringUtil;
-import org.apache.freemarker.test.TestUtil;
+import org.apache.freemarker.core.util._StringUtils;
+import org.apache.freemarker.test.TestUtils;
 
 public class OverloadedMethods2 {
 
@@ -321,80 +321,80 @@ public class OverloadedMethods2 {
     }
 
     public String varargs1(String s, int... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs1(String s = " + _StringUtils.jQuote(s) + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs1(String s, double... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", double... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs1(String s = " + _StringUtils.jQuote(s) + ", double... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs1(String s, Object... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs1(String s = " + _StringUtils.jQuote(s) + ", Object... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs1(Object s, Object... xs) {
-        return "varargs1(Object s = " + s + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs1(Object s = " + s + ", Object... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs2(int... xs) {
-        return "varargs2(int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs2(int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs2(double... xs) {
-        return "varargs2(double... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs2(double... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs3(String... xs) {
-        return "varargs3(String... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs3(String... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs3(Comparable... xs) {
-        return "varargs3(Comparable... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs3(Comparable... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs3(Object... xs) {
-        return "varargs3(Object... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs3(Object... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs4(Integer... xs) {
-        return "varargs4(Integer... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs4(Integer... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs4(int... xs) {
-        return "varargs4(int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs4(int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs5(int... xs) {
-        return "varargs5(int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs5(int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs5(int a1, int... xs) {
-        return "varargs5(int a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs5(int a1 = " + a1 + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs5(int a1, int a2, int... xs) {
-        return "varargs5(int a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs5(int a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs5(int a1, int a2, int a3, int... xs) {
         return "varargs5(int a1 = " + a1 + ", int a2 = " + a2 + ", int a3 = " + a3
-                + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+                + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
 
     public String varargs6(String a1, int... xs) {
-        return "varargs6(String a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs6(String a1 = " + a1 + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs6(Object a1, int a2, int... xs) {
-        return "varargs6(Object a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs6(Object a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs7(int... xs) {
-        return "varargs7(int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs7(int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String varargs7(short a1, int... xs) {
-        return "varargs7(short a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+        return "varargs7(short a1 = " + a1 + ", int... xs = " + TestUtils.arrayToString(xs) + ")";
     }
     
     public String mNullAmbiguous(String s) {
@@ -430,11 +430,11 @@ public class OverloadedMethods2 {
     }
     
     public String mVarargsIgnoredTail(int i, double... ds) {
-        return "mVarargsIgnoredTail(int i = " + i + ", double... ds = " + TestUtil.arrayToString(ds) + ")";
+        return "mVarargsIgnoredTail(int i = " + i + ", double... ds = " + TestUtils.arrayToString(ds) + ")";
     }
     
     public String mVarargsIgnoredTail(int... is) {
-        return "mVarargsIgnoredTail(int... is = " + TestUtil.arrayToString(is) + ")";
+        return "mVarargsIgnoredTail(int... is = " + TestUtils.arrayToString(is) + ")";
     }
     
     public String mLowRankWins(int x, int y, Object o) {
@@ -473,19 +473,19 @@ public class OverloadedMethods2 {
     }
 
     public String mSeqToArrayNonOverloaded(String[] items, String s) {
-        return "mSeqToArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+        return "mSeqToArrayNonOverloaded(String[] " + TestUtils.arrayToString(items) + ", String " + s + ")";
     }
     
     public String mSeqToArrayGoodHint(String[] items, String s) {
-        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+        return "mSeqToArrayGoodHint(String[] " + TestUtils.arrayToString(items) + ", String " + s + ")";
     }
 
     public String mSeqToArrayGoodHint(String[] items, int i) {
-        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+        return "mSeqToArrayGoodHint(String[] " + TestUtils.arrayToString(items) + ", int " + i + ")";
     }
 
     public String mSeqToArrayGoodHint2(String[] items, String s) {
-        return "mSeqToArrayGoodHint2(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+        return "mSeqToArrayGoodHint2(String[] " + TestUtils.arrayToString(items) + ", String " + s + ")";
     }
 
     public String mSeqToArrayGoodHint2(String item) {
@@ -493,7 +493,7 @@ public class OverloadedMethods2 {
     }
     
     public String mSeqToArrayPoorHint(String[] items, String s) {
-        return "mSeqToArrayPoorHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+        return "mSeqToArrayPoorHint(String[] " + TestUtils.arrayToString(items) + ", String " + s + ")";
     }
 
     public String mSeqToArrayPoorHint(String item, int i) {
@@ -501,7 +501,7 @@ public class OverloadedMethods2 {
     }
 
     public String mSeqToArrayPoorHint2(String[] items) {
-        return "mSeqToArrayPoorHint2(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mSeqToArrayPoorHint2(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mSeqToArrayPoorHint2(String item) {
@@ -509,43 +509,43 @@ public class OverloadedMethods2 {
     }
     
     public String mSeqToArrayPoorHint3(String[] items) {
-        return "mSeqToArrayPoorHint3(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mSeqToArrayPoorHint3(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mSeqToArrayPoorHint3(int[] items) {
-        return "mSeqToArrayPoorHint3(int[] " + TestUtil.arrayToString(items) + ")";
+        return "mSeqToArrayPoorHint3(int[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVsListPreference(String[] items) {
-        return "mStringArrayVsListPreference(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVsListPreference(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVsListPreference(List items) {
-        return "mStringArrayVsListPreference(List " + TestUtil.listToString(items) + ")";
+        return "mStringArrayVsListPreference(List " + TestUtils.listToString(items) + ")";
     }
 
     public String mStringArrayVsObjectArrayPreference(String[] items) {
-        return "mStringArrayVsObjectArrayPreference(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVsObjectArrayPreference(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVsObjectArrayPreference(Object[] items) {
-        return "mStringArrayVsObjectArrayPreference(Object[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVsObjectArrayPreference(Object[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mIntArrayVsIntegerArrayPreference(int[] items) {
-        return "mIntArrayVsIntegerArrayPreference(int[] " + TestUtil.arrayToString(items) + ")";
+        return "mIntArrayVsIntegerArrayPreference(int[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mIntArrayVsIntegerArrayPreference(Integer[] items) {
-        return "mIntArrayVsIntegerArrayPreference(Integer[] " + TestUtil.arrayToString(items) + ")";
+        return "mIntArrayVsIntegerArrayPreference(Integer[] " + TestUtils.arrayToString(items) + ")";
     }
     
     public String mIntArrayNonOverloaded(int[] items) {
-        return "mIntArrayNonOverloaded(int[] " + TestUtil.arrayToString(items) + ")";
+        return "mIntArrayNonOverloaded(int[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mIntegerArrayNonOverloaded(Integer[] items) {
-        return "mIntegerArrayNonOverloaded(Integer[] " + TestUtil.arrayToString(items) + ")";
+        return "mIntegerArrayNonOverloaded(Integer[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mIntegerListNonOverloaded(List<Integer> items) {
@@ -557,7 +557,7 @@ public class OverloadedMethods2 {
     }
 
     public String mStringArrayNonOverloaded(String[] items) {
-        return "mStringArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayNonOverloaded(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mObjectListNonOverloaded(List<Object> items) {
@@ -565,11 +565,11 @@ public class OverloadedMethods2 {
     }
 
     public String mObjectArrayNonOverloaded(Object[] items) {
-        return "mObjectArrayNonOverloaded(Object[] " + TestUtil.arrayToString(items) + ")";
+        return "mObjectArrayNonOverloaded(Object[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mIntegerArrayOverloaded(Integer[] items, int i) {
-        return "mIntegerArrayOverloaded(Integer[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+        return "mIntegerArrayOverloaded(Integer[] " + TestUtils.arrayToString(items) + ", int " + i + ")";
     }
 
     public String mIntegerArrayOverloaded(Object obj, boolean b) {
@@ -577,7 +577,7 @@ public class OverloadedMethods2 {
     }
 
     public String mStringArrayOverloaded(String[] items, int i) {
-        return "mStringArrayOverloaded(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+        return "mStringArrayOverloaded(String[] " + TestUtils.arrayToString(items) + ", int " + i + ")";
     }
 
     public String mStringArrayOverloaded(Object obj, boolean b) {
@@ -585,11 +585,11 @@ public class OverloadedMethods2 {
     }
 
     public String mCharArrayOverloaded(char[] items, int i) {
-        return "mCharArrayOverloaded(char[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+        return "mCharArrayOverloaded(char[] " + TestUtils.arrayToString(items) + ", int " + i + ")";
     }
 
     public String mCharArrayOverloaded(Character[] items, String s) {
-        return "mCharArrayOverloaded(Character[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+        return "mCharArrayOverloaded(Character[] " + TestUtils.arrayToString(items) + ", String " + s + ")";
     }
     
     public String mCharArrayOverloaded(Object obj, boolean b) {
@@ -597,7 +597,7 @@ public class OverloadedMethods2 {
     }
 
     public String mStringArrayArrayOverloaded(String[][] arrayArray, int i) {
-        return "mStringArrayArrayOverloaded(String[][] " + TestUtil.arrayToString(arrayArray) + ", int " + i + ")";
+        return "mStringArrayArrayOverloaded(String[][] " + TestUtils.arrayToString(arrayArray) + ", int " + i + ")";
     }
     
     public String mStringArrayArrayOverloaded(Object obj, boolean b) {
@@ -605,7 +605,7 @@ public class OverloadedMethods2 {
     }
     
     public String mIntArrayArrayOverloaded(int[][] xss) {
-        return "mIntArrayArrayOverloaded(" + TestUtil.arrayToString(xss) + ")";
+        return "mIntArrayArrayOverloaded(" + TestUtils.arrayToString(xss) + ")";
     }
 
     public String mIntArrayArrayOverloaded(String s) {
@@ -613,7 +613,7 @@ public class OverloadedMethods2 {
     }
     
     public String mArrayOfListsOverloaded(List[] xss) {
-        return "mArrayOfListsOverloaded(" + TestUtil.arrayToString(xss) + ")";
+        return "mArrayOfListsOverloaded(" + TestUtils.arrayToString(xss) + ")";
     }
 
     public String mArrayOfListsOverloaded(String x) {
@@ -621,31 +621,31 @@ public class OverloadedMethods2 {
     }
     
     public String mIntArrayArrayNonOverloaded(int[][] xss) {
-        return "mIntArrayArrayNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
+        return "mIntArrayArrayNonOverloaded(" + TestUtils.arrayToString(xss) + ")";
     }
 
     public String mArrayOfListsNonOverloaded(List[] xss) {
-        return "mArrayOfListsNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
+        return "mArrayOfListsNonOverloaded(" + TestUtils.arrayToString(xss) + ")";
     }
     
     public String mStringArrayVarargsNonOverloaded(String... items) {
-        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded(String... items) {
-        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded1(String... items) {
-        return "mStringArrayVarargsOverloaded1(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsOverloaded1(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded1(List<String> items) {
-        return "mStringArrayVarargsOverloaded1(List " + TestUtil.listToString(items) + ")";
+        return "mStringArrayVarargsOverloaded1(List " + TestUtils.listToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded2(String... items) {
-        return "mStringArrayVarargsOverloaded2(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsOverloaded2(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded2(String item) {
@@ -653,7 +653,7 @@ public class OverloadedMethods2 {
     }
     
     public String mStringArrayVarargsOverloaded3(String... items) {
-        return "mStringArrayVarargsOverloaded3(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsOverloaded3(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded3(String item1, String item2) {
@@ -661,15 +661,15 @@ public class OverloadedMethods2 {
     }
     
     public String mStringArrayVarargsOverloaded4(String... items) {
-        return "mStringArrayVarargsOverloaded4(String[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsOverloaded4(String[] " + TestUtils.arrayToString(items) + ")";
     }
 
     public String mStringArrayVarargsOverloaded4(List... items) {
-        return "mStringArrayVarargsOverloaded4(List[] " + TestUtil.arrayToString(items) + ")";
+        return "mStringArrayVarargsOverloaded4(List[] " + TestUtils.arrayToString(items) + ")";
     }
     
     public String mListOrString(List<String> items) {
-        return "mListOrString(List " + TestUtil.listToString(items) + ")";
+        return "mListOrString(List " + TestUtils.listToString(items) + ")";
     }
 
     public String mListOrString(String item) {
@@ -677,7 +677,7 @@ public class OverloadedMethods2 {
     }
 
     public String mListListOrString(List<List<Object>> items) {
-        return "mListListOrString(List " + TestUtil.listToString(items) + ")";
+        return "mListListOrString(List " + TestUtils.listToString(items) + ")";
     }
 
     public String mListListOrString(String item) {
@@ -693,11 +693,11 @@ public class OverloadedMethods2 {
     }
 
     public String mMapOrBooleanVarargs(Map... v) {
-        return "mMapOrBooleanVarargs(Map... " + TestUtil.arrayToString(v) + ")";
+        return "mMapOrBooleanVarargs(Map... " + TestUtils.arrayToString(v) + ")";
     }
 
     public String mMapOrBooleanVarargs(boolean... v) {
-        return "mMapOrBooleanVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
+        return "mMapOrBooleanVarargs(boolean... " + TestUtils.arrayToString(v) + ")";
     }
 
     public String mMapOrBooleanFixedAndVarargs(Map v) {
@@ -709,11 +709,11 @@ public class OverloadedMethods2 {
     }
 
     public String mMapOrBooleanFixedAndVarargs(Map... v) {
-        return "mMapOrBooleanFixedAndVarargs(Map... " + TestUtil.arrayToString(v) + ")";
+        return "mMapOrBooleanFixedAndVarargs(Map... " + TestUtils.arrayToString(v) + ")";
     }
 
     public String mMapOrBooleanFixedAndVarargs(boolean... v) {
-        return "mMapOrBooleanFixedAndVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
+        return "mMapOrBooleanFixedAndVarargs(boolean... " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mNumberOrArray(Number v) {
@@ -721,7 +721,7 @@ public class OverloadedMethods2 {
     }
 
     public String mNumberOrArray(Object[] v) {
-        return "mNumberOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mNumberOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mIntOrArray(int v) {
@@ -729,7 +729,7 @@ public class OverloadedMethods2 {
     }
 
     public String mIntOrArray(Object[] v) {
-        return "mIntOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mIntOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
 
     public String mDateOrArray(Date v) {
@@ -737,7 +737,7 @@ public class OverloadedMethods2 {
     }
 
     public String mDateOrArray(Object[] v) {
-        return "mDateOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mDateOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mStringOrArray(String v) {
@@ -745,7 +745,7 @@ public class OverloadedMethods2 {
     }
 
     public String mStringOrArray(Object[] v) {
-        return "mStringOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mStringOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mBooleanOrArray(boolean v) {
@@ -753,7 +753,7 @@ public class OverloadedMethods2 {
     }
 
     public String mBooleanOrArray(Object[] v) {
-        return "mBooleanOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mBooleanOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mMapOrArray(Map v) {
@@ -761,7 +761,7 @@ public class OverloadedMethods2 {
     }
 
     public String mMapOrArray(Object[] v) {
-        return "mMapOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mMapOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mListOrArray(List v) {
@@ -769,7 +769,7 @@ public class OverloadedMethods2 {
     }
 
     public String mListOrArray(Object[] v) {
-        return "mListOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mListOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mSetOrArray(Set v) {
@@ -777,7 +777,7 @@ public class OverloadedMethods2 {
     }
 
     public String mSetOrArray(Object[] v) {
-        return "mSetOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+        return "mSetOrArray(Object[] " + TestUtils.arrayToString(v) + ")";
     }
     
     public String mCharNonOverloaded(char c) {
@@ -1010,7 +1010,7 @@ public class OverloadedMethods2 {
     }
 
     public String bugReport363(Object... fields) {
-        return "Executed: testMethod(Object... fields) on input: fields=" + TestUtil.arrayToString(fields);
+        return "Executed: testMethod(Object... fields) on input: fields=" + TestUtils.arrayToString(fields);
     }
     
     private static class MyAdapterNumberModel implements TemplateNumberModel, AdapterTemplateModel {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/BaseNTemplateNumberFormatFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/BaseNTemplateNumberFormatFactory.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/BaseNTemplateNumberFormatFactory.java
index e5def77..aa5d4db 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/BaseNTemplateNumberFormatFactory.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/BaseNTemplateNumberFormatFactory.java
@@ -23,8 +23,8 @@ import java.util.Locale;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.util._NumberUtil;
-import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._NumberUtils;
+import org.apache.freemarker.core.util._StringUtils;
 import org.apache.freemarker.core.valueformat.InvalidFormatParametersException;
 import org.apache.freemarker.core.valueformat.TemplateFormatUtil;
 import org.apache.freemarker.core.valueformat.TemplateNumberFormat;
@@ -60,7 +60,7 @@ public class BaseNTemplateNumberFormatFactory extends TemplateNumberFormatFactor
                 } catch (TemplateValueFormatException e) {
                     throw new InvalidFormatParametersException(
                             "Couldn't get the fallback number format (specified after the \"|\"), "
-                            + _StringUtil.jQuote(fallbackFormatStr) + ". Reason: " + e.getMessage(),
+                            + _StringUtils.jQuote(fallbackFormatStr) + ". Reason: " + e.getMessage(),
                             e);
                 }
             } else {
@@ -78,7 +78,7 @@ public class BaseNTemplateNumberFormatFactory extends TemplateNumberFormatFactor
             }
             throw new InvalidFormatParametersException(
                     "The format paramter must be an integer, but was (shown quoted): "
-                    + _StringUtil.jQuote(params));
+                    + _StringUtils.jQuote(params));
         }
         if (base < 2) {
             throw new InvalidFormatParametersException("A base must be at least 2.");
@@ -101,7 +101,7 @@ public class BaseNTemplateNumberFormatFactory extends TemplateNumberFormatFactor
                 throws TemplateModelException, TemplateValueFormatException {
             Number n = TemplateFormatUtil.getNonNullNumber(numberModel);
             try {
-                return Integer.toString(_NumberUtil.toIntExact(n), base);
+                return Integer.toString(_NumberUtils.toIntExact(n), base);
             } catch (ArithmeticException e) {
                 if (fallbackFormat == null) {
                     throw new UnformattableValueException(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/CustomHTMLOutputFormat.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/CustomHTMLOutputFormat.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/CustomHTMLOutputFormat.java
index 96a6a63..a8576bd 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/CustomHTMLOutputFormat.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/CustomHTMLOutputFormat.java
@@ -23,7 +23,7 @@ import java.io.Writer;
 
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.outputformat.CommonMarkupOutputFormat;
-import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._StringUtils;
 
 /**
  * Represents the HTML output format.
@@ -54,7 +54,7 @@ public final class CustomHTMLOutputFormat extends CommonMarkupOutputFormat<Custo
 
     @Override
     public String escapePlainText(String plainTextContent) {
-        return _StringUtil.XHTMLEnc(plainTextContent.replace('x', 'X'));
+        return _StringUtils.XHTMLEnc(plainTextContent.replace('x', 'X'));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/EpochMillisDivTemplateDateFormatFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/EpochMillisDivTemplateDateFormatFactory.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/EpochMillisDivTemplateDateFormatFactory.java
index 8799eef..be06442 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/EpochMillisDivTemplateDateFormatFactory.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/EpochMillisDivTemplateDateFormatFactory.java
@@ -25,7 +25,7 @@ import java.util.TimeZone;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._StringUtils;
 import org.apache.freemarker.core.valueformat.InvalidFormatParametersException;
 import org.apache.freemarker.core.valueformat.TemplateDateFormat;
 import org.apache.freemarker.core.valueformat.TemplateDateFormatFactory;
@@ -54,7 +54,7 @@ public class EpochMillisDivTemplateDateFormatFactory extends TemplateDateFormatF
                         "A format parameter is required, which specifies the divisor.");
             }
             throw new InvalidFormatParametersException(
-                    "The format paramter must be an integer, but was (shown quoted): " + _StringUtil.jQuote(params));
+                    "The format paramter must be an integer, but was (shown quoted): " + _StringUtils.jQuote(params));
         }
         return new EpochMillisDivTemplateDateFormat(divisor);
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HTMLISOTemplateDateFormatFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HTMLISOTemplateDateFormatFactory.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HTMLISOTemplateDateFormatFactory.java
index 357034c..83e349f 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HTMLISOTemplateDateFormatFactory.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HTMLISOTemplateDateFormatFactory.java
@@ -26,9 +26,9 @@ import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.outputformat.impl.HTMLOutputFormat;
-import org.apache.freemarker.core.util._DateUtil;
-import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util._DateUtil.DateParseException;
+import org.apache.freemarker.core.util._DateUtils;
+import org.apache.freemarker.core.util._DateUtils.CalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtils.DateParseException;
 import org.apache.freemarker.core.valueformat.InvalidFormatParametersException;
 import org.apache.freemarker.core.valueformat.TemplateDateFormat;
 import org.apache.freemarker.core.valueformat.TemplateDateFormatFactory;
@@ -57,7 +57,7 @@ public class HTMLISOTemplateDateFormatFactory extends TemplateDateFormatFactory
 
         private static final HTMLISOTemplateDateFormat INSTANCE = new HTMLISOTemplateDateFormat();
 
-        private _DateUtil.TrivialDateToISO8601CalendarFactory calendarFactory;
+        private _DateUtils.TrivialDateToISO8601CalendarFactory calendarFactory;
 
         private CalendarFieldsToDateConverter calToDateConverter;
         
@@ -67,11 +67,11 @@ public class HTMLISOTemplateDateFormatFactory extends TemplateDateFormatFactory
         public String formatToPlainText(TemplateDateModel dateModel)
                 throws UnformattableValueException, TemplateModelException {
             if (calendarFactory == null) {
-                calendarFactory = new _DateUtil.TrivialDateToISO8601CalendarFactory();
+                calendarFactory = new _DateUtils.TrivialDateToISO8601CalendarFactory();
             }
-            return _DateUtil.dateToISO8601String(
+            return _DateUtils.dateToISO8601String(
                     TemplateFormatUtil.getNonNullDate(dateModel),
-                    true, true, true, _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC,
+                    true, true, true, _DateUtils.ACCURACY_SECONDS, _DateUtils.UTC,
                     calendarFactory);
         }
 
@@ -89,9 +89,9 @@ public class HTMLISOTemplateDateFormatFactory extends TemplateDateFormatFactory
         public Date parse(String s, int dateType) throws UnparsableValueException {
             try {
                 if (calToDateConverter == null) {
-                    calToDateConverter = new _DateUtil.TrivialCalendarFieldsToDateConverter();
+                    calToDateConverter = new _DateUtils.TrivialCalendarFieldsToDateConverter();
                 }
-                return _DateUtil.parseISO8601DateTime(s, _DateUtil.UTC, calToDateConverter);
+                return _DateUtils.parseISO8601DateTime(s, _DateUtils.UTC, calToDateConverter);
             } catch (DateParseException e) {
                 throw new UnparsableValueException("Malformed ISO date-time", e);
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HexTemplateNumberFormatFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HexTemplateNumberFormatFactory.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HexTemplateNumberFormatFactory.java
index 6d72c20..c1f34b4 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HexTemplateNumberFormatFactory.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/HexTemplateNumberFormatFactory.java
@@ -23,7 +23,7 @@ import java.util.Locale;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.util._NumberUtil;
+import org.apache.freemarker.core.util._NumberUtils;
 import org.apache.freemarker.core.valueformat.InvalidFormatParametersException;
 import org.apache.freemarker.core.valueformat.TemplateFormatUtil;
 import org.apache.freemarker.core.valueformat.TemplateNumberFormat;
@@ -56,7 +56,7 @@ public class HexTemplateNumberFormatFactory extends TemplateNumberFormatFactory
                 throws UnformattableValueException, TemplateModelException {
             Number n = TemplateFormatUtil.getNonNullNumber(numberModel);
             try {
-                return Integer.toHexString(_NumberUtil.toIntExact(n));
+                return Integer.toHexString(_NumberUtils.toIntExact(n));
             } catch (ArithmeticException e) {
                 throw new UnformattableValueException(n + " doesn't fit into an int");
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/PrintfGTemplateNumberFormatFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/PrintfGTemplateNumberFormatFactory.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/PrintfGTemplateNumberFormatFactory.java
index e8d5f2b..7be09f7 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/PrintfGTemplateNumberFormatFactory.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/PrintfGTemplateNumberFormatFactory.java
@@ -26,7 +26,7 @@ import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.outputformat.impl.HTMLOutputFormat;
-import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._StringUtils;
 import org.apache.freemarker.core.valueformat.InvalidFormatParametersException;
 import org.apache.freemarker.core.valueformat.TemplateFormatUtil;
 import org.apache.freemarker.core.valueformat.TemplateNumberFormat;
@@ -55,7 +55,7 @@ public class PrintfGTemplateNumberFormatFactory extends TemplateNumberFormatFact
             } catch (NumberFormatException e) {
                 throw new InvalidFormatParametersException(
                         "The format parameter must be an integer, but was (shown quoted) "
-                        + _StringUtil.jQuote(params) + ".");
+                        + _StringUtils.jQuote(params) + ".");
             }
         } else {
             // Use the default of %G

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/TestTemplateCallableModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/TestTemplateCallableModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/TestTemplateCallableModel.java
index a1b263c..9cedddd 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/TestTemplateCallableModel.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/userpkg/TestTemplateCallableModel.java
@@ -29,7 +29,7 @@ import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.util.FTLUtil;
-import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._StringUtils;
 
 public abstract class TestTemplateCallableModel implements TemplateCallableModel {
 
@@ -91,7 +91,7 @@ public abstract class TestTemplateCallableModel implements TemplateCallableModel
             }
             sb.append('}');
         } else if (value instanceof String) {
-            sb.append(_StringUtil.jQuote(value));
+            sb.append(_StringUtils.jQuote(value));
         } else if (value instanceof Number) {
             sb.append(value.toString());
         } else if (value instanceof Boolean) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilTest.java
deleted file mode 100644
index a18d585..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.util;
-
-import static org.junit.Assert.*;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-public class CollectionUtilTest {
-
-    @Test
-    public void unmodifiableMap() {
-        Map<Object, Object> modifiableMap = new HashMap<>();
-        assertNotSame(modifiableMap, _CollectionUtil.unmodifiableMap(modifiableMap));
-
-        Map<Object, Object> wrappedModifiableMap = Collections.unmodifiableMap(modifiableMap);
-        assertSame(wrappedModifiableMap, _CollectionUtil.unmodifiableMap(wrappedModifiableMap));
-
-        assertSame(Collections.emptyMap(), _CollectionUtil.unmodifiableMap(Collections.emptyMap()));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilsTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilsTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilsTest.java
new file mode 100644
index 0000000..652d5b2
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/CollectionUtilsTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.freemarker.core.util;
+
+import static org.junit.Assert.*;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+
+public class CollectionUtilsTest {
+
+    @Test
+    public void unmodifiableMap() {
+        Map<Object, Object> modifiableMap = new HashMap<>();
+        assertNotSame(modifiableMap, _CollectionUtils.unmodifiableMap(modifiableMap));
+
+        Map<Object, Object> wrappedModifiableMap = Collections.unmodifiableMap(modifiableMap);
+        assertSame(wrappedModifiableMap, _CollectionUtils.unmodifiableMap(wrappedModifiableMap));
+
+        assertSame(Collections.emptyMap(), _CollectionUtils.unmodifiableMap(Collections.emptyMap()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ebb39b84/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/DateUtilTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/DateUtilTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/DateUtilTest.java
deleted file mode 100644
index 0cd8fc0..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/util/DateUtilTest.java
+++ /dev/null
@@ -1,1085 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.util;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util._DateUtil.DateParseException;
-import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
-import org.apache.freemarker.core.util._DateUtil.TrivialCalendarFieldsToDateConverter;
-
-import junit.framework.TestCase;
-
-public class DateUtilTest extends TestCase {
-    
-    private final TimeZone originalDefaultTZ = TimeZone.getDefault();
-
-    @Override
-    protected void setUp() throws Exception {
-        TimeZone.setDefault(TimeZone.getTimeZone("Europe/Prague"));
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        TimeZone.setDefault(originalDefaultTZ);
-    }
-
-    private final DateFormat df
-            = new SimpleDateFormat("G yyyy-MM-dd HH:mm:ss:S Z", Locale.US);
-    {
-        df.setTimeZone(_DateUtil.UTC);
-    }
-    
-    private CalendarFieldsToDateConverter cf2dc = new TrivialCalendarFieldsToDateConverter();
-    
-    private DateToISO8601CalendarFactory calendarFactory
-            = new _DateUtil.TrivialDateToISO8601CalendarFactory();
-    
-    public DateUtilTest(String name) {
-        super(name);
-    }
-    
-    public void testDateToUTCString() throws ParseException {
-        assertEquals(
-                "1998-10-30T15:30:00.512Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:512 +0400"), true));
-        assertEquals(
-                "1998-10-30T15:30:00.5Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:500 +0400"), true));
-        assertEquals(
-                "1998-10-30T15:30:00.51Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:510 +0400"), true));
-        assertEquals(
-                "1998-10-30T15:30:00.1Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:100 +0400"), true));
-        assertEquals(
-                "1998-10-30T15:30:00.01Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:10 +0400"), true));
-        assertEquals(
-                "1998-10-30T15:30:00.001Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 1998-10-30 19:30:00:1 +0400"), true));
-        assertEquals(
-                "2000-02-08T06:05:04Z",
-                dateToISO8601UTCDateTimeMSString(
-                        df.parse("AD 2000-02-08 09:05:04:0 +0300"), true));
-        assertEquals(
-                "0099-02-28T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse(
-                        "AD 0099-03-02 09:15:24:0 +0300"), true));
-        assertEquals(
-                "0010-02-28T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse("AD 0010-03-02 09:15:24:0 +0300"), true));
-        assertEquals(
-                "0001-02-28T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse("AD 0001-03-02 09:15:24:0 +0300"), true));
-        assertEquals(
-                "0000-02-29T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse("BC 0001-03-02 09:15:24:0 +0300"), true));
-        assertEquals(
-                "-1-02-28T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse("BC 2-03-02 09:15:24:0 +0300"), true));
-        assertEquals(
-                "10000-02-28T06:15:24Z",
-                dateToISO8601UTCDateTimeString(
-                        df.parse("AD 10000-02-28 09:15:24:0 +0300"), true));
-
-        Date d = df.parse("AD 1998-10-30 19:30:00:512 +0400");
-        assertEquals(
-                "1998-10-30",
-                dateToISO8601UTCDateString(d));
-        assertEquals(
-                "15:30:00.512Z",
-                dateToISO8601UTCTimeMSString(d, true));
-        assertEquals(
-                "15:30:00.512",
-                dateToISO8601UTCTimeMSString(d, false));
-        assertEquals(
-                "1998-10-30",
-                dateToISO8601UTCDateString(
-                        new java.sql.Date(d.getTime())));
-        assertEquals(
-                "15:30:00.512Z",
-                dateToISO8601UTCTimeMSString(
-                        new java.sql.Time(d.getTime()), true));
-    }
-
-    public void testLocalTime() throws ParseException {
-        Date dsum = df.parse("AD 2010-05-09 20:00:00:0 UTC");
-        Date dwin = df.parse("AD 2010-01-01 20:00:00:0 UTC");
-        
-        TimeZone tzRome = TimeZone.getTimeZone("Europe/Rome");
-        if (tzRome.getOffset(0) == 0) {
-            throw new RuntimeException(
-                    "Can't get time zone for Europe/Rome!");
-        }
-        assertEquals(
-                "2010-05-09T22:00:00+02:00",
-                dateToISO8601DateTimeString(dsum, tzRome));
-        assertEquals(
-                "2010-01-01T21:00:00+01:00",
-                dateToISO8601DateTimeString(dwin, tzRome));
-        assertEquals(
-                "2010-05-09",
-                dateToISO8601DateString(dsum, tzRome));
-        assertEquals(
-                "2010-01-01",
-                dateToISO8601DateString(dwin, tzRome));
-        assertEquals(
-                "22:00:00+02:00",
-                dateToISO8601TimeString(dsum, tzRome));
-        assertEquals(
-                "21:00:00+01:00",
-                dateToISO8601TimeString(dwin, tzRome));
-        
-        TimeZone tzNY = TimeZone.getTimeZone("America/New_York");
-        if (tzNY.getOffset(0) == 0) {
-            throw new RuntimeException(
-                    "Can't get time zone for America/New_York!");
-        }
-        assertEquals(
-                "2010-05-09T16:00:00-04:00",
-                dateToISO8601DateTimeString(dsum, tzNY));
-        assertEquals(
-                "2010-01-01T15:00:00-05:00",
-                dateToISO8601DateTimeString(dwin, tzNY));
-        assertEquals(
-                "2010-05-09",
-                dateToISO8601DateString(dsum, tzNY));
-        assertEquals(
-                "2010-01-01",
-                dateToISO8601DateString(dwin, tzNY));
-        assertEquals(
-                "16:00:00-04:00",
-                dateToISO8601TimeString(dsum, tzNY));
-        assertEquals(
-                "15:00:00-05:00",
-                dateToISO8601TimeString(dwin, tzNY));
-        
-        TimeZone tzFixed = TimeZone.getTimeZone("GMT+02:30");
-        assertEquals(
-                "2010-05-09T22:30:00+02:30",
-                dateToISO8601DateTimeString(dsum, tzFixed));
-        assertEquals(
-                "2010-01-01T22:30:00+02:30",
-                dateToISO8601DateTimeString(dwin, tzFixed));
-    }
-
-    public void testGetTimeZone() throws Exception {
-        assertTrue(_DateUtil.getTimeZone("GMT") != _DateUtil.UTC);
-        assertTrue(_DateUtil.getTimeZone("UT1") != _DateUtil.UTC);
-        assertEquals(_DateUtil.getTimeZone("UTC"), _DateUtil.UTC);
-        
-        assertEquals(_DateUtil.getTimeZone("Europe/Rome"),
-                TimeZone.getTimeZone("Europe/Rome"));
-        
-        assertEquals(_DateUtil.getTimeZone("Iceland"), // GMT and no DST
-                TimeZone.getTimeZone("Iceland"));
-        
-        try {
-            _DateUtil.getTimeZone("Europe/NoSuch");
-            fail();
-        } catch (UnrecognizedTimeZoneException e) {
-            // good
-        }
-    }
-    
-    public void testTimeOnlyDate() throws UnrecognizedTimeZoneException {
-        Date t = new Date(0L);
-        SimpleDateFormat tf = new SimpleDateFormat("HH:mm:ss");
-        
-        tf.setTimeZone(_DateUtil.UTC);
-        assertEquals("00:00:00", tf.format(t));
-        assertEquals("00:00:00",
-                dateToISO8601UTCTimeString(t, false));
-        
-        TimeZone gmt1 = _DateUtil.getTimeZone("GMT+01");
-        tf.setTimeZone(gmt1);
-        assertEquals("01:00:00", tf.format(t)); 
-        assertEquals("01:00:00+01:00",
-                dateToISO8601TimeString(t, gmt1));
-    }
-    
-    public void testAccuracy() throws ParseException {
-        Date d = df.parse("AD 2000-02-08 09:05:04:250 UTC"); 
-        assertEquals("2000-02-08T09:05:04Z",
-                dateToISO8601UTCDateTimeString(d, true));
-        assertEquals("2000-02-08T09:05:04.25Z",
-                dateToISO8601String(d, true, true, true,
-                        _DateUtil.ACCURACY_MILLISECONDS, null));
-        assertEquals("2000-02-08T09:05:04Z",
-                dateToISO8601String(d, true, true, true,
-                        _DateUtil.ACCURACY_SECONDS, null));
-        assertEquals("2000-02-08T09:05Z",
-                dateToISO8601String(d, true, true, true,
-                        _DateUtil.ACCURACY_MINUTES, null));
-        assertEquals("2000-02-08T09Z",
-                dateToISO8601String(d, true, true, true,
-                        _DateUtil.ACCURACY_HOURS, null));
-        
-        d = df.parse("AD 1998-10-30 19:30:00:000 +0400");
-        assertEquals(
-                "15:30:00Z",
-                dateToISO8601UTCTimeMSString(d, true));
-        assertEquals(
-                "15:30:00.000Z",
-                dateToISO8601UTCTimeMSFString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00Z",
-                dateToISO8601UTCDateTimeMSString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.000Z",
-                dateToISO8601UTCDateTimeMSFString(d, true));
-                
-        d = df.parse("AD 1998-10-30 19:30:00:100 +0400");
-        assertEquals(
-                "15:30:00.1Z",
-                dateToISO8601UTCTimeMSString(d, true));
-        assertEquals(
-                "15:30:00.100Z",
-                dateToISO8601UTCTimeMSFString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.1Z",
-                dateToISO8601UTCDateTimeMSString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.100Z",
-                dateToISO8601UTCDateTimeMSFString(d, true));
-        
-        d = df.parse("AD 1998-10-30 19:30:00:010 +0400");
-        assertEquals(
-                "15:30:00.01Z",
-                dateToISO8601UTCTimeMSString(d, true));
-        assertEquals(
-                "15:30:00.010Z",
-                dateToISO8601UTCTimeMSFString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.01Z",
-                dateToISO8601UTCDateTimeMSString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.010Z",
-                dateToISO8601UTCDateTimeMSFString(d, true));
-        
-        d = df.parse("AD 1998-10-30 19:30:00:001 +0400");
-        assertEquals(
-                "15:30:00.001Z",
-                dateToISO8601UTCTimeMSString(d, true));
-        assertEquals(
-                "15:30:00.001Z",
-                dateToISO8601UTCTimeMSFString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.001Z",
-                dateToISO8601UTCDateTimeMSString(d, true));
-        assertEquals(
-                "1998-10-30T15:30:00.001Z",
-                dateToISO8601UTCDateTimeMSFString(d, true));
-    }
-
-    public void testXSFormatISODeviations() throws ParseException, UnrecognizedTimeZoneException {
-        Date dsum = df.parse("AD 2010-05-09 20:00:00:0 UTC");
-        Date dwin = df.parse("AD 2010-01-01 20:00:00:0 UTC");
-        
-        TimeZone tzRome = _DateUtil.getTimeZone("Europe/Rome");
-        
-        assertEquals(
-                "2010-01-01T21:00:00+01:00",
-                _DateUtil.dateToXSString(dwin, true, true, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        assertEquals(
-                "2010-05-09T22:00:00+02:00",
-                _DateUtil.dateToXSString(dsum, true, true, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        assertEquals(
-                "2010-01-01+01:00",  // ISO doesn't allow date-only with TZ
-                _DateUtil.dateToXSString(dwin, true, false, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        assertEquals(
-                "2010-05-09+02:00",  // ISO doesn't allow date-only with TZ
-                _DateUtil.dateToXSString(dsum, true, false, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        assertEquals(
-                "21:00:00+01:00",
-                _DateUtil.dateToXSString(dwin, false, true, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        assertEquals(
-                "22:00:00+02:00",
-                _DateUtil.dateToXSString(dsum, false, true, true, _DateUtil.ACCURACY_SECONDS, tzRome, calendarFactory));
-        
-        assertEquals(
-                "-1-02-29T06:15:24Z",  // ISO uses 0 for BC 1
-                _DateUtil.dateToXSString(
-                        df.parse("BC 0001-03-02 09:15:24:0 +0300"),
-                        true, true, true, _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC, calendarFactory));
-        assertEquals(
-                "-2-02-28T06:15:24Z",  // ISO uses -1 for BC 2
-                _DateUtil.dateToXSString(
-                        df.parse("BC 2-03-02 09:15:24:0 +0300"),
-                        true, true, true, _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC, calendarFactory));
-    }
-    
-    private String dateToISO8601DateTimeString(
-            Date date, TimeZone tz) {
-        return dateToISO8601String(date, true, true, true,
-                _DateUtil.ACCURACY_SECONDS, tz);
-    }
-    
-    private String dateToISO8601UTCDateTimeString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, true, true, offsetPart,
-                _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC);
-    }
-
-    private String dateToISO8601UTCDateTimeMSString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, true, true, offsetPart,
-                _DateUtil.ACCURACY_MILLISECONDS, _DateUtil.UTC);
-    }
-
-    private String dateToISO8601UTCDateTimeMSFString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, true, true, offsetPart,
-                _DateUtil.ACCURACY_MILLISECONDS_FORCED, _DateUtil.UTC);
-    }
-        
-    private String dateToISO8601DateString(Date date, TimeZone tz) {
-        return dateToISO8601String(date, true, false, false,
-                _DateUtil.ACCURACY_SECONDS, tz);
-    }
-
-    private String dateToISO8601UTCDateString(Date date) {
-        return dateToISO8601String(date, true, false, false,
-                _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC);
-    }
-    
-    private String dateToISO8601TimeString(
-            Date date, TimeZone tz) {
-        return dateToISO8601String(date, false, true, true,
-                _DateUtil.ACCURACY_SECONDS, tz);
-    }
-    
-    private String dateToISO8601UTCTimeString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, false, true, offsetPart,
-                _DateUtil.ACCURACY_SECONDS, _DateUtil.UTC);
-    }
-
-    private String dateToISO8601UTCTimeMSString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, false, true, offsetPart,
-                _DateUtil.ACCURACY_MILLISECONDS, _DateUtil.UTC);
-    }
-
-    private String dateToISO8601UTCTimeMSFString(
-            Date date, boolean offsetPart) {
-        return dateToISO8601String(date, false, true, offsetPart,
-                _DateUtil.ACCURACY_MILLISECONDS_FORCED, _DateUtil.UTC);
-    }
-    
-    private String dateToISO8601String(
-            Date date,
-            boolean datePart, boolean timePart, boolean offsetPart,
-            int accuracy,
-            TimeZone timeZone) {
-        return _DateUtil.dateToISO8601String(
-                date,
-                datePart, timePart, offsetPart,
-                accuracy,
-                timeZone,
-                calendarFactory);        
-    }
-    
-    public void testParseDate() throws DateParseException {
-        assertDateParsing(
-                "AD 1998-10-29 20:00:00:0 +0000",
-                null,
-                "1998-10-30+04:00", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 1998-10-30 02:00:00:0 +0000",
-                null,
-                "1998-10-30-02:00", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 1998-10-30 02:00:00:0 +0000",
-                "1998-10-30", _DateUtil.parseXSTimeZone("-02:00"));
-        assertDateParsing(
-                null,
-                "AD 1998-10-30 02:00:00:0 +0000",
-                "19981030", _DateUtil.parseXSTimeZone("-02:00"));
-        assertDateParsing(
-                "AD 1998-10-30 00:00:00:0 +0000",
-                null,
-                "1998-10-30Z", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "1998-10-30", _DateUtil.UTC);
-        assertDateParsing(
-                null,
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "19981030", _DateUtil.UTC);
-
-        assertDateParsing(
-                "AD 1998-10-29 20:00:00:0 +0000",
-                null,
-                "1998-10-30+04:00", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 1998-10-30 04:00:00:0 +0000",
-                null,
-                "1998-10-30-04:00", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 1998-10-30 00:00:00:0 +0000",
-                null,
-                "1998-10-30Z", _DateUtil.UTC);
-        
-        try {
-            // XS doesn't have year 0
-            assertDateParsing(
-                    "BC 0000-02-05 00:00:00:0 +0000",
-                    null,
-                    "0000-02-03Z", _DateUtil.UTC);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        assertDateParsing(
-                null,
-                "BC 0001-02-05 00:00:00:0 +0000",
-                "0000-02-03", _DateUtil.UTC);
-        assertDateParsing(
-                null,
-                "BC 0001-02-05 00:00:00:0 +0000",
-                "00000203", _DateUtil.UTC);
-        
-        assertDateParsing(
-                "BC 0001-02-05 00:00:00:0 +0000",  // Julian
-                "BC 0002-02-05 00:00:00:0 +0000",  // Julian
-                "-0001-02-03", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateParsing(
-                null,
-                "BC 0002-02-05 00:00:00:0 +0000",  // Julian
-                "-00010203", _DateUtil.UTC);  // Proleptic Gregorian
-
-        assertDateParsing(
-                "AD 0001-02-05 00:00:00:0 +0000",  // Julian
-                null,
-                "0001-02-03Z", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateParsing(
-                "AD 0001-02-05 00:00:00:0 +0000",  // Julian
-                "0001-02-03", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateParsing(
-                null,
-                "AD 0001-02-05 00:00:00:0 +0000",  // Julian
-                "00010203", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateParsing(
-                "AD 1001-12-07 00:00:00:0 +0000",  // Julian
-                null,
-                "1001-12-13Z", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateParsing(
-                "AD 1001-12-07 00:00:00:0 +0000",  // Julian
-                "1001-12-13", _DateUtil.UTC);  // Proleptic Gregorian
-        
-        assertDateParsing(
-                "AD 2006-12-31 00:00:00:0 +0000",
-                null,
-                "2006-12-31Z", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 2006-12-31 00:00:00:0 +0000",
-                "2006-12-31", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 2006-01-01 00:00:00:0 +0000",
-                null,
-                "2006-01-01Z", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 2006-01-01 00:00:00:0 +0000",
-                "2006-01-01", _DateUtil.UTC);
-        assertDateParsing(
-                "AD 12006-01-01 00:00:00:0 +0000",
-                "12006-01-01", _DateUtil.UTC);
-        assertDateParsing(
-                null,
-                "AD 12006-01-01 00:00:00:0 +0000",
-                "120060101", _DateUtil.UTC);
-    }
-
-    public void testParseDateMalformed() {
-        assertDateMalformed("1998-10-30x");
-        assertDateMalformed("+1998-10-30");
-        assertDateMalformed("1998-10-");
-        assertDateMalformed("1998-1-30");
-        assertDateMalformed("1998-10-30+01");
-        assertDateMalformed("1998-00-01");
-        assertDateMalformed("1998-13-01");
-        assertDateMalformed("1998-10-00");
-        assertDateMalformed("1998-10-32");
-        assertDateMalformed("1998-02-31");
-        
-        assertISO8601DateMalformed("2100103");
-        assertISO8601DateMalformed("210-01-03");
-        assertISO8601DateMalformed("2012-0301");
-        assertISO8601DateMalformed("201203-01");
-        assertISO8601DateMalformed("2012-01-01+01:00");
-    }
-    
-    public void testParseTime() throws DateParseException {
-        assertTimeParsing(
-                "AD 1970-01-01 17:30:05:0 +0000",
-                "17:30:05", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 17:30:05:0 +0000",
-                "173005", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:100 +0000",
-                "07:30:00.1", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:120 +0000",
-                "07:30:00.12", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "07:30:00.123", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "07:30:00.1235", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "07:30:00.12346", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "073000.12346", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "073000,12346", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:120 +0000",
-                "07:30:00.12", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 07:30:00:500 +0000",
-                "07:30:00.5", _DateUtil.UTC);
-
-        assertTimeParsing(
-                "AD 1970-01-01 16:30:05:0 +0000",
-                "17:30:05+01:00", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:30:05:0 +0000",
-                "173005+01", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 19:00:05:0 +0000",
-                "17:30:05-01:30", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 19:00:05:0 +0000",
-                "173005-0130", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-01 16:30:05:500 +0000",
-                "17:30:05.5+01:00", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:30:05:500 +0000",
-                "173005.5+0100", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:30:05:500 +0000",
-                "173005.5+01", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:00:00:0 +0000",
-                "170000+01", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:00:00:0 +0000",
-                "1700+01", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-01 16:00:00:0 +0000",
-                "17+01", _DateUtil.UTC);
-        
-        assertTimeParsing(
-                "AD 1970-01-01 00:00:00:0 +0000",
-                "00:00:00", _DateUtil.UTC);
-        assertTimeParsing(
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "24:00:00", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "240000", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "2400", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "24:00", _DateUtil.UTC);
-        assertTimeParsing(
-                null,
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "24", _DateUtil.UTC);
-        
-        assertTimeParsing(
-                "AD 1970-01-01 23:59:59:999 +0000",
-                "23:59:59.999", _DateUtil.UTC);
-    }
-
-    public void testParseTimeMalformed() {
-        assertTimeMalformed("00:0000");
-        assertTimeMalformed("00:00:00-01:60");
-        assertTimeMalformed("24:00:01");
-        assertTimeMalformed("00:00:61");
-        assertTimeMalformed("00:60:00");
-        assertTimeMalformed("25:00:00");
-        assertTimeMalformed("2:00:00");
-        assertTimeMalformed("02:0:00");
-        assertTimeMalformed("02:00:0");
-        
-        assertISO8601TimeMalformed("1010101");
-        assertISO8601TimeMalformed("10101");
-        assertISO8601TimeMalformed("101");
-        assertISO8601TimeMalformed("1");
-        assertISO8601TimeMalformed("101010-1");
-        assertISO8601TimeMalformed("101010-100");
-        assertISO8601TimeMalformed("101010-10000");
-        assertISO8601TimeMalformed("101010+1");
-        assertISO8601TimeMalformed("101010+100");
-        assertISO8601TimeMalformed("101010+10000");
-    }
-    
-    public void testParseDateTime() throws DateParseException {
-        assertDateTimeParsing( 
-                "AD 1998-10-30 11:30:00:0 +0000",
-                "1998-10-30T15:30:00+04:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 11:30:00:0 +0000",
-                "19981030T153000+0400", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 11:30:00:500 +0000",
-                "1998-10-30T15:30:00.5+04:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 15:30:00:0 +0000",
-                "1998-10-30T15:30:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 15:30:00:0 +0000",
-                "19981030T1530Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 15:30:00:500 +0000",
-                "1998-10-30T15:30:00.5Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 11:30:00:0 +0000",
-                "1998-10-30T15:30:00+04:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 15:30:00:0 +0000",
-                "1998-10-30T15:30:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 15:30:00:0 +0000",
-                "1998-10-30T15:30:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 15:30:00:0 +0000",
-                "1998-10-30T15:30", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "AD 1998-10-29 20:00:00:0 +0000",
-                "1998-10-30T00:00:00+04:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 02:00:00:0 +0000",
-                "1998-10-30T00:00:00-02:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "1998-10-30T00:00:00Z", _DateUtil.UTC);
-
-        assertDateTimeParsing(
-                "AD 1998-10-29 20:00:00:0 +0000",
-                "1998-10-30T00:00:00+04:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "1998-10-30T00:00:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "1998-10-30T00:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "1998-10-30T00:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 1998-10-30 00:00:00:0 +0000",
-                "19981030T00Z", _DateUtil.UTC);
-        
-        // BC years
-        try {
-            assertDateTimeParsing(
-                        "",
-                        null,
-                        "0000-02-03T00:00:00Z", _DateUtil.UTC);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        assertDateTimeParsing(
-                null,
-                "BC 0001-02-05 00:00:00:0 +0000",
-                "0000-02-03T00:00:00Z", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "BC 0001-02-05 00:00:00:0 +0000",  // Julian
-                "BC 0002-02-05 00:00:00:0 +0000",  // Julian
-                "-0001-02-03T00:00:00Z", _DateUtil.UTC);  // Proleptic Gregorian
-
-        assertDateTimeParsing(
-                "AD 0001-02-05 00:00:00:0 +0000",  // Julian
-                "0001-02-03T00:00:00Z", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateTimeParsing(
-                "AD 1001-12-07 00:00:00:0 +0000",  // Julian
-                "1001-12-13T00:00:00Z", _DateUtil.UTC);  // Proleptic Gregorian
-        assertDateTimeParsing(
-                "AD 11001-12-13 00:00:00:0 +0000",
-                "11001-12-13T00:00:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                null,
-                "AD 11001-12-13 00:00:00:0 +0000",
-                "110011213T00Z", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "AD 2006-12-31 00:00:00:0 +0000",
-                "2006-12-31T00:00:00Z", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 2006-01-01 00:00:00:0 +0000",
-                "2006-01-01T00:00:00Z", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "1970-01-01T07:30:00.123", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "1970-01-01T07:30:00.1235", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-01 07:30:00:123 +0000",
-                "1970-01-01T07:30:00.12346", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-01 07:30:00:120 +0000",
-                "1970-01-01T07:30:00.12", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-01 07:30:00:500 +0000",
-                "1970-01-01T07:30:00.5", _DateUtil.UTC);
-
-        assertDateTimeParsing(
-                "AD 1970-01-01 16:30:05:0 +0000",
-                "1970-01-01T17:30:05+01:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-01 16:30:05:500 +0000",
-                "1970-01-01T17:30:05.5+01:00", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "AD 1970-01-01 00:00:00:0 +0000",
-                "1970-01-01T00:00:00", _DateUtil.UTC);
-        assertDateTimeParsing(
-                "AD 1970-01-02 00:00:00:0 +0000",
-                "1970-01-01T24:00:00", _DateUtil.UTC);
-        
-        assertDateTimeParsing(
-                "AD 1970-01-01 23:59:59:999 +0000",
-                "1970-01-01T23:59:59.999", _DateUtil.UTC);
-    }
-
-    public void testParseDateTimeMalformed() throws DateParseException {
-        assertDateTimeMalformed("1998-00-01T00:00:00");
-        assertDateTimeMalformed("1998-13-01T00:00:00");
-        assertDateTimeMalformed("1998-10-00T00:00:00");
-        assertDateTimeMalformed("1998-10-32T00:00:00");
-        assertDateTimeMalformed("1998-02-31T00:00:00");
-        assertDateTimeMalformed("1970-01-02T24:00:01");
-        assertDateTimeMalformed("1970-01-01T00:00:61");
-        assertDateTimeMalformed("1970-01-01T00:60:00");
-        assertDateTimeMalformed("1970-01-01T25:00:00");
-        
-        assertISO8601DateTimeMalformed("197-01-01T20:00:00");
-    }
-    
-    public void testParseXSTimeZone() throws DateParseException {
-        assertEquals(0,
-                _DateUtil.parseXSTimeZone("Z").getOffset(0));
-        assertEquals(0,
-                _DateUtil.parseXSTimeZone("-00:00").getOffset(0));
-        assertEquals(0,
-                _DateUtil.parseXSTimeZone("+00:00").getOffset(0));
-        assertEquals(90 * 60 * 1000,
-                _DateUtil.parseXSTimeZone("+01:30").getOffset(0));
-        assertEquals(-4 * 60 * 60 * 1000,
-                _DateUtil.parseXSTimeZone("-04:00").getOffset(0));
-        assertEquals(((-23 * 60) - 59) * 60 * 1000,
-                _DateUtil.parseXSTimeZone("-23:59").getOffset(0));
-        assertEquals(((23 * 60) + 59) * 60 * 1000,
-                _DateUtil.parseXSTimeZone("+23:59").getOffset(0));
-    }
-
-    public void testParseXSTimeZoneWrong() {
-        try {
-            _DateUtil.parseXSTimeZone("04:00").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        try {
-            _DateUtil.parseXSTimeZone("-04:00x").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        try {
-            _DateUtil.parseXSTimeZone("-04").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        try {
-            _DateUtil.parseXSTimeZone("+24:00").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        try {
-            _DateUtil.parseXSTimeZone("-24:00").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-        try {
-            _DateUtil.parseXSTimeZone("-01:60").getOffset(0);
-            fail();
-        } catch (DateParseException e) {
-            echo(e);
-        }
-    }
-    
-    public void testParseXSDateTimeFTLAndJavax() throws DateParseException {
-        // Explicit time zone:
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T13:35:08Z");
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T13:35:08+02:00");
-        
-        // Default time zone:
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T13:35:08"); // winter
-        assertJavaxAndFTLXSDateTimesSame("2014-07-01T13:35:08"); // summer
-        
-        // Proleptic Gregorian
-        assertJavaxAndFTLXSDateTimesSame("1500-01-01T13:35:08Z");
-        assertJavaxAndFTLXSDateTimesSame("0200-01-01T13:35:08Z");
-        assertJavaxAndFTLXSDateTimesSame("0001-01-01T00:00:00+05:00");
-        
-        // BC
-        assertJavaxAndFTLXSDateTimesSame("0001-01-01T13:35:08Z");
-        assertJavaxAndFTLXSDateTimesSame("-0001-01-01T13:35:08Z");
-        
-        // Hour 24
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T23:59:59");
-        if (isAtLeastJava6()) { // Java 5 has broken parser that doesn't allow 24.
-            assertJavaxAndFTLXSDateTimesSame("2014-01-31T24:00:00");
-            assertJavaxAndFTLXSDateTimesSame("2014-01-01T24:00:00");
-        }
-        assertJavaxAndFTLXSDateTimesSame("2014-01-02T00:00:00");  // same as the previous
-        assertJavaxAndFTLXSDateTimesSame("2014-02-01T00:00:00");  // same as the previous
-        
-        // Under ms
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T23:59:59.123456789");
-        assertJavaxAndFTLXSDateTimesSame("2014-01-01T23:59:59.1235");
-    }
-    
-    private boolean isAtLeastJava6() {
-        try {
-            Class.forName("java.lang.management.LockInfo");
-        } catch (ClassNotFoundException e) {
-            return false;
-        }
-        return true;
-    }
-
-    private final DatatypeFactory datetypeFactory;
-    {
-        try {
-            datetypeFactory = DatatypeFactory.newInstance();
-        } catch (DatatypeConfigurationException e) {
-            throw new RuntimeException(e);
-        } 
-    }
-    
-    private void assertJavaxAndFTLXSDateTimesSame(String s) throws DateParseException {
-        XMLGregorianCalendar xgc = datetypeFactory.newXMLGregorianCalendar(s);
-        Date javaxDate = xgc.toGregorianCalendar().getTime();
-        Date ftlDate = _DateUtil.parseXSDateTime(s, TimeZone.getDefault(), cf2dc);
-        assertEquals(javaxDate, ftlDate);
-    }
-
-    private void assertDateParsing(String expected, String parsed, TimeZone tz) throws DateParseException {
-        assertDateParsing(expected, expected, parsed, tz);
-    }
-
-    private void assertDateParsing(String expectedXS, String expectedISO8601, String parsed, TimeZone tz)
-            throws DateParseException {
-        if (expectedXS != null) {
-            assertEquals(
-                    expectedXS,
-                    df.format(_DateUtil.parseXSDate(parsed, tz, cf2dc)));
-        }
-        if (expectedISO8601 != null) {
-            assertEquals(
-                    expectedISO8601,
-                    df.format(_DateUtil.parseISO8601Date(parsed, tz, cf2dc)));
-        }
-    }
-
-    private void assertDateTimeParsing(String expected, String parsed, TimeZone tz) throws DateParseException {
-        assertDateTimeParsing(expected, expected, parsed, tz);
-    }
-
-    private void assertDateTimeParsing(String expectedXS, String expectedISO8601, String parsed, TimeZone tz)
-            throws DateParseException {
-        if (expectedXS != null) {
-            assertEquals(
-                    expectedXS,
-                    df.format(_DateUtil.parseXSDateTime(parsed, tz, cf2dc)));
-        }
-        if (expectedISO8601 != null) {
-            assertEquals(
-                    expectedISO8601,
-                    df.format(_DateUtil.parseISO8601DateTime(parsed, tz, cf2dc)));
-        }
-    }
-
-    private void assertTimeParsing(String expected, String parsed, TimeZone tz) throws DateParseException {
-        assertTimeParsing(expected, expected, parsed, tz);
-    }
-
-    private void assertTimeParsing(String expectedXS, String expectedISO8601, String parsed, TimeZone tz)
-            throws DateParseException {
-        if (expectedXS != null) {
-            assertEquals(
-                    expectedXS,
-                    df.format(_DateUtil.parseXSTime(parsed, tz, cf2dc)));
-        }
-        if (expectedISO8601 != null) {
-            assertEquals(
-                    expectedISO8601,
-                    df.format(_DateUtil.parseISO8601Time(parsed, tz, cf2dc)));
-        }
-    }
-    
-    private void assertDateMalformed(String parsed) {
-        try {
-            _DateUtil.parseXSDate(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-        try {
-            _DateUtil.parseISO8601Date(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-
-    private void assertTimeMalformed(String parsed) {
-        try {
-            _DateUtil.parseXSTime(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-        try {
-            _DateUtil.parseISO8601Time(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-
-    private void assertDateTimeMalformed(String parsed) {
-        try {
-            _DateUtil.parseXSDateTime(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-        try {
-            _DateUtil.parseISO8601DateTime(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-
-    private void assertISO8601DateMalformed(String parsed) {
-        try {
-            _DateUtil.parseISO8601Date(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-    
-    private void assertISO8601TimeMalformed(String parsed) {
-        try {
-            _DateUtil.parseISO8601Time(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-    
-    private void assertISO8601DateTimeMalformed(String parsed) {
-        try {
-            _DateUtil.parseISO8601DateTime(parsed, _DateUtil.UTC, cf2dc);
-            fail();
-        } catch (DateParseException e) {
-            // Expected
-            echo(e);
-        }
-    }
-    
-    private void echo(@SuppressWarnings("unused") DateParseException e) {
-        // System.out.println(e);
-    }
-
-}
\ No newline at end of file


Mime
View raw message