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/05/16 16:08:59 UTC

[01/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 bb9acc9da -> 4b75ea930


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns4.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns4.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns4.ftl
deleted file mode 100644
index e97bfc0..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns4.ftl
+++ /dev/null
@@ -1,70 +0,0 @@
-<#ftl ns_prefixes = {"x" : "http://x", "y" : "http://y"}>
-<#--
-  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.
--->
-<#recurse doc >
-
-<#macro book>
-  <html>
-    <head>
-      <title><#recurse .node["x:title"]></title>
-    </head>
-    <body>
-      <h1><#recurse .node["x:title"]></h1>
-      <#recurse>
-    </body>
-  </html>
-</#macro>
-
-<#macro chapter>
-  <h2><#recurse .node["y:title"]></h2>
-  <#recurse>
-</#macro>
-
-<#macro 'x:chapter'>
-  <h2><#recurse .node["y:title"]></h2>
-  <#recurse>
-</#macro>
-
-<#macro para>
-  <p><#recurse>
-</#macro>
-
-<#macro 'x:para'>
-  <p><#recurse>
-</#macro>
-
-<#macro 'y:para'>
-  <p><#recurse>
-</#macro>
-
-<#macro "x:title">
-  <#--
-    We have handled this element imperatively,
-    so we do nothing here.
-  -->
-</#macro>
-
-<#macro "y:title">
-  <#--
-    We have handled this element imperatively,
-    so we do nothing here.
-  -->
-</#macro>
-
-<#macro @text>${.node?html}</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns5.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns5.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns5.ftl
deleted file mode 100644
index edc3b4a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns5.ftl
+++ /dev/null
@@ -1,28 +0,0 @@
-<#ftl ns_prefixes = {"D": "http://y.com", "xx" : "http://x.com"}>
-<#--
-  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.
--->
-<#assign r = doc["N:root"]>
-${r["N:t1"][0]?default('-')} = No NS
-${r["xx:t2"][0]?default('-')} = x NS
-${r["t3"][0]?default('-')} = y NS
-${r["xx:t4"][0]?default('-')} = x NS
-${r["//t1"][0]?default('-')} = No NS
-${r["//t2"][0]?default('-')} = -
-${r["//t3"][0]?default('-')} = -
-${r["//t4"][0]?default('-')} = -

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
deleted file mode 100644
index 2cfe290..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.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.
--->
-
-<!DOCTYPE testCases [
-  <!ELEMENT testCases (setting?, testCase*)>
-  <!ELEMENT testCase (setting?)>
-     <!ATTLIST testCase 
-               name CDATA #REQUIRED
-               template CDATA #IMPLIED
-               expected CDATA #IMPLIED
-               noOutput CDATA #IMPLIED
-     >
-     <!-- The default of `template` is "${name?keep_before('[#endTN]')}.ftl" -->
-     <!-- The default of `expected` is "${name}.txt" -->
-     <!-- The default of `noOutput` is false -->
-     
- <!ELEMENT setting EMPTY>
-     <!ATTLIST setting 
-            auto_import CDATA #IMPLIED
-            source_encoding CDATA #IMPLIED
-            locale CDATA #IMPLIED
-            object_wrapper CDATA #IMPLIED
-            output_encoding CDATA #IMPLIED
-            output_dir CDATA #IMPLIED
-            new_builtin_class_resolver CDATA #IMPLIED
-            url_escaping_charset CDATA #IMPLIED
-            incompatible_improvements CDATA #IMPLIED
-            time_zone CDATA #IMPLIED
-            api_builtin_enabled CDATA #IMPLIED
-      >
-]>
-<!--
-Note that for the incompatible_improvements setting you can specify a list of versions, for example:
-<setting incompatible_improvements="min, 3.0.5, max" /> 
--->
-
-<testCases>
-   <setting source_encoding="UTF-8" output_encoding="UTF-8" />
-   
-   <testCase name="api-builtins" noOutput="true">
-      <setting api_builtin_enabled="true" />
-   </testCase>
-   <testCase name="arithmetic" />
-   <testCase name="assignments" noOutput="true" />
-   <testCase name="boolean" />
-   <testCase name="charset-in-header" />
-   <testCase name="comment" />
-   <testCase name="comparisons" />
-   <testCase name="compress" />
-   <testCase name="then-builtin" noOutput="true" />
-   <testCase name="dateformat-java" />
-   <testCase name="dateformat-iso-like" noOutput="true" />
-   <testCase name="dateformat-iso-bi" noOutput="true" />
-   <testCase name="dateparsing" noOutput="true" />
-   <testCase name="default"/>
-   <testCase name="default-object-wrapper">
-      <setting api_builtin_enabled="true" />
-   </testCase>
-   <testCase name="default-xmlns" />
-   <testCase name="encoding-builtins" />
-   <testCase name="escapes" />
-   <testCase name="hashliteral" />
-   <testCase name="identifier-non-ascii" />
-   <testCase name="identifier-escaping" />
-   <testCase name="import">
-      <setting auto_import="import_lib.ftl as my"/>
-   </testCase>
-   <testCase name="include" />
-   <testCase name="include2">
-      <setting source_encoding="utf-8" />
-   </testCase>
-   <testCase name="interpret"/>
-   <testCase name="iterators"/>
-   <testCase name="lastcharacter"/>
-   <testCase name="list[#endTN]-simpleTemplateModels" expected="list.txt">
-      <setting object_wrapper="org.apache.freemarker.test.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list[#endTN]-collectionAdapter" expected="list.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list2[#endTN]-simpleTemplateModels" expected="list2.txt">
-      <setting object_wrapper="org.apache.freemarker.test.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list2[#endTN]-collectionAdapter" expected="list2.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list3[#endTN]-simpleTemplateModels" expected="list3.txt">
-      <setting object_wrapper="org.apache.freemarker.test.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list3[#endTN]-collectionAdapter" expected="list3.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="list-bis" />
-   <testCase name="list-bis[#endTN]-collectionAdapter" expected="list-bis.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="listhash" />
-   <testCase name="listhashliteral" />
-   <testCase name="listliteral" />
-   <testCase name="localization" >
-      <setting locale="en_AU"/>
-   </testCase>
-   <testCase name="loopvariable" />
-   <testCase name="macros"/>
-   <testCase name="macros2"/>
-   <testCase name="macros-return"/>
-   <testCase name="multimodels"/>
-   <testCase name="nested" />
-   <testCase name="newlines1" />
-   <testCase name="newlines2" />
-   <testCase name="noparse" />
-   <testCase name="number-format" />
-   <testCase name="number-literal" >
-      <setting locale="fr_FR"/>
-   </testCase>
-   <testCase name="numerical-cast" />
-   <testCase name="output-encoding1"/>
-   <testCase name="output-encoding2">
-       <setting output_encoding="UTF-16"/>
-   </testCase>
-   <testCase name="output-encoding3">
-       <setting output_encoding="ISO-8859-1" url_escaping_charset="UTF-16" />
-   </testCase>
-   <testCase name="precedence"/>
-   <testCase name="range" noOutput="true" />
-   <testCase name="recover" />
-   <testCase name="root" />
-   <testCase name="setting" noOutput="true" />
-   <testCase name="sequence-builtins[#endTN]-with-SimpleTemplateModel" expected="sequence-builtins.txt">
-      <setting object_wrapper="org.apache.freemarker.test.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
-   </testCase>
-   <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper" expected="sequence-builtins.txt">
-      <setting object_wrapper="default"/> 
-   </testCase>
-   <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper-collAdapters" expected="sequence-builtins.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0)"/>
-   </testCase>
-   <testCase name="simplehash-char-key" noOutput="true" />
-   <testCase name="existence-operators" noOutput="true" />
-   <testCase name="string-builtins1" />
-   <testCase name="string-builtins2" />
-   <testCase name="string-builtins3" noOutput="true" />
-   <testCase name="string-builtins-regexps" />
-   <testCase name="string-builtins-regexps-matches" />
-   <testCase name="stringbimethods" />
-   <testCase name="stringliteral"/>
-   <testCase name="if" />
-   <testCase name="switch" />
-   <testCase name="switch-builtin" noOutput="true" />
-   <testCase name="transforms"/>
-   <testCase name="type-builtins" />
-   <testCase name="date-type-builtins" noOutput="true" />
-   <testCase name="url" noOutput="true" />
-   <testCase name="var-layers"/>
-   <testCase name="variables"/>
-   <testCase name="whitespace-trim"/>
-   <testCase name="wstrip-in-header"/>
-   <testCase name="xml-fragment" />
-   <testCase name="xmlns1" />
-   <testCase name="xmlns2" template="xmlns1.ftl"  expected="xmlns1.txt" />
-   <testCase name="xmlns3" />
-   <testCase name="xmlns4" />
-   <testCase name="xmlns5" />
-   <testCase name="xml-ns_prefix-scope" template="xml-ns_prefix-scope-main.ftl" />
-   <testCase name="hashconcat"/>
-   <testCase name="new-defaultresolver" />
-   <testCase name="new-unrestricted" template="new-defaultresolver.ftl" expected="new-defaultresolver.txt">
-      <setting new_builtin_class_resolver="unrestricted"/>
-   </testCase>   
-   <testCase name="new-allowsnothing" template="new-defaultresolver.ftl">
-      <setting new_builtin_class_resolver="allows_nothing"/>
-   </testCase>   
-   <testCase name="new-optin">
-      <setting new_builtin_class_resolver="
-      		allowed_classes: org.apache.freemarker.test.templatesuite.models.NewTestModel,
-      		trusted_templates: subdir/new-optin.ftl, subdir/subsub/*"
-      />
-   </testCase>   
-   <testCase name="specialvars">
-      <setting locale="en_US" output_encoding="utf-8" url_escaping_charset="iso-8859-1"/>
-   </testCase>   
-   <testCase name="number-to-date" />
-   <testCase name="varargs" />
-   <testCase name="boolean-formatting"  />
-   <testCase name="number-math-builtins" noOutput="true" />
-   <testCase name="string-builtin-coercion" noOutput="true" />
-   
-   <testCase name="overloaded-methods[#endTN]-inc-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.DefaultObjectWrapperInc"/>
-   </testCase>
-   <testCase name="overloaded-methods[#endTN]-desc-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.DefaultObjectWrapperDesc"/>
-   </testCase>
-</testCases>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core/build.gradle
----------------------------------------------------------------------
diff --git a/freemarker-core/build.gradle b/freemarker-core/build.gradle
index 3419439..39af628 100644
--- a/freemarker-core/build.gradle
+++ b/freemarker-core/build.gradle
@@ -39,14 +39,6 @@ dependencies {
         // xml-apis is part of Java SE since version 1.4:
         exclude group: "xml-apis", module: "xml-apis"
     }
-
-    testRuntime "jaxen:jaxen:1.0-FCS"
-    testRuntime "saxpath:saxpath:1.0-FCS"
-    testRuntime("xalan:xalan:2.7.0") {
-        // xml-apis is part of Java SE since version 1.4:
-        exclude group: "xml-apis", module: "xml-apis"
-    }
-
 }
 
 compileJavacc {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestCase.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestCase.java b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestCase.java
new file mode 100644
index 0000000..a8a0c55
--- /dev/null
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestCase.java
@@ -0,0 +1,194 @@
+/*
+ * 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.test;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.ConfigurationException;
+import org.apache.freemarker.core.Template;
+import org.apache.freemarker.core.TemplateException;
+import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.templateresolver.impl.ClassTemplateLoader;
+import org.apache.freemarker.core.util._NullArgumentException;
+import org.apache.freemarker.core.util._NullWriter;
+import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.test.templateutil.AssertDirective;
+import org.apache.freemarker.test.templateutil.AssertEqualsDirective;
+import org.apache.freemarker.test.templateutil.AssertFailsDirective;
+import org.apache.freemarker.test.templateutil.NoOutputDirective;
+import org.junit.Ignore;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * Instances of this are created and called by {@link TemplateTestSuite}. (It's on "Ignore" so that Eclipse doesn't try
+ * to run this alone.) 
+ */
+@Ignore
+class TemplateTestCase extends FileTestCase {
+    
+    // Name of variables exposed to all test FTL-s:
+    private static final String ICI_INT_VALUE_VAR_NAME = "iciIntValue";
+    private static final String TEST_NAME_VAR_NAME = "testName";
+    private static final String NO_OUTPUT_VAR_NAME = "noOutput";
+    private static final String ASSERT_FAILS_VAR_NAME = "assertFails";
+    private static final String ASSERT_EQUALS_VAR_NAME = "assertEquals";
+    private static final String ASSERT_VAR_NAME = "assert";
+
+    private final TemplateTestSuite testSuite;
+
+    private final String simpleTestName;
+    private final String templateName;
+    private final String expectedFileName;
+    private final boolean noOutput;
+    
+    private final Configuration.ExtendableBuilder<?> confB;
+    private final HashMap<String, Object> dataModel = new HashMap<>();
+    
+    TemplateTestCase(
+            TemplateTestSuite testSuite,
+            String testName, String simpleTestName, String templateName, String expectedFileName, boolean noOutput,
+            Version incompatibleImprovements) {
+        super(testName);
+        _NullArgumentException.check("testName", testName);
+
+        _NullArgumentException.check("testSuite", testSuite);
+        this.testSuite = testSuite;
+        
+        _NullArgumentException.check("simpleTestName", simpleTestName);
+        this.simpleTestName = simpleTestName;
+        
+        _NullArgumentException.check("templateName", templateName);
+        this.templateName = templateName;
+        
+        _NullArgumentException.check("expectedFileName", expectedFileName);
+        this.expectedFileName = expectedFileName;
+        
+        this.noOutput = noOutput;
+
+        confB = new TestConfigurationBuilder(incompatibleImprovements);
+    }
+    
+    void setSetting(String param, String value) throws IOException {
+        if ("auto_import".equals(param)) {
+            StringTokenizer st = new StringTokenizer(value);
+            if (!st.hasMoreTokens()) fail("Expecting libname");
+            String libname = st.nextToken();
+            if (!st.hasMoreTokens()) fail("Expecting 'as <alias>' in autoimport");
+            String as = st.nextToken();
+            if (!as.equals("as")) fail("Expecting 'as <alias>' in autoimport");
+            if (!st.hasMoreTokens()) fail("Expecting alias after 'as' in autoimport");
+            String alias = st.nextToken();
+            confB.addAutoImport(alias, libname);
+        } else if ("source_encoding".equals(param)) {
+            confB.setSourceEncoding(Charset.forName(value));
+        // INCOMPATIBLE_IMPROVEMENTS is a list here, and was already set in the constructor.
+        } else if (!Configuration.ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY.equals(param)) {
+            try {
+                confB.setSetting(param, value);
+            } catch (ConfigurationException e) {
+                throw new RuntimeException(
+                        "Failed to set setting " +
+                        _StringUtil.jQuote(param) + " to " +
+                        _StringUtil.jQuote(value) + "; see cause exception.",
+                        e);
+            }
+        }
+    }
+    
+    /*
+     * This method just contains all the code to seed the data model 
+     * ported over from the individual classes. This seems ugly and unnecessary.
+     * We really might as well just expose pretty much 
+     * the same tree to all our tests. (JR)
+     */
+    @Override
+    @SuppressWarnings("boxing")
+    protected void setUp() throws Exception {
+        confB.setTemplateLoader(
+                new CopyrightCommentRemoverTemplateLoader(
+                        new ClassTemplateLoader(testSuite.getClass(), "templates")));
+        
+        dataModel.put(ASSERT_VAR_NAME, AssertDirective.INSTANCE);
+        dataModel.put(ASSERT_EQUALS_VAR_NAME, AssertEqualsDirective.INSTANCE);
+        dataModel.put(ASSERT_FAILS_VAR_NAME, AssertFailsDirective.INSTANCE);
+        dataModel.put(NO_OUTPUT_VAR_NAME, NoOutputDirective.INSTANCE);
+
+        dataModel.put(TEST_NAME_VAR_NAME, simpleTestName);
+        dataModel.put(ICI_INT_VALUE_VAR_NAME, confB.getIncompatibleImprovements().intValue());
+
+        testSuite.setUpTestCase(simpleTestName, dataModel, confB);
+    }
+    
+    @Override
+    protected void runTest() throws IOException, ConfigurationException {
+        Template template;
+        try {
+            template = confB.build().getTemplate(templateName);
+        } catch (IOException e) {
+            throw new AssertionFailedError(
+                    "Could not load template " + _StringUtil.jQuote(templateName) + ":\n" + getStackTrace(e));
+        }
+
+        testSuite.validateTemplate(template);
+
+        StringWriter out = noOutput ? null : new StringWriter();
+        try {
+            template.process(dataModel, out != null ? out : _NullWriter.INSTANCE);
+        } catch (TemplateException e) {
+            throw new AssertionFailedError("Template " + _StringUtil.jQuote(templateName) + " has stopped with error:\n"
+                        + getStackTrace(e));
+        }
+        
+        if (out != null) {
+            assertExpectedFileEqualsString(expectedFileName, out.toString());
+        }
+    }
+
+    private String getStackTrace(Throwable e) {
+        StringWriter sw = new StringWriter();
+        e.printStackTrace(new PrintWriter(sw));
+        return sw.toString();
+    }
+
+    @Override
+    protected String getExpectedContentFileDirectoryResourcePath() throws IOException {
+        return joinResourcePaths(super.getExpectedContentFileDirectoryResourcePath(), "expected");
+    }
+
+    @Override
+    protected Charset getTestResourceDefaultCharset() {
+        return confB.getOutputEncoding() != null ? confB.getOutputEncoding() : StandardCharsets.UTF_8;
+    }
+
+    @Override
+    protected Class getTestResourcesBaseClass() {
+        return testSuite.getClass();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestSuite.java b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestSuite.java
new file mode 100644
index 0000000..c9b4e4c
--- /dev/null
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/TemplateTestSuite.java
@@ -0,0 +1,332 @@
+/*
+ * 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.test;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.Template;
+import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.dom.NodeModel;
+import org.junit.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import junit.framework.TestSuite;
+
+/**
+ * Abstract superclass for JUnit test suites where the test cases are defined in
+ * {@code <suiteClassPackage>/testcases.xml}, and process templates and compare their output with the expected output.
+ * It's important to add this static method like <code>public static TestSuite suite() { return new
+ * SomeTemplateTestSuite(); }</code> to concrete subclasses, or else it won't be detected and run by build tools and
+ * IDE-s.
+ * <p>
+ * If you only want to run certain tests, you can specify a regular expression for the test name in the
+ * {@link #TEST_FILTER_PROPERTY_NAME} system property.
+ * <p>
+ * To add a test-case, go to the resource directory that corresponds to the package of the {@link TemplateTestSuite}
+ * subclass and inside that directory:</p>
+ * <ol>
+ * <li>Add a new <tt>testcase</tt> element to <tt>testcases.xml</tt></li>
+ * <li>Add a template to <tt>templates/</tt> with fits the <tt>testcase</tt> added to the XML (by default it's the test
+ * case name + ".ftl")</li>
+ * <li>Add the expected output to <tt>references/</tt> with fits the <tt>testcase</tt> added to the XML (by default
+ * it's the test name + ".txt")</li>
+ * <li>If you want to add items to the data-model or change the {@link Configuration}, modify the
+ * {@link #setUpTestCase(String, Map, Configuration.ExtendableBuilder)}} method in the {@link TemplateTestSuite}
+ * subclass.</li>
+ * </ol>
+ */
+public abstract class TemplateTestSuite extends TestSuite {
+    
+    private static final String ELEM_TEST_CASE = "testCase";
+
+    private static final String ELEM_SETTING = "setting";
+
+    private static final String ATTR_NO_OUTPUT = "noOutput";
+
+    private static final String ATTR_EXPECTED = "expected";
+
+    private static final String ATTR_TEMPLATE = "template";
+
+    private static final String END_TEMPLATE_NAME_MARK = "[#endTN]";
+
+    public static final String CONFIGURATION_XML_FILE_NAME = "testcases.xml";
+
+    /**
+     * When setting this system property, only the tests whose name matches the
+     * given regular expression will be executed.
+     */
+    public static final String TEST_FILTER_PROPERTY_NAME = "freemareker.templateTestSuite.testFilter";
+    
+    /**
+     * Comma separated list of "incompatible improvements" versions to run the test cases with.
+     */
+    public static final String INCOMPATIBLE_IMPROVEMENTS_PROPERTY_NAME
+            = "freemareker.templateTestSuite.incompatibleImprovements";
+    
+    private final Map<String, String> testSuiteSettings = new LinkedHashMap<>();
+
+    private final ArrayList<Version> testSuiteIcis;
+
+    private final Pattern testCaseNameFilter;
+
+    public TemplateTestSuite() {
+        try {
+            NodeModel.useJaxenXPathSupport();
+
+            String filterStr = System.getProperty(TEST_FILTER_PROPERTY_NAME);
+            testCaseNameFilter = filterStr != null ? Pattern.compile(filterStr) : null;
+            if (testCaseNameFilter != null) {
+                System.out.println(
+                        "Note: " + TEST_FILTER_PROPERTY_NAME + " is " + _StringUtil.jQuote(testCaseNameFilter));
+            }
+
+            testSuiteIcis = new ArrayList<>();
+            String testedIcIsStr = System.getProperty(INCOMPATIBLE_IMPROVEMENTS_PROPERTY_NAME);
+            if (testedIcIsStr != null) {
+                for (String iciStr : testedIcIsStr.split(",")) {
+                    iciStr = iciStr.trim();
+                    if (iciStr.length() != 0) {
+                        testSuiteIcis.add(new Version(iciStr));
+                    }
+                }
+            }
+            if (testSuiteIcis.isEmpty()) {
+                testSuiteIcis.add(getMinIcIVersion());
+                testSuiteIcis.add(getMaxIcIVersion());
+            }
+
+            java.net.URL url = getClass().getResource(CONFIGURATION_XML_FILE_NAME);
+            if (url == null) {
+                throw new IOException("Resource not found: "
+                        + getClass().getName() + ", " + CONFIGURATION_XML_FILE_NAME);
+            }
+            processConfigXML(url.toURI());
+        } catch (Exception e) {
+            throw new IllegalStateException("Failed to initialize test suite", e);
+        }
+    }
+
+    /**
+     * At least with Gradle 3.5 TestSuite-s aren't run even if we explicitly include the class, unless we have a
+     * test method in them (which won't be run).
+     */
+    @Test
+    public final void gradleTestPluginWorkaround() {
+        // Does nothing
+    }
+
+    protected abstract void setUpTestCase(String simpleTestName, Map<String, Object> dataModel,
+            Configuration.ExtendableBuilder<?> confB) throws Exception;
+
+    /**
+     * Read the test case configurations file and build up the test suite.
+     */
+    private void processConfigXML(URI uri) throws Exception {
+        Element testCasesElem = loadXMLFromURL(uri);
+        
+        NodeList children = testCasesElem.getChildNodes();
+        for (int childIdx = 0; childIdx < children.getLength(); childIdx++) {
+            Node n = children.item(childIdx);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                final String nodeName = n.getNodeName();
+                if (nodeName.equals(ELEM_SETTING)) {
+                    NamedNodeMap attrs = n.getAttributes();
+                    for (int attrIdx = 0; attrIdx < attrs.getLength(); attrIdx++) {
+                        Attr attr = (Attr) attrs.item(attrIdx);
+                        testSuiteSettings.put(attr.getName(), attr.getValue());
+                    }
+                } else if (nodeName.equals(ELEM_TEST_CASE)) {
+                    for (TemplateTestCase testCase : createTestCasesFromElement((Element) n)) {
+                        addTest(testCase);
+                    }
+                }
+            }
+        }
+    }
+
+    private Element loadXMLFromURL(URI uri) throws ParserConfigurationException, SAXException, IOException {
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        // dbf.setValidating(true);
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        Document d = db.parse(uri.toString());
+        return d.getDocumentElement();
+    }
+    
+    String getTextInElement(Element e) {
+        StringBuilder buf = new StringBuilder();
+        NodeList children = e.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            short type = n.getNodeType();
+            if (type == Node.TEXT_NODE || type == Node.CDATA_SECTION_NODE) {
+                buf.append(n.getNodeValue());
+            }
+        }
+        return buf.toString();
+    }
+    
+    /**
+     * Returns the list of test cases generated from the {@link #ELEM_TEST_CASE} element.
+     * There can be multiple generated test cases because of "incompatible improvements" variations, or none because
+     * of the {@code nameFilter}.
+     */
+    private List<TemplateTestCase> createTestCasesFromElement(Element testCaseElem)
+            throws Exception {
+        final String caseName = _StringUtil.emptyToNull(testCaseElem.getAttribute("name"));
+        if (caseName == null) throw new Exception("Invalid XML: the \"name\" attribute is mandatory.");
+        
+        if (testCaseNameFilter != null
+                && !testCaseNameFilter.matcher(caseName).matches()) {
+            return Collections.emptyList();
+        }
+        
+        final String templateName;
+        final String expectedFileName;
+        {
+            final String beforeEndTN;
+            final String afterEndTN;
+            {
+                int tBNameSep = caseName.indexOf(END_TEMPLATE_NAME_MARK);
+                beforeEndTN = tBNameSep == -1 ? caseName : caseName.substring(0, tBNameSep);
+                afterEndTN = tBNameSep == -1
+                        ? "" : caseName.substring(tBNameSep + END_TEMPLATE_NAME_MARK.length());
+            }
+            
+            {
+                String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_TEMPLATE));
+                templateName = s != null ? s : beforeEndTN + ".ftl";
+            }
+    
+            {
+                String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_EXPECTED));
+                expectedFileName = s != null ? s : beforeEndTN + afterEndTN + ".txt";
+            }
+        }
+        
+        final boolean noOutput;
+        {
+            String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_NO_OUTPUT));
+            noOutput = s != null && _StringUtil.getYesNo(s);
+        }
+
+        final Map<String, String> testCaseSettings = getCaseFMSettings(testCaseElem);
+        
+        final List<Version> icisToTest;
+        {
+            final String testCaseIcis = testCaseSettings.get(Configuration.ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY);
+                    
+            icisToTest = testCaseIcis != null ? parseVersionList(testCaseIcis) : testSuiteIcis;
+            if (icisToTest.isEmpty()) {
+                throw new Exception("The incompatible_improvement list was empty");
+            }
+        }
+
+        List<TemplateTestCase> result = new ArrayList<>();
+        for (Version iciToTest : icisToTest) {
+            TemplateTestCase testCase = new TemplateTestCase(
+                    this,
+                    caseName + "(ici=" + iciToTest + ")", caseName,
+                    templateName, expectedFileName, noOutput, iciToTest);
+            for (Map.Entry<String, String> setting : testSuiteSettings.entrySet()) {
+                testCase.setSetting(setting.getKey(), setting.getValue());
+            }
+            for (Map.Entry<String, String> setting : testCaseSettings.entrySet()) {
+                testCase.setSetting(setting.getKey(), setting.getValue());
+            }
+            
+            result.add(testCase);
+        }
+        
+        return result;
+    }
+
+    private List<Version> parseVersionList(String versionsStr) {
+        List<Version> versions = new ArrayList<>();
+        for (String versionStr : versionsStr.split(",")) {
+            versionStr = versionStr.trim();
+            if (versionStr.length() != 0) {
+                final Version v;
+                if ("min".equals(versionStr)) {
+                    v = getMinIcIVersion();
+                } else if ("max".equals(versionStr)) {
+                    v = getMaxIcIVersion();
+                } else {
+                    v = new Version(versionStr);
+                }
+                if (!versions.contains(v)) {
+                    versions.add(v);
+                }
+            }
+        }
+        return versions;
+    }
+
+    private Version getMaxIcIVersion() {
+        Version v = Configuration.getVersion();
+        // Remove nightly, RC and such:
+        return new Version(v.getMajor(), v.getMinor(), v.getMicro());
+    }
+
+    private Version getMinIcIVersion() {
+        return Configuration.VERSION_3_0_0;
+    }
+
+    private Map<String, String> getCaseFMSettings(Element e) {
+        final Map<String, String> caseFMSettings;
+        caseFMSettings = new LinkedHashMap<>();
+        NodeList settingElems = e.getElementsByTagName(ELEM_SETTING);
+        for (int elemIdx = 0; elemIdx < settingElems.getLength(); elemIdx++) {
+            NamedNodeMap attrs = settingElems.item(elemIdx).getAttributes();
+            for (int attrIdx = 0; attrIdx < attrs.getLength(); attrIdx++) {
+                Attr attr = (Attr) attrs.item(attrIdx);
+
+                final String settingName = attr.getName();
+                caseFMSettings.put(settingName, attr.getValue());
+            }
+        }
+        return caseFMSettings;
+    }
+
+    /**
+     * Override this if you want to check something in the main {@link Template} before running the test.
+     */
+    protected void validateTemplate(Template template) {
+        // Does nothing by default
+    }
+}



[14/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt
new file mode 100644
index 0000000..2048ac5
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: List Literal Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now perform a list assignment:</p>
+
+
+The list contains 5 items.
+
+<p>test1</p>
+<p>test23</p>
+<p>test45</p>
+<p>Hello, world!</p>
+<p>hello</p>
+
+<p>Now update the assignment and repeat:</p>
+
+
+<p>test1</p>
+<p>test23</p>
+<p>test45</p>
+<p>Hello, world!</p>
+<p>hello</p>
+
+<p>Now reassign the list and repeat:</p>
+
+
+<p>bar</p>
+<p>Temporary</p>
+<p>test1</p>
+<p>test23</p>
+
+<p>Silly, but necessary tests, for one and zero element lists:</p>
+
+
+<p>Hello, world</p>
+
+<p>Zero item test:</p>
+
+
+
+<p>Dumb test for number literals -- these weren't working as expected:</p>
+
+
+<p>1</p>
+<p>2</p>
+<p>3</p>
+<p>5</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt
new file mode 100644
index 0000000..bd3c87d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Localization Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>G'day, mate!</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt
new file mode 100644
index 0000000..4fa6b2a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Logging Test</title>
+</head>
+<body>
+
+A simple test follows:
+
+ERROR [org.apache.freemarker.core.Template]: message is not a TemplateHashModel, it's a freemarker.template.SimpleScalar.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt
new file mode 100644
index 0000000..25c20ac
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+---
+  2
+  -     L1 1
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+  -     L1 2
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+  -     L1 3
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+*
+  1
+  -     L1 1
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+  -     L1 2
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+  -     L1 3
+  -       L2 1: 1; 2; 3; 
+  -       L2 2: 1; 2; 3; 
+*
+*
+---
+  1 0.5
+  2 1
+  3 1.5
+  4 2 Last!
+123.4
+---
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt
new file mode 100644
index 0000000..5aa47ff
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+m{
+m{
+m{
+b{
+m:b{
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt
new file mode 100644
index 0000000..680a08e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Function Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now perform function tests:</p>
+
+
+<p>Function is defined, now let's call it:</p>
+
+    <a href="/home.html">
+        <img src="/images/home.png" border="0" alt="Home">
+    </a>
+    Kilroy was here.
+
+<p>Again, but with different parameters:</p>
+
+    <a href="/about.html">
+        <img src="/image/about-us.jpeg" border="0" alt="About Us">
+    </a>
+    Kilroy was here.
+
+   Good.
+
+<p>A recursive function call:</p>
+
+
+    0
+    1
+    2
+    3
+
+<p>Test "catch-all" macro parameter:</p>
+
+
+foo=a baz=[]
+foo=a baz=[bar=b]
+foo=a baz=[bar=b, baz=c]
+
+
+Hello World! Today is Monday.
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt
new file mode 100644
index 0000000..1b4e007
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+1 1
+2 2
+4
+m3 with d="4" Failed!

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt
new file mode 100644
index 0000000..54ec68d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Test of Multiple Model implementations</title>
+</head>
+<body>
+
+<p>Let's begin with a simple model:</p>
+<p>Hello, world!</p>
+
+<p>Cool, now get into the first model. This implements a scalar, list, and
+hash as a single class. Let's try some tests...</p>
+
+<p>MultiModel1 as a string!</p>
+
+<p>Now as a list...</p>
+
+Model1 value: 0<br />
+Model1 value: 1<br />
+Model1 value: 2<br />
+Model1 value: 3<br />
+Model1 value: 4<br />
+Model1 value: 5<br />
+Model1 value: 6<br />
+Model1 value: 7<br />
+Model1 value: 8<br />
+Model1 value: 9<br />
+Model3 is alive!<br />
+
+<p>Index into a list...</p>
+<p>Model1 value: 1</p>
+<p>List size is: Nasty!</p>
+<p>List size is: Nasty!</p>
+
+<p>Now, again, as a hash. First using dot notation, then using [] notation:</p>
+
+<p>Selftest of a hash from MultiModel1</p>
+<p>Selftest of a hash from MultiModel1</p>
+
+<p>Now for the tricky stuff... use a model to index into another model...</p>
+<p>selftest</p>
+<p>Selftest of a hash from MultiModel1</p>
+<p>self</p>
+<p>Selftest of a hash from MultiModel1</p>
+
+<p>Same thing, this time a List index...</p>
+<p>0</p>
+<p>Model1 value: 0</p>
+<p>Model1 value: 1</p>
+
+<p>Now, do the same recursively...</p>
+<p>MultiModel1 as a string!</p>
+<p>Model2 is alive!</p>
+<p>Arguments are:<br />test<br /></p>
+<p>Arguments are:<br />MultiModel1 as a string!<br />Selftest of a hash from MultiModel1<br />Hello, world!<br /></p>
+
+<p>Does this really not work?</p>
+<p>Model3 is alive!</p>
+<p>Selftest from MultiModel3!</p>
+<p>Hello world from MultiModel3!</p>
+
+<p>(Again, with Hashes)</p>
+<p>Model3 is alive!</p>
+<p>Selftest from MultiModel3!</p>
+
+<p>Model3 is alive!</p>
+<p>Selftest from MultiModel3!</p>
+<p>Selftest from MultiModel3!</p>
+
+<p>As I suspected! (Manual on Expressions needs updating.)</p>
+
+<p>Second test on list size</p>
+<p>Key size, not the listSize method.</p>
+<p>Key size, not the listSize method.</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt
new file mode 100644
index 0000000..bcfb104
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+    test 3/1: undefined undefined undefined 
+    test 3/2: undefined undefined undefined 
+    test 3/3: undefined undefined undefined 
+
+    test 3/1: Y X Count 1 
+    test 3/2: Y X Count 2 
+    test 3/3: Y X Count 3 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt
new file mode 100644
index 0000000..b8384c7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+fails
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt
new file mode 100644
index 0000000..35e7a3e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+works
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt
new file mode 100644
index 0000000..9d8e883
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+works
+fails
+
+works
+works
+
+works
+fails
+
+works
+fails
+
+works
+works
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt
new file mode 100644
index 0000000..bc58731
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Newlines Test</title>
+</head>
+<body>
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt
new file mode 100644
index 0000000..c131421
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Newlines the Second Test</title>
+</head>
+<body>
+<p>A simple test follows:</p>
+
+<p>Hello, world!
+</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt
new file mode 100644
index 0000000..5e8486c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: NoParse Test</title>
+</head>
+<body>
+
+A simple test follows:
+
+${message}
+
+A more rigorous test, showing that we're not faking it:
+
+${message@#$%&}
+
+	<p>Message exists!
+		...and even generates output!
+		<#if message>
+			Nested statements are ok, too.
+		</#if>
+	</p>
+
+Here's another edge case, this time, trying to output a &lt;noparse&gt;
+inside another &lt;noparse&gt;
+
+
+This is what the noparse instruction looks like:
+
+<#noparse>This part of the template wont be parsed by the 
+FreeMarker parser. Instead, it will be treated as verbatim text information,
+and output as such.</#noparse>
+
+The rest of the template appears here.
+
+Simple.
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt
new file mode 100644
index 0000000..a6f8475
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+1
+1
+1 234 567,89
+1234567.886
+1,00
+1
+1234567,89
+1234567.886
+1
+1
+1.000000000000001
+0.0000000000000001
+-0.0000000000000001
+1
+0.0000000000000001

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt
new file mode 100644
index 0000000..b80bc85
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Number Literal Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now perform a number assignment:</p>
+
+1,3
+
+
+My number is: 1,8
+My float is: 1.800000
+The int part is: 1
+
+
+1.83
+
+<p>Now use numbers in assignment</p>
+
+6
+
+8
+
+<p>Try numbers in tests</p>
+
+MyMessage is not 152, its: 8.
+
+<if (mymessage > 5)>
+   MyMessage is greater than five.
+</if
+
+		MyMessage is: 8.
+
+<p>Now for numbers in dynamic keys:</p>
+
+
+one
+three
+
+<p>Numbers in hashes:</p>
+
+twelve
+twelve
+twelve
+
+
+<p>Numbers in method calls:</p>
+
+Single argument value is: 1
+Single argument value is: 1
+Single argument value is: 12
+Single argument value is: 3
+Single argument value is: 3
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt
new file mode 100644
index 0000000..bc8a10e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
+2011-05-16 == 2011-05-16
+19:47:55.54Z == 19:47:55.54Z
+
+2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
+2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
+2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
+2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
+1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z
+1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z
+1970-01-01T00:00:00Z == 1970-01-01T00:00:00Z
+
+failed

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt
new file mode 100644
index 0000000..3bf6cd0
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt
@@ -0,0 +1,462 @@
+/*
+ * 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.
+ */
+
+?int:
+    0?int=0
+    1?int=1
+    -1?int=-1
+    0.5?int=0
+    1.5?int=1
+    -0.5?int=0
+    -1.5?int=-1
+    0.25?int=0
+    -0.25?int=0
+    1.75?int=1
+    -1.75?int=-1
+    1.01?int=1
+    -1.01?int=-1
+    0.01?int=0
+    -0.01?int=0
+    127?int=127
+    128?int=128
+    -127?int=-127
+    -128?int=-128
+    32767?int=32767
+    32768?int=32768
+    -32767?int=-32767
+    -32768?int=-32768
+    2147483647?int=2147483647
+    2147483648?int=-2147483648
+    -2147483647?int=-2147483647
+    -2147483648?int=-2147483648
+    4294967295?int=-1
+    4294967296?int=0
+    -4294967295?int=1
+    -4294967296?int=0
+    2147483647.1?int=2147483647
+    2147483648.1?int=-2147483648
+    -2147483647.1?int=-2147483647
+    -2147483648.1?int=-2147483648
+    4294967295.1?int=-1
+    4294967296.1?int=0
+    -4294967295.1?int=1
+    -4294967296.1?int=0
+    2147483647.5?int=2147483647
+    2147483648.5?int=-2147483648
+    -2147483647.5?int=-2147483647
+    -2147483648.5?int=-2147483648
+    4294967295.5?int=-1
+    4294967296.5?int=0
+    -4294967295.5?int=1
+    -4294967296.5?int=0
+
+?double
+    0?double=0
+    1?double=1
+    -1?double=-1
+    0.5?double=0.5
+    1.5?double=1.5
+    -0.5?double=-0.5
+    -1.5?double=-1.5
+    0.25?double=0.25
+    -0.25?double=-0.25
+    1.75?double=1.75
+    -1.75?double=-1.75
+    1.01?double=1.01
+    -1.01?double=-1.01
+    0.01?double=0.01
+    -0.01?double=-0.01
+    127?double=127
+    128?double=128
+    -127?double=-127
+    -128?double=-128
+    32767?double=32767
+    32768?double=32768
+    -32767?double=-32767
+    -32768?double=-32768
+    2147483647?double=2147483647
+    2147483648?double=2147483648
+    -2147483647?double=-2147483647
+    -2147483648?double=-2147483648
+    4294967295?double=4294967295
+    4294967296?double=4294967296
+    -4294967295?double=-4294967295
+    -4294967296?double=-4294967296
+    2147483647.1?double=2147483647.1
+    2147483648.1?double=2147483648.1
+    -2147483647.1?double=-2147483647.1
+    -2147483648.1?double=-2147483648.1
+    4294967295.1?double=4294967295.1
+    4294967296.1?double=4294967296.1
+    -4294967295.1?double=-4294967295.1
+    -4294967296.1?double=-4294967296.1
+    2147483647.5?double=2147483647.5
+    2147483648.5?double=2147483648.5
+    -2147483647.5?double=-2147483647.5
+    -2147483648.5?double=-2147483648.5
+    4294967295.5?double=4294967295.5
+    4294967296.5?double=4294967296.5
+    -4294967295.5?double=-4294967295.5
+    -4294967296.5?double=-4294967296.5
+
+?long
+    0?long=0
+    1?long=1
+    -1?long=-1
+    0.5?long=0
+    1.5?long=1
+    -0.5?long=0
+    -1.5?long=-1
+    0.25?long=0
+    -0.25?long=0
+    1.75?long=1
+    -1.75?long=-1
+    1.01?long=1
+    -1.01?long=-1
+    0.01?long=0
+    -0.01?long=0
+    127?long=127
+    128?long=128
+    -127?long=-127
+    -128?long=-128
+    32767?long=32767
+    32768?long=32768
+    -32767?long=-32767
+    -32768?long=-32768
+    2147483647?long=2147483647
+    2147483648?long=2147483648
+    -2147483647?long=-2147483647
+    -2147483648?long=-2147483648
+    4294967295?long=4294967295
+    4294967296?long=4294967296
+    -4294967295?long=-4294967295
+    -4294967296?long=-4294967296
+    2147483647.1?long=2147483647
+    2147483648.1?long=2147483648
+    -2147483647.1?long=-2147483647
+    -2147483648.1?long=-2147483648
+    4294967295.1?long=4294967295
+    4294967296.1?long=4294967296
+    -4294967295.1?long=-4294967295
+    -4294967296.1?long=-4294967296
+    2147483647.5?long=2147483647
+    2147483648.5?long=2147483648
+    -2147483647.5?long=-2147483647
+    -2147483648.5?long=-2147483648
+    4294967295.5?long=4294967295
+    4294967296.5?long=4294967296
+    -4294967295.5?long=-4294967295
+    -4294967296.5?long=-4294967296
+
+?long from date
+    1304877615000 = 1304877615000
+
+?float
+    0?float=0
+    1?float=1
+    -1?float=-1
+    0.5?float=0.5
+    1.5?float=1.5
+    -0.5?float=-0.5
+    -1.5?float=-1.5
+    0.25?float=0.25
+    -0.25?float=-0.25
+    1.75?float=1.75
+    -1.75?float=-1.75
+    1.01?float=1.00999999
+    -1.01?float=-1.00999999
+    0.01?float=0.01
+    -0.01?float=-0.01
+    127?float=127
+    128?float=128
+    -127?float=-127
+    -128?float=-128
+    32767?float=32767
+    32768?float=32768
+    -32767?float=-32767
+    -32768?float=-32768
+    2147483647?float=2147483648
+    2147483648?float=2147483648
+    -2147483647?float=-2147483648
+    -2147483648?float=-2147483648
+    4294967295?float=4294967296
+    4294967296?float=4294967296
+    -4294967295?float=-4294967296
+    -4294967296?float=-4294967296
+    2147483647.1?float=2147483648
+    2147483648.1?float=2147483648
+    -2147483647.1?float=-2147483648
+    -2147483648.1?float=-2147483648
+    4294967295.1?float=4294967296
+    4294967296.1?float=4294967296
+    -4294967295.1?float=-4294967296
+    -4294967296.1?float=-4294967296
+    2147483647.5?float=2147483648
+    2147483648.5?float=2147483648
+    -2147483647.5?float=-2147483648
+    -2147483648.5?float=-2147483648
+    4294967295.5?float=4294967296
+    4294967296.5?float=4294967296
+    -4294967295.5?float=-4294967296
+    -4294967296.5?float=-4294967296
+
+?byte
+    0?byte=0
+    1?byte=1
+    -1?byte=-1
+    0.5?byte=0
+    1.5?byte=1
+    -0.5?byte=0
+    -1.5?byte=-1
+    0.25?byte=0
+    -0.25?byte=0
+    1.75?byte=1
+    -1.75?byte=-1
+    1.01?byte=1
+    -1.01?byte=-1
+    0.01?byte=0
+    -0.01?byte=0
+    127?byte=127
+    128?byte=-128
+    -127?byte=-127
+    -128?byte=-128
+    32767?byte=-1
+    32768?byte=0
+    -32767?byte=1
+    -32768?byte=0
+    2147483647?byte=-1
+    2147483648?byte=0
+    -2147483647?byte=1
+    -2147483648?byte=0
+    4294967295?byte=-1
+    4294967296?byte=0
+    -4294967295?byte=1
+    -4294967296?byte=0
+    2147483647.1?byte=-1
+    2147483648.1?byte=0
+    -2147483647.1?byte=1
+    -2147483648.1?byte=0
+    4294967295.1?byte=-1
+    4294967296.1?byte=0
+    -4294967295.1?byte=1
+    -4294967296.1?byte=0
+    2147483647.5?byte=-1
+    2147483648.5?byte=0
+    -2147483647.5?byte=1
+    -2147483648.5?byte=0
+    4294967295.5?byte=-1
+    4294967296.5?byte=0
+    -4294967295.5?byte=1
+    -4294967296.5?byte=0
+
+?short
+    0?short=0
+    1?short=1
+    -1?short=-1
+    0.5?short=0
+    1.5?short=1
+    -0.5?short=0
+    -1.5?short=-1
+    0.25?short=0
+    -0.25?short=0
+    1.75?short=1
+    -1.75?short=-1
+    1.01?short=1
+    -1.01?short=-1
+    0.01?short=0
+    -0.01?short=0
+    127?short=127
+    128?short=128
+    -127?short=-127
+    -128?short=-128
+    32767?short=32767
+    32768?short=-32768
+    -32767?short=-32767
+    -32768?short=-32768
+    2147483647?short=-1
+    2147483648?short=0
+    -2147483647?short=1
+    -2147483648?short=0
+    4294967295?short=-1
+    4294967296?short=0
+    -4294967295?short=1
+    -4294967296?short=0
+    2147483647.1?short=-1
+    2147483648.1?short=0
+    -2147483647.1?short=1
+    -2147483648.1?short=0
+    4294967295.1?short=-1
+    4294967296.1?short=0
+    -4294967295.1?short=1
+    -4294967296.1?short=0
+    2147483647.5?short=-1
+    2147483648.5?short=0
+    -2147483647.5?short=1
+    -2147483648.5?short=0
+    4294967295.5?short=-1
+    4294967296.5?short=0
+    -4294967295.5?short=1
+    -4294967296.5?short=0
+
+?floor
+    0?floor=0
+    1?floor=1
+    -1?floor=-1
+    0.5?floor=0
+    1.5?floor=1
+    -0.5?floor=-1
+    -1.5?floor=-2
+    0.25?floor=0
+    -0.25?floor=-1
+    1.75?floor=1
+    -1.75?floor=-2
+    1.01?floor=1
+    -1.01?floor=-2
+    0.01?floor=0
+    -0.01?floor=-1
+    127?floor=127
+    128?floor=128
+    -127?floor=-127
+    -128?floor=-128
+    32767?floor=32767
+    32768?floor=32768
+    -32767?floor=-32767
+    -32768?floor=-32768
+    2147483647?floor=2147483647
+    2147483648?floor=2147483648
+    -2147483647?floor=-2147483647
+    -2147483648?floor=-2147483648
+    4294967295?floor=4294967295
+    4294967296?floor=4294967296
+    -4294967295?floor=-4294967295
+    -4294967296?floor=-4294967296
+    2147483647.1?floor=2147483647
+    2147483648.1?floor=2147483648
+    -2147483647.1?floor=-2147483648
+    -2147483648.1?floor=-2147483649
+    4294967295.1?floor=4294967295
+    4294967296.1?floor=4294967296
+    -4294967295.1?floor=-4294967296
+    -4294967296.1?floor=-4294967297
+    2147483647.5?floor=2147483647
+    2147483648.5?floor=2147483648
+    -2147483647.5?floor=-2147483648
+    -2147483648.5?floor=-2147483649
+    4294967295.5?floor=4294967295
+    4294967296.5?floor=4294967296
+    -4294967295.5?floor=-4294967296
+    -4294967296.5?floor=-4294967297
+
+?ceiling
+    0?ceiling=0
+    1?ceiling=1
+    -1?ceiling=-1
+    0.5?ceiling=1
+    1.5?ceiling=2
+    -0.5?ceiling=0
+    -1.5?ceiling=-1
+    0.25?ceiling=1
+    -0.25?ceiling=0
+    1.75?ceiling=2
+    -1.75?ceiling=-1
+    1.01?ceiling=2
+    -1.01?ceiling=-1
+    0.01?ceiling=1
+    -0.01?ceiling=0
+    127?ceiling=127
+    128?ceiling=128
+    -127?ceiling=-127
+    -128?ceiling=-128
+    32767?ceiling=32767
+    32768?ceiling=32768
+    -32767?ceiling=-32767
+    -32768?ceiling=-32768
+    2147483647?ceiling=2147483647
+    2147483648?ceiling=2147483648
+    -2147483647?ceiling=-2147483647
+    -2147483648?ceiling=-2147483648
+    4294967295?ceiling=4294967295
+    4294967296?ceiling=4294967296
+    -4294967295?ceiling=-4294967295
+    -4294967296?ceiling=-4294967296
+    2147483647.1?ceiling=2147483648
+    2147483648.1?ceiling=2147483649
+    -2147483647.1?ceiling=-2147483647
+    -2147483648.1?ceiling=-2147483648
+    4294967295.1?ceiling=4294967296
+    4294967296.1?ceiling=4294967297
+    -4294967295.1?ceiling=-4294967295
+    -4294967296.1?ceiling=-4294967296
+    2147483647.5?ceiling=2147483648
+    2147483648.5?ceiling=2147483649
+    -2147483647.5?ceiling=-2147483647
+    -2147483648.5?ceiling=-2147483648
+    4294967295.5?ceiling=4294967296
+    4294967296.5?ceiling=4294967297
+    -4294967295.5?ceiling=-4294967295
+    -4294967296.5?ceiling=-4294967296
+
+?round
+    0?round=0
+    1?round=1
+    -1?round=-1
+    0.5?round=1
+    1.5?round=2
+    -0.5?round=0
+    -1.5?round=-1
+    0.25?round=0
+    -0.25?round=0
+    1.75?round=2
+    -1.75?round=-2
+    1.01?round=1
+    -1.01?round=-1
+    0.01?round=0
+    -0.01?round=0
+    127?round=127
+    128?round=128
+    -127?round=-127
+    -128?round=-128
+    32767?round=32767
+    32768?round=32768
+    -32767?round=-32767
+    -32768?round=-32768
+    2147483647?round=2147483647
+    2147483648?round=2147483648
+    -2147483647?round=-2147483647
+    -2147483648?round=-2147483648
+    4294967295?round=4294967295
+    4294967296?round=4294967296
+    -4294967295?round=-4294967295
+    -4294967296?round=-4294967296
+    2147483647.1?round=2147483647
+    2147483648.1?round=2147483648
+    -2147483647.1?round=-2147483647
+    -2147483648.1?round=-2147483648
+    4294967295.1?round=4294967295
+    4294967296.1?round=4294967296
+    -4294967295.1?round=-4294967295
+    -4294967296.1?round=-4294967296
+    2147483647.5?round=2147483648
+    2147483648.5?round=2147483649
+    -2147483647.5?round=-2147483647
+    -2147483648.5?round=-2147483648
+    4294967295.5?round=4294967296
+    4294967296.5?round=4294967297
+    -4294967295.5?round=-4294967295
+    -4294967296.5?round=-4294967296

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt
new file mode 100644
index 0000000..3b5215a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+Output charset: UTF-8
+URL escaping charset: undefined
+
+a%FE%FF%00%2F%00%25b
+a%FE%FF%00%2F%00%25b
+a%2F%25b
+a%2F%25b
+a%FE%FF%00%2F%00%25b
+a%2F%25b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt
new file mode 100644
index 0000000..6956b6c
Binary files /dev/null and b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt differ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt
new file mode 100644
index 0000000..c0369f6
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+Output charset: ISO-8859-1
+URL escaping charset: UTF-16
+
+UTF-16: a%FE%FF%00%2F%00%25b
+ISO-8859-1: a%2F%25b
+UTF-16: a%FE%FF%00%2F%00%25b
+ISO-8859-1: a%2F%25b
+ISO-8859-1: a%2F%25b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt
new file mode 100644
index 0000000..b19cb31
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Operator Precedence Test</title>
+</head>
+<body>
+
+@@@@@@@@@@@
+
+<br />
+<br />
+
+##########
+
+<br />
+<br />
+
+&&&&&&&&&&&
+
+<br />
+<br />
+
+!!!!!!!!!!!
+
+<br />
+<br />
+
+$$$$$$$$$$$
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt
new file mode 100644
index 0000000..880cea3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+ Hello, World
+ Well, that did not work.
+ Now we nest another attempt/recover here:
+   Oops...
+   Remember, freeMarker sequences are zero-based! Hello, World
+ Now we check the current error message.
+  The template is not currently available
+  The included template had a problem.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt
new file mode 100644
index 0000000..041222c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Root Lookup Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Access the same variable via the root variable (dot syntax):</p>
+
+<p>Hello, world!</p>
+
+<p>Access the same variable via the root variable (bracket syntax):</p>
+
+<p>Hello, world!</p>
+
+<p>Ensure that root lookups are unaffected by local variables:</p>
+
+
+  Hello, world!
+  Hello, world! Part Deux
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt
new file mode 100644
index 0000000..4f7796a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt
@@ -0,0 +1,404 @@
+/*
+ * 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.
+ */
+Sorting scalars:
+----------------
+
+String order:
+- aardvark
+- Barbara
+- beetroot
+- whale
+- zeppelin
+
+First: aardvark
+Last: zeppelin
+Size 5
+
+Numerical order:
+- -324
+- -34
+- 0
+- 0.1
+- 0.11
+- 1
+- 5
+- 111
+- 123
+- 543
+
+First: -324
+Last: 543
+Size 10
+
+Date/time order:
+- 06:05
+- 08:05
+- 08:15
+- 18:00
+
+Boolean order:
+- false
+- false
+- true
+- true
+
+
+Sorting hashes:
+---------------
+
+Order by name:
+- aardvark: 30
+- Barbara: 53
+- beetroot: 0.3
+- whale: 2000
+- zeppelin: -200
+
+Order by weight:
+- zeppelin: -200
+- beetroot: 0.3
+- aardvark: 30
+- Barbara: 53
+- whale: 2000
+
+Order by a.x.v:
+- aqweqw
+- dfgdf
+- qweqw
+- utyu
+
+Order by a.y, which is a date:
+- 1998-02-20
+- 1999-01-20
+- 1999-04-19
+- 1999-04-20
+
+Reverse:
+--------
+
+Order by weight desc:
+- whale: 2000
+- Barbara: 53
+- aardvark: 30
+- beetroot: 0.3
+- zeppelin: -200
+
+Order by weight desc desc:
+- zeppelin: -200
+- beetroot: 0.3
+- aardvark: 30
+- Barbara: 53
+- whale: 2000
+
+Order by weight desc desc desc:
+- whale: 2000
+- Barbara: 53
+- aardvark: 30
+- beetroot: 0.3
+- zeppelin: -200
+
+Contains:
+---------
+
+True:
+true
+true
+true
+true
+true
+true
+true
+
+False:
+false
+false
+false
+false
+false
+false
+false
+
+False: false
+
+Index_of:
+---------
+
+0 = 0
+1 = 1
+2 = 2
+6 = 6
+0 = 0
+1 = 1
+2 = 2
+
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+
+-1 = -1
+
+Last_index_of:
+--------------
+
+6 = 6
+1 = 1
+2 = 2
+7 = 7
+-1 = -1
+0 = 0
+1 = 1
+2 = 2
+-1 = -1
+
+Index_of and last_index_of with starting indices
+------------------------------------------------
+
+seq_index_of "Joe":
+0 = 0
+0 = 0
+0 = 0
+2 = 2
+2 = 2
+-1 = -1
+-1 = -1
+ 
+seq_last_index_of "Joe":
+-1 = -1
+-1 = -1
+0 = 0
+0 = 0
+2 = 2
+2 = 2
+2 = 2
+ 
+seq_index_of "Susan":
+3 = 3
+3 = 3
+3 = 3
+3 = 3
+3 = 3
+3 = 3
+-1 = -1
+ 
+seq_last_index_of "Susan":
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+3 = 3
+3 = 3
+
+seq_index_of "a":
+0 = 0
+0 = 0
+0 = 0
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+
+seq_index_of "b":
+1 = 1
+1 = 1
+1 = 1
+1 = 1
+-1 = -1
+-1 = -1
+
+seq_index_of "c":
+2 = 2
+2 = 2
+2 = 2
+2 = 2
+2 = 2
+-1 = -1
+ 
+seq_last_index_of "a":
+-1 = -1
+-1 = -1
+0 = 0
+0 = 0
+0 = 0
+0 = 0
+0 = 0
+
+seq_last_index_of "b":
+-1 = -1
+-1 = -1
+-1 = -1
+1 = 1
+1 = 1
+1 = 1
+
+seq_last_index_of "c":
+-1 = -1
+-1 = -1
+-1 = -1
+-1 = -1
+2 = 2
+2 = 2
+
+Sequence builtins ignoring nulls
+--------------------------------
+
+true = true
+2 = 2
+0 = 0
+
+These should throw exception, but for BC they don't:
+false = false
+-1 = -1
+-1 = -1
+
+Sequence built-ins failing on date-type mismatch
+------------------------------------------------
+
+
+Chunk
+-----
+
+columns = 1, fill = NULL:
+  Rows: 7
+    a   <-- Columns: 1
+    b   <-- Columns: 1
+    c   <-- Columns: 1
+    d   <-- Columns: 1
+    e   <-- Columns: 1
+    f   <-- Columns: 1
+    g   <-- Columns: 1
+  
+columns = 2, fill = NULL:
+  Rows: 4
+    a b   <-- Columns: 2
+    c d   <-- Columns: 2
+    e f   <-- Columns: 2
+    g   <-- Columns: 1
+  
+columns = 3, fill = NULL:
+  Rows: 3
+    a b c   <-- Columns: 3
+    d e f   <-- Columns: 3
+    g   <-- Columns: 1
+  
+columns = 4, fill = NULL:
+  Rows: 2
+    a b c d   <-- Columns: 4
+    e f g   <-- Columns: 3
+  
+columns = 5, fill = NULL:
+  Rows: 2
+    a b c d e   <-- Columns: 5
+    f g   <-- Columns: 2
+  
+columns = 10, fill = NULL:
+  Rows: 1
+    a b c d e f g   <-- Columns: 7
+  
+columns = 1, fill = -:
+  Rows: 7
+    a   <-- Columns: 1
+    b   <-- Columns: 1
+    c   <-- Columns: 1
+    d   <-- Columns: 1
+    e   <-- Columns: 1
+    f   <-- Columns: 1
+    g   <-- Columns: 1
+  
+columns = 2, fill = -:
+  Rows: 4
+    a b   <-- Columns: 2
+    c d   <-- Columns: 2
+    e f   <-- Columns: 2
+    g -   <-- Columns: 2
+  
+columns = 3, fill = -:
+  Rows: 3
+    a b c   <-- Columns: 3
+    d e f   <-- Columns: 3
+    g - -   <-- Columns: 3
+  
+columns = 4, fill = -:
+  Rows: 2
+    a b c d   <-- Columns: 4
+    e f g -   <-- Columns: 4
+  
+columns = 5, fill = -:
+  Rows: 2
+    a b c d e   <-- Columns: 5
+    f g - - -   <-- Columns: 5
+  
+columns = 10, fill = -:
+  Rows: 1
+    a b c d e f g - - -   <-- Columns: 10
+  
+columns = 3, fill = NULL:
+  Rows: 3
+    1 2 3   <-- Columns: 3
+    4 5 6   <-- Columns: 3
+    7 8 9   <-- Columns: 3
+  
+columns = 3, fill = -:
+  Rows: 3
+    1 2 3   <-- Columns: 3
+    4 5 6   <-- Columns: 3
+    7 8 9   <-- Columns: 3
+  
+columns = 3, fill = NULL:
+  Rows: 1
+    1   <-- Columns: 1
+  
+columns = 3, fill = -:
+  Rows: 1
+    1 - -   <-- Columns: 3
+  
+columns = 3, fill = NULL:
+  Rows: 0
+  
+columns = 3, fill = -:
+  Rows: 0
+  
+
+
+
+Join
+----
+
+- 1, two, three, 4
+- 
+- 1, two, three, 4.
+- (empty)
+- a, c
+- a, c
+- a, c.
+- 
+- (empty)
+- (empty)
+- a, b, c.
+- a, b, c.
+
+
+Misc
+----
+
+First of set 1: a
+First of set 2: a
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt
new file mode 100644
index 0000000..e2fa13e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+en == en
+en_US == en_US
+utf-8 == utf-8
+specialvars.ftl == specialvars.ftl
+iso-8859-1 == iso-8859-1
+x == x
+true == true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt
new file mode 100644
index 0000000..ba14e7f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+List mode:
+Size: 4
+[L16][L27][L38][L49]
+[L16][L27][L38][L49]
+
+Iterator mode:
+[L16][L27][L38][L49]
+[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)]
+[L16][L27][L38][L49]
+
+Iterator mode changes to list mode:
+[L16]/4[L27]/4[L38]/4[L49]/4
+[L16][L27][L38][L49]
+
+Iterator mode changes to list mode 2:
+[L16][L27][L38][L49]
+[L16]/4[L27]/4[L38]/4[L49]/4
+
+List mode with embedded iteration:
+[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)]
+
+Entire input match:
+- M: L16
+    - G: L16
+    - G: 1
+    - G: 6
+- M: L27
+    - G: L27
+    - G: 2
+    - G: 7
+- M: L38
+    - G: L38
+    - G: 3
+    - G: 8
+- M: L49
+    - G: L49
+    - G: 4
+    - G: 9
+firstGS was: L16, 1, 6
+
+Entire input match 2:
+Matches: true
+- G: x12
+- G: 1
+- G: 2
+As list:
+- M: x12
+    - G: x12
+    - G: 1
+    - G: 2
+Groups again:
+- G: x12
+- G: 1
+- G: 2
+
+Entire input match 3:
+Matches: false
+
+Entire input match 4:
+Matches: true
+- G: x12
+- G: 1
+- G: 2
+
+Substring match nested into entire input match:
+- G: x12 ([x12{x12, 1, 2}])
+- G: 1 ([x12{x12, 1, 2}])
+- G: 2 ([x12{x12, 1, 2}])
+
+Different entire input and substring matches:
+123, 123
+- M: 1 (Gs: 1, 1)
+- M: 2 (Gs: 2, 2)
+- M: 3 (Gs: 3, 3)
+
+Different entire input and substring matches 2:
+123
+- M: 1 (Gs: 1)
+- M: 2 (Gs: 2)
+- M: 3 (Gs: 3)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt
new file mode 100644
index 0000000..c54dc96
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+true == true
+true == true
+
+false == false
+true == true
+
+false == false
+true == true
+
+false == false
+true == true
+
+false == false
+false == false
+false == false
+true == true
+true == true
+true == true
+
+false == false
+false == false
+true == true
+true == true
+true == true
+true == true
+
+
+Lower 'c'-words:
+- coverage
+- considered
+
+Any 'c'-words:
+- Code
+- coverage
+- considered
+
+Lower line-last words:
+- coverage
+
+Any line-last words:
+- coverage
+- BROKEN
+
+Any last words:
+- BROKEN
+
+c-word with follower:
+- "Code without"
+  Groups: "Code without", "Code", "without"
+- "coverage\nis"
+  Groups: "coverage\nis", "coverage", "is"
+- "considered to"
+  Groups: "considered to", "considered", "to"
+
+c-word with follower in the same line:
+- Code without
+- considered to
+
+Lower c-word with follower in the same line:
+- considered to
+
+  Ignored but logged in 2.3: False == False
+  Ignored but logged in 2.3: False == False
+
+FOObar == FOObar
+Foobar == Foobar
+FOObar == FOObar
+FOObarFOO == FOObarFOO
+FOObarfOO == FOObarfOO
+FOObarfOO == FOObarfOO
+Foobar == Foobar
+FOObar == FOObar
+FOObarFOO == FOObarFOO
+FOObarfOO == FOObarfOO
+FOObarfOO == FOObarfOO
+foobar == foobar
+foobar == foobar
+FOObar == FOObar
+FOObarFOO == FOObarFOO
+FOObarfOo == FOObarfOo
+FAlse == FAlse
+FAlse == FAlse
+
+  Ignored but logged in 2.3: FOObar
+
+[foo, barxbaaz] == [foo, barxbaaz]
+[foo, barxbaaz] == [foo, barxbaaz]
+[foo, bar, baaz] == [foo, bar, baaz]
+[foo, barxbaaz] == [foo, barxbaaz]
+[foo, bar, baaz] == [foo, bar, baaz]
+[fooXXbarxxbaaz] == [fooXXbarxxbaaz]
+[foo, bar, baaz] == [foo, bar, baaz]
+[F, ls] == [F, ls]
+[Fals, ] == [Fals, ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt
new file mode 100644
index 0000000..6e689ac
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+FreeMarker: Encoding string built-in tests
+
+  
+cap_first:    DieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
+uncap_first:  dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
+uncap_first:blah
+capitalize:   Diebugsdie! * Vazzze 123456 --cdc-- --<<--@ X ${"kigyo"?upper_case}  
+html:         dieBugsDie! * vazzZE 123456 --cdc-- --&lt;&lt;--@ x ${&quot;kigyo&quot;?upper_case}  
+length:     71
+lower_case:   diebugsdie! * vazzze 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
+rtf:          dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x $\{"kigyo"?upper_case\}  
+trim:       dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}
+trim2:      foo bar
+trim3:      foo bar
+trim4:      foo bar
+upper_case:   DIEBUGSDIE! * VAZZZE 123456 --CDC-- --<<--@ X ${"KIGYO"?UPPER_CASE}  
+xml:          dieBugsDie! * vazzZE 123456 --cdc-- --&lt;&lt;--@ x ${&quot;kigyo&quot;?upper_case}  
+xhtml:      &quot;Blah&#39;s is &gt; 1 &amp; &lt; 2&quot;
+
+word_list:
+- dieBugsDie!
+- *
+- vazzZE
+- 123456
+- --cdc--
+- --<<--@
+- x
+- ${"kigyo"?upper_case}
+
+interpret:   dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x KIGYO  
+number: -122,35
+1500
+5
+0
+0
+true
+true
+true
+true
+true
+
+default constructor
+1
+xxx
+xxx:yyy
+
+
+In The Sacred, Holy beginning, God created The Sacred, Holy Heavens and The Sacred, Holy Earth. 
+In the very beginning, God created the Heavens and The Earth. 
+|I|n| |t|h|e| |b|e|g|i|n|n|i|n|g|,| |G|o|d| |c|r|e|a|t|e|d| |t|h|e| |H|e|a|v|e|n|s| |a|n|d| |T|h|e| |E|a|r|t|h|.| 
+|In the beginning, God created the Heavens and The Earth. 
+
+In the beginning, God created the sky and The Earth. 
+
+matches
+
+  the beginning
+  the sacred beginning
+  the Heavens
+  the sacred Heavens
+  The Earth
+  The sacred Earth
+
+In the beginning, God created the Heavens and The Earth.
+beginning
+the Heavens and The Earth.
+
+   foo
+   bar
+   baz
+       foobar
+
+
+FOOBAR
+
+[a] = [a]
+[a\\'x'\nb] = [a\\'x'\nb]
+[\u0001\u001a ] = [\u0001\u001a ]
+
+[a] = [a]
+[a\\\'x\'\nb] = [a\\\'x\'\nb]
+[\x01\x1A ] = [\x01\x1A ]
+[\x3C![CDATA[] = [\x3C![CDATA[]
+[]]\>] = []]\>]
+
+[a] = [a]
+[a\\'x'\nb] = [a\\'x'\nb]
+[\u0001\u001A ] = [\u0001\u001A ]
+[\n\r\t\f\b\"] = [\n\r\t\f\b\"]
+[\/] = [\/]
+[a/b] = [a/b]
+[<\/script>] = [<\/script>]
+[\u003C![CDATA[] = [\u003C![CDATA[]
+[]]\u003E] = []]\u003E]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt
new file mode 100644
index 0000000..f5eebd9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+--
+1 = 1
+5 = 5
+0 = 0
+--
+5 = 5
+1 = 1
+7 = 7
+--
+true = true
+false = false
+true = true
+--
+true = true
+false = false
+true = true
+--
+true = true
+true = true
+true = true
+false = false
+true = true
+--
+[abbcdbb] = [abbcdbb]
+[qwe] = [qwe]
+[qwe] = [qwe]
+[qwe] = [qwe]
+[qwe
+] = [qwe
+]
+[qwe
+] = [qwe
+]
+--
+[abbcdbb] = [abbcdbb]
+[abb-dbb] = [abb-dbb]
+[a-=*cd-=*] = [a-=*cd-=*]
+--
+[a][][cd][][] == [a][][cd][][]
+[][die][maggots][!] == [][die][maggots][!]
+[Die maggots!] == [Die maggots!]
+--
+[     ]
+[    a]
+[   ab]
+[  abc]
+[ abcd]
+[abcde]
+[abcdef]
+[abcdefg]
+[abcdefgh]
+[-----]
+[----a]
+[---ab]
+[--abc]
+[-abcd]
+[abcde]
+[abcdef]
+[abcdefg]
+[abcdefgh]
+[.oO.oO.o]
+[.oO.oO.a]
+[.oO.oOab]
+[.oO.oabc]
+[.oO.abcd]
+[.oOabcde]
+[.oabcdef]
+[.abcdefg]
+[abcdefgh]
+[abcdefghi]
+[abcdefghij]
+[]
+[/]
+[/\]
+[/\_]
+[/\_/]
+[/\_/\]
+[/\_/\_]
+[/\_/\_/]
+--
+[     ]
+[a    ]
+[ab   ]
+[abc  ]
+[abcd ]
+[abcde]
+[abcdef]
+[abcdefg]
+[abcdefgh]
+[-----]
+[a----]
+[ab---]
+[abc--]
+[abcd-]
+[abcde]
+[abcdef]
+[abcdefg]
+[abcdefgh]
+[.oO.oO.o]
+[aoO.oO.o]
+[abO.oO.o]
+[abc.oO.o]
+[abcdoO.o]
+[abcdeO.o]
+[abcdef.o]
+[abcdefgo]
+[abcdefgh]
+[abcdefghi]
+[abcdefghij]
+[]
+[/]
+[/\]
+[/\_]
+[/\_/]
+[/\_/\]
+[/\_/\_]
+[/\_/\_/]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt
new file mode 100644
index 0000000..8ef415d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+3.00
+3.00
+01:02:03.000
+01:02:03.000
+---
+de
+true false
+yes no
+igen nem
+0.0 1.0
+true true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt
new file mode 100644
index 0000000..3d9d4c9
Binary files /dev/null and b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt differ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt
new file mode 100644
index 0000000..5d42785
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Switch-Case Test</title>
+</head>
+<body>
+
+<p>Here we iterate over a list of animals.</p>
+
+<p>Animal is: aardvark.<br />
+        This is the HTML for other animals.
+</p>
+<p>Animal is: kiwi.<br />
+        This is the HTML for the user's favorite animal.
+</p>
+<p>Animal is: gecko.<br />
+        This is the HTML for small animals.
+</p>
+<p>Animal is: cat.<br />
+        This is the HTML for other animals.
+</p>
+<p>Animal is: dog.<br />
+        This is the HTML for other animals.
+</p>
+<p>Animal is: elephant.<br />
+        This is the HTML for large animals.
+</p>
+<p>Animal is: squirrel.<br />
+        This is the HTML for small animals.
+</p>
+<p>Animal is: zebra.<br />
+        This is the HTML for a large stripey animal.
+        This is the HTML for large animals.
+</p>
+
+      1
+          i2
+      2
+          i4
+          ft
+      ft
+      3
+          i4
+      3
+          i6
+
+[]
+
+  ""
+  "1234"
+  "234"
+  "34"
+  "4"
+
+  "12default45"
+  "2default45"
+  "default"
+  "45"
+  "5"
+
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt
new file mode 100644
index 0000000..6b7f986
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Transformation Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+&lt;p&gt;Hello, world!&lt;/p&gt;
+
+<P>Now try the Utility package:</p>
+<p>Utility transformations</p>
+
+&lt;p&gt;Utility transformations&lt;/p&gt;
+
+<p>Now some nested transforms:</p>
+<p >This tests the compress transformation</p >&lt;p &gt;This tests the compress transformation&lt;/p &gt;&lt;p &gt;This tests the compress transformation&lt;/p &gt;
+<p>Now try method and transform interactions:</p>
+&lt;p&gt;This isn&apos;t a valid XML string.&lt;/p&gt;
+&lt;p&gt;This isn't a valid HTML string.&lt;/p&gt;
+
+<p>A more advanced interaction involves getting a TemplateMethodModel
+to initialise a TemplateTransformModel, as follow:</p>
+
+Comment: This is a comment
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+
+Comment: This is a second comment
+
+A test string containing quotes: &quot;This isn&apos;t a test&quot;.
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+Comment: This is a third comment
+
+A test string containing quotes: &quot;This isn&apos;t a test&quot;.
+A test string containing amps: Fish &amp; Chips.
+A test string containing tags: <p>Fish &amp;amp; Chips.</p>
+Comment: Utility transformations
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: &lt;p&gt;Fish &amp; Chips.&lt;/p&gt;
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt
new file mode 100644
index 0000000..0b4e23a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+StNuBoMeTaMaHaHxSeCoCxEnInDiNo
+1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
+0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
+0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 1 0 0 1 1 0 0
+0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
+0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
+1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
+0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 1 0 0 0 0 0 0 0 0 0 0 0

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt
new file mode 100644
index 0000000..5fd6e2e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+  1 = 1
+  2 = 2
+  3 = 3
+4 = 4 = 4
+5 = 5 = 5
+6 but 4 = 4
+7 = 7 = 7
+Invisiblity test 1.: passed
+Invisiblity test 2.: passed
+Invisiblity test 3.: passed
+--
+  1 = 1
+  2 = 2
+  3 = 3
+  4 = 4 = 4 = 4
+  5
+  6 == 6
+  7 == 7 == 7
+--



[03/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
deleted file mode 100644
index 329d041..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
+++ /dev/null
@@ -1,411 +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.
--->
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringList) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
-
-<#-- Check if non-overloaded calls still work; they share some code with overloaded methods: -->
-<@assertEquals actual=obj.mIntArrayNonOverloaded([1, 2, 3]) expected="mIntArrayNonOverloaded(int[] [1, 2, 3])" />
-<@assertEquals actual=obj.mIntegerArrayNonOverloaded([1, 2, 3]) expected="mIntegerArrayNonOverloaded(Integer[] [1, 2, 3])" />
-<@assertEquals actual=obj.mIntegerListNonOverloaded([1, 2, 3]) expected="mIntegerListNonOverloaded(List<Integer> [1, 2, 3])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(['a', 'b', 'c']) expected="mStringListNonOverloaded(List<String> [a, b, c])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringList) expected="mStringListNonOverloaded(List<String> [a, b])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringArray) expected="mStringListNonOverloaded(List<String> [a, b])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(['a', 'b', 'c']) expected="mStringArrayNonOverloaded(String[] [a, b, c])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringList) expected="mStringArrayNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringArray) expected="mStringArrayNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(['a', 'b', 3]) expected="mObjectListNonOverloaded(List<Object> [a, b, 3])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringList) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringArray) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(['a', 'b', 3]) expected="mObjectArrayNonOverloaded(Object[] [a, b, 3])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringList) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringArray) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded('a', 'b') expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(['a', 'b']) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringList) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringArray) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1('a', 'b') expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(['a', 'b']) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringList) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringArray) expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a', 'b') expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a') expected="mStringArrayVarargsOverloaded2(String a)" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a']) expected="mStringArrayVarargsOverloaded3(String[] [a])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b']) expected="mStringArrayVarargsOverloaded3(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a') expected="mStringArrayVarargsOverloaded3(String[] [a])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b') expected="mStringArrayVarargsOverloaded3(String a, String b)" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b', 'c') expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
-
-<@assertEquals actual=obj.mListOrString(['a', 'b']) expected="mListOrString(List [a, b])" />
-<@assertEquals actual=obj.mListOrString('a') expected="mListOrString(String a)" />
-<@assertEquals actual=obj.mListListOrString([['a'], 'b', 3]) expected="mListListOrString(List [[a], b, 3])" />
-<@assertEquals actual=obj.mListListOrString('s') expected="mListListOrString(String s)" />
-
-<#-- Because the fixed arg interpretations are ambiguous, it only considers the vararg interpretations:  -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded4(List[] [[a, b, c]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4('a', 'b', 'c') expected="mStringArrayVarargsOverloaded4(String[] [a, b, c])" />
-
-<#-- Fixed arg solutions have priority: -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(String[] [a, b])" />
-
-<#-- Choses between the vararg solutions: -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-
-<#-- Until there's no overloading String->Character conversion work: -->
-<@assertEquals actual=obj.mCharNonOverloaded('c') expected="mCharNonOverloaded(char c)" />
-<@assertEquals actual=obj.mCharNonOverloaded(obj.javaString) expected="mCharNonOverloaded(char s)" />
-<@assertEquals actual=obj.mCharacterNonOverloaded('c') expected="mCharacterNonOverloaded(Character c)" />
-<@assertEquals actual=obj.mCharacterNonOverloaded(obj.javaString) expected="mCharacterNonOverloaded(Character s)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded('s', 1) expected="mCharOrStringOverloaded(String s, int 1)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded('s', 1) expected="mCharacterOrStringOverloaded(String s, int 1)" />
-<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
-
-<@assertEquals actual=obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c')) expected='mVarargs(String... a1 = abc)' />
-
-<@assertEquals actual=obj.mNull1(null) expected="mNull1(String a1 = null)" />
-<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" />
-<@assertEquals actual=obj.mNull2(null) expected="mNull2(String a1 = null)" />
-<@assertEquals actual=obj.mVarargs('a', null) expected="mVarargs(String... a1 = anull)" />
-<@assertEquals actual=obj.mVarargs(null, 'a') expected="mVarargs(File a1, String... a2)" />
-<@assertEquals actual=obj.mSpecificity('a', 'b') expected="mSpecificity(String a1, Object a2)" />
-
-<@assertEquals actual=obj.mChar('a') expected='mChar(char a1 = a)' />
-<@assertEquals actual=obj.mBoolean(true) expected="mBoolean(boolean a1 = true)" />
-<@assertEquals actual=obj.mBoolean(null) expected="mBoolean(Boolean a1 = null)" />
-
-<@assertEquals actual=obj.mIntNonOverloaded(123?long) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123.5) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(2147483648) expected=-2147483648 /> <#-- overflow -->
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123.5) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?int) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?long) expected="mNumBoxedVSBoxed(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?short) expected="mNumBoxedVSBoxed(Short a1 = 123)" />
-<@assertEquals 
-    actual=obj.mNumUnambigous(2147483648) expected="mNumUnambigous(Integer a1 = -2147483648)" /> <#-- overflow -->
-
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?int) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?short) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.mIntPrimVSBoxed(123) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<#-- This doesn't fail as 123L can be converted to int without loss: -->
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?long) expected="mIntPrimVSBoxed(int a1 = 123)" />
-
-<@assertEquals actual=obj.mNumPrimVSPrim(123?short) expected="mNumPrimVSPrim(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?int) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?long) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?double) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(long a1 = 123456)" />
-
-<@assertEquals actual=obj.mNumPrimAll(123?byte) expected="mNumPrimAll(byte a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?short) expected="mNumPrimAll(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?int) expected="mNumPrimAll(int a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?long) expected="mNumPrimAll(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?float) expected="mNumPrimAll(float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll(123?double) expected="mNumPrimAll(double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll(123) expected="mNumPrimAll(BigDecimal a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(obj.bigInteger(123)) expected="mNumPrimAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumBoxedAll(123?byte) expected="mNumBoxedAll(Byte a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?short) expected="mNumBoxedAll(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?int) expected="mNumBoxedAll(Integer a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?long) expected="mNumBoxedAll(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?float) expected="mNumBoxedAll(Float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?double) expected="mNumBoxedAll(Double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123) expected="mNumBoxedAll(BigDecimal a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(obj.bigInteger(123)) expected="mNumBoxedAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumPrimAll2nd(123?byte) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?short) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?int) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?long) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?float) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?double) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?byte) expected="mNumBoxedAll2nd(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?int) expected="mNumBoxedAll2nd(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?float) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
- 
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?int) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?long) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123.5?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.5)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(9223372036854775808))
-    expected="mNumPrimFallbackToNumber(Number a1 = 9223372036854775808)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.rational(246, 2)) expected="mNumPrimFallbackToNumber(Number a1 = 246/2)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123.5?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.5)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(9223372036854775808))
-    expected="mNumBoxedFallbackToNumber(Number a1 = 9223372036854775808)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.rational(246, 2)) expected="mNumBoxedFallbackToNumber(Number a1 = 246/2)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(double a1 = 1.5)" />
-<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" />
-
-<@assertEquals actual=obj.mNumConversionLoses1(1?double, '', '') expected="Number 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses1(1?short, '', '') expected="Number 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses1(1?long, '', '') expected="Number 1 java.lang.Long" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?double, '', '') expected="Number 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?short, '', '') expected="Number 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?long, '', '') expected="Number 1 java.lang.Long" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?double, '', '') expected="Serializable 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?int, '', '') expected="Serializable 1 java.lang.Integer" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?short, '', '') expected="Serializable 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?long, '', '') expected="Serializable 1 java.lang.Long" />
-
-<#-- BigDecimal-to-int is preferred over to-long for BC and user expectations: -->
-<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" />
-<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" />
-<#-- BigDecimal-to-short is, however unfavored due to the higher chance of overflow: -->
-<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(int 1)" />
-<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" />
-<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(long 1)" />
-<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" />
-
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.5])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2.5, 3) expected='varargs1(String s = null, double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1.5, 2, 3) expected='varargs1(String s = null, double... xs = [1.5, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 'c') expected='varargs1(String s = null, Object... xs = [1, 2, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 'b', 3) expected='varargs1(String s = null, Object... xs = [1, b, 3])' />
-<@assertEquals actual=obj.varargs1(null, 'a', 2, 3) expected='varargs1(String s = null, Object... xs = [a, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s', 1, 2, 3) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s', 1.1, 2.1, 3.1) expected='varargs1(String s = "s", double... xs = [1.1, 2.1, 3.1])' />
-<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(null, 1.1, 2.1, 3.1) expected='varargs1(String s = null, double... xs = [1.1, 2.1, 3.1])' />
-<@assertEquals actual=obj.varargs1(null, 'a', 'b', 'c') expected='varargs1(String s = null, Object... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3?double) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2?double, 3?double) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2?float, 3?float) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1?double, 2?byte, 3?byte) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s') expected='varargs1(String s = "s", int... xs = [])' />
-
-<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?int, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2?double, 3) expected='varargs2(int... xs = [1, 2, 3])' />
-
-<@assertEquals actual=obj.varargs3(1, 2, 3) expected='varargs3(Comparable... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 'c') expected='varargs3(String... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs3(1, 'b', 'c') expected='varargs3(Comparable... xs = [1, b, c])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 3) expected='varargs3(Comparable... xs = [a, b, 3])' />
-<@assertEquals actual=obj.varargs3('a', [], 3) expected='varargs3(Object... xs = [a, [], 3])' />
-<@assertEquals actual=obj.varargs3(null, 'b', null) expected='varargs3(String... xs = [null, b, null])' />
-<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Comparable... xs = [null, 2, null])' />
-<@assertEquals actual=obj.varargs3(null, [], null) expected='varargs3(Object... xs = [null, [], null])' />
-<@assertEquals actual=obj.varargs3(null, null, null) expected='varargs3(String... xs = [null, null, null])' />
-<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' />
-
-<@assertEquals actual=obj.varargs4(null) expected='varargs4(Integer... xs = [null])' />
-<@assertEquals actual=obj.varargs4(null, null, null) expected='varargs4(Integer... xs = [null, null, null])' />
-<@assertEquals actual=obj.varargs4(1, null, 2) expected='varargs4(Integer... xs = [1, null, 2])' />
-<@assertEquals actual=obj.varargs4(1) expected='varargs4(int... xs = [1])' />
-<@assertEquals actual=obj.varargs4(1, 2, 3) expected='varargs4(int... xs = [1, 2, 3])' />
-
-<@assertEquals actual=obj.varargs5(1, 2, 3, 4, 5) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4, 5])' />
-<@assertEquals actual=obj.varargs5(1, 2, 3, 4) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4])' />
-<@assertEquals actual=obj.varargs5(1, 2, 3) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [])' />
-<@assertEquals actual=obj.varargs5(1, 2) expected='varargs5(int a1 = 1, int a2 = 2, int... xs = [])' />
-<@assertEquals actual=obj.varargs5(1) expected='varargs5(int a1 = 1, int... xs = [])' />
-<@assertEquals actual=obj.varargs5() expected='varargs5(int... xs = [])' />
-
-<@assertEquals actual=obj.varargs6('s', 2) expected='varargs6(String a1 = s, int... xs = [2])' />
-<@assertEquals actual=obj.varargs6('s') expected='varargs6(String a1 = s, int... xs = [])' />
-<@assertEquals actual=obj.varargs6(1, 2) expected='varargs6(Object a1 = 1, int a2 = 2, int... xs = [])' />
-<@assertFails message="no compatible overloaded">${obj.varargs6(1)}</@>
-
-<@assertEquals actual=obj.varargs7(1?int, 2?int) expected='varargs7(int... xs = [1, 2])' />
-<@assertEquals actual=obj.varargs7(1?short, 2?int) expected='varargs7(short a1 = 1, int... xs = [2])' />
-
-<#-- Tests that a pre-2.3.21 bug is fixed now: -->
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3.5) expected='mVarargsIgnoredTail(int i = 1, double... ds = [2.0, 3.5])' />
-
-<@assertEquals actual=obj.mNullAmbiguous('a') expected='mNullAmbiguous(String s = a)' />
-<@assertEquals actual=obj.mNullAmbiguous(123) expected='mNullAmbiguous(int i = 123)' />
-<@assertEquals actual=obj.mNullAmbiguous(1.9) expected='mNullAmbiguous(int i = 1)' />
-<@assertEquals actual=obj.mNullAmbiguous(1?double) expected='mNullAmbiguous(int i = 1)' />
-<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous(null)}</@>
-
-<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous2(null)}</@>
-
-<@assertEquals actual=obj.mNullNonAmbiguous(null) expected='mNullNonAmbiguous(String s = null)' />
-
-<#-- The primitive int-s will win twice, but then String wins over Object, which is stronger: -->
-<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(Integer x = 1, Integer y = 2, String s = a)' />
-
-<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
-               expected='mRareWrappings(File f = file, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.stringAdaptedToBoolean2, obj.wrapperNumber, obj.wrapperNumber, obj.wrapperNumber, obj.stringAdaptedToBoolean2)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0001, double d3 = 123.0001, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = 124, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-               
-<@assertEquals actual=obj.mRareWrappings2(obj.adaptedNumber) expected='mRareWrappings2(byte b = 124)' />
-
-<#-- Test for List VS array problems due to too vague hinting: -->
-
-<@assertEquals actual=obj.mSeqToArrayNonOverloaded(['a', 'b'], 'c') expected='mSeqToArrayNonOverloaded(String[] [a, b], String c)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 'c') expected='mSeqToArrayGoodHint(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 3) expected='mSeqToArrayGoodHint(String[] [a, b], int 3)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint2(['a', 'b'], 'c') expected='mSeqToArrayGoodHint2(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint2('a') expected='mSeqToArrayGoodHint2(String a)' />
-
-<@assertEquals actual=obj.mSeqToArrayPoorHint(['a', 'b'], 'c') expected='mSeqToArrayPoorHint(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayPoorHint('a', 2) expected='mSeqToArrayPoorHint(String a, int 2)' />
-
-<@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' />
-<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' />
-
-<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@>
-<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@>
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(['a', 'b']) expected="mStringArrayVsObjectArrayPreference(Object[] [a, b])" />
-<@assertEquals actual=obj.mIntArrayVsIntegerArrayPreference([1, 2]) expected="mIntArrayVsIntegerArrayPreference(Integer[] [1, 2])" />
-
-<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(String[] [a, b])" />
-<@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
-<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
-
-<@assertEquals actual=obj.mIntegerArrayOverloaded([1, 2], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaByteList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-
-<@assertEquals actual=obj.mStringArrayOverloaded(['a', 'b'], 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
-<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaStringList, 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
-<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaCharacterList, 3) expected="mStringArrayOverloaded(String[] [c, C], int 3)" />
-<@assertFails message="Failed to convert sequence">${obj.mStringArrayOverloaded([1, 2], 3)}</@>
-<@assertFails message="Failed to convert">${obj.mStringArrayOverloaded(obj.javaIntegerList, 3)}</@>
-
-<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 3) expected="mCharArrayOverloaded(char[] [c, C], int 3)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
-<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 3)}</@>
-<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 3)}</@>
-<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 's') expected="mCharArrayOverloaded(Character[] [c, C], String s)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
-<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 's')}</@>
-<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 's')}</@>
-
-<@assertEquals actual=obj.mStringArrayArrayOverloaded([['a', 'b'], ['c']], 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringListList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringSequenceList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaStringList, 3)}</@>
-<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaIntegerListList, 3)}</@>
-<@assertEquals actual=obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mIntArrayArrayNonOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayNonOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mArrayOfListsNonOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsNonOverloaded([[1, 2, 3], [], [4]])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a', 'b']) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a']) expected="mStringArrayVarargsOverloaded2(String[] [a])" />
-
-<#-- Situations that lead to array-to-List conversion: -->
-<@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" />
-<@assertEquals actual=obj.mListOrString(obj.javaEmptyStringArray) expected="mListOrString(List [])" />
-<@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" />
-<@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-
-<@assertEquals actual=obj.mMapOrBoolean(obj.hashAndScalarModel) expected="mMapOrBoolean(Map {})" />
-<@assertEquals actual=obj.mMapOrBoolean(obj.booleanAndScalarModel) expected="mMapOrBoolean(boolean true)" />
-<@assertEquals actual=obj.mMapOrBoolean(obj.allModels) expected="mMapOrBoolean(boolean true)" />
-
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true, true])" />
-
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map {})" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean true)" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true, true])" />
-
-<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" />
-<@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" />
-<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" />
-<@assertEquals actual=obj.mDateOrArray(obj.allModels) expected="mDateOrArray(Date 0)" />
-<@assertEquals actual=obj.mStringOrArray(obj.allModels) expected="mStringOrArray(String s)" />
-<@assertEquals actual=obj.mBooleanOrArray(obj.allModels) expected="mBooleanOrArray(boolean true)" />
-<@assertEquals actual=obj.mMapOrArray(obj.allModels) expected="mMapOrArray(Map {})" />
-<@assertEquals actual=obj.mListOrArray(obj.allModels) expected="mListOrArray(List [])" />
-<@assertEquals actual=obj.mSetOrArray(obj.allModels) expected="mSetOrArray(Set [])" />
-
-<@assertEquals actual=obj.mCharOrCharacterOverloaded('c') expected="mCharOrCharacterOverloaded(char c)" />
-<@assertEquals actual=obj.mCharOrCharacterOverloaded(obj.javaString) expected="mCharOrCharacterOverloaded(char s)" />
-<@assertEquals actual=obj.mCharOrCharacterOverloaded(null) expected="mCharOrCharacterOverloaded(Character null)" />
-
-<@assertEquals actual=obj.mCharOrBooleanOverloaded('c') expected="mCharOrBooleanOverloaded(char c)" />
-<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded('c', true) expected="mCharOrStringOverloaded(char c, boolean true)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded('c', true) expected="mCharacterOrStringOverloaded(Character c, boolean true)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(char c)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(Character c)" />
-<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
-
-<#-- The exmple given in bug report 363 -->
-<#assign theMap = {'name':'Billy', 'lastName', 'Pilgrim'} />
-<@assertEquals actual=obj.bugReport363(theMap, []) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=[]" />
-<@assertEquals actual=obj.bugReport363(theMap, null) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=null" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/precedence.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/precedence.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/precedence.ftl
deleted file mode 100644
index 472b076..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/precedence.ftl
+++ /dev/null
@@ -1,61 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Operator Precedence Test</title>
-</head>
-<body>
-<#assign patate1 = "test">
-<#assign patate2 = "test">
-<#assign patate3 = "test">
-
-<#if patate1 == patate2 && patate2 == patate3>
-@@@@@@@@@@@
-</#if>
-
-<br />
-<br />
-
-<#if patate1?exists && patate2 == patate3>
-##########
-</#if>
-
-<br />
-<br />
-
-<#if patate2 == patate2 && (patate2==patate2)>
-&&&&&&&&&&&
-</#if>
-
-<br />
-<br />
-
-<#if (patate2 == patate2) && (patate2==patate2)>
-!!!!!!!!!!!
-</#if>
-
-<br />
-<br />
-
-<#if (patate2 == patate2) && patate2==patate2>
-$$$$$$$$$$$
-</#if>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-common.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-common.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-common.ftl
deleted file mode 100644
index 142435b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-common.ftl
+++ /dev/null
@@ -1,314 +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.
--->
-<#-- A version of "?join" that fails at null-s in the sequence: -->
-<#function join seq sep=''>
-  <#local r = "">
-  <#list seq as i>
-    <#local r = r + i>
-    <#if i_has_next>
-      <#local r = r + sep>
-    </#if>
-  </#list>
-  <#return r>
-</#function>
-
-<#----------------------->
-<#-- Range expressions -->
-
-<@assertEquals actual=join(1..2, ' ') expected="1 2" />
-<@assertEquals actual=join(1..1, ' ') expected="1" />
-<@assertEquals actual=join(1..0, ' ') expected="1 0" />
-<@assertEquals actual=join(1..-1, ' ') expected="1 0 -1" />
-<@assertEquals actual=join(-1..-1, ' ') expected="-1" />
-<@assertEquals actual=join(-1..1, ' ') expected="-1 0 1" />
-
-<@assertEquals actual=join(1..<3, ' ') expected="1 2" />
-<@assertEquals actual=join(1..<2, ' ') expected="1" />
-<@assertEquals actual=join(1..<1, ' ') expected="" />
-<@assertEquals actual=join(1..<0, ' ') expected="1" />
-<@assertEquals actual=join(1..<-1, ' ') expected="1 0" />
-<@assertEquals actual=join(1..<-2, ' ') expected="1 0 -1" />
-<@assertEquals actual=join(-1..<0, ' ') expected="-1" />
-<@assertEquals actual=join(-1..<2, ' ') expected="-1 0 1" />
-
-<@assertEquals actual=join(1..!3, ' ') expected="1 2" />
-<@assertEquals actual=join(1..!2, ' ') expected="1" />
-<@assertEquals actual=join(1..!1, ' ') expected="" />
-<@assertEquals actual=join(1..!0, ' ') expected="1" />
-<@assertEquals actual=join(1..!-1, ' ') expected="1 0" />
-<@assertEquals actual=join(1..!-2, ' ') expected="1 0 -1" />
-<@assertEquals actual=join(-1..!0, ' ') expected="-1" />
-<@assertEquals actual=join(-1..!2, ' ') expected="-1 0 1" />
-
-<@assertEquals actual=join(1..*2, ' ') expected="1 2" />
-<@assertEquals actual=join(1..*1, ' ') expected="1" />
-<@assertEquals actual=join(1..*0, ' ') expected="" />
-<@assertEquals actual=join(1..*-1, ' ') expected="1" />
-<@assertEquals actual=join(1..*-2, ' ') expected="1 0" />
-<@assertEquals actual=join(1..*-3, ' ') expected="1 0 -1" />
-<@assertEquals actual=join(-1..*1, ' ') expected="-1" />
-<@assertEquals actual=join(-1..*3, ' ') expected="-1 0 1" />
-
-<@assertEquals actual=1 expected=(0..0)?size />
-<@assertEquals actual=1 expected=(1..1)?size />
-<@assertEquals actual=1 expected=(2..2)?size />
-<@assertEquals actual=2 expected=(0..1)?size />
-<@assertEquals actual=2 expected=(1..2)?size />
-<@assertEquals actual=2 expected=(2..3)?size />
-<@assertEquals actual=3 expected=(2..4)?size />
-<@assertEquals actual=2 expected=(1..0)?size />
-<@assertEquals actual=2 expected=(2..1)?size />
-<@assertEquals actual=2 expected=(3..2)?size />
-<@assertEquals actual=3 expected=(4..2)?size />
-
-<@assertEquals actual=0 expected=(0..<0)?size />
-<@assertEquals actual=0 expected=(1..<1)?size />
-<@assertEquals actual=0 expected=(2..<2)?size />
-<@assertEquals actual=1 expected=(0..<1)?size />
-<@assertEquals actual=1 expected=(1..<2)?size />
-<@assertEquals actual=1 expected=(2..<3)?size />
-<@assertEquals actual=2 expected=(2..<4)?size />
-<@assertEquals actual=1 expected=(1..<0)?size />
-<@assertEquals actual=1 expected=(2..<1)?size />
-<@assertEquals actual=1 expected=(3..<2)?size />
-<@assertEquals actual=2 expected=(4..<2)?size />
-
-<@assertEquals actual=0 expected=(0..*0)?size />
-<@assertEquals actual=0 expected=(1..*0)?size />
-<@assertEquals actual=0 expected=(2..*0)?size />
-<@assertEquals actual=1 expected=(0..*1)?size />
-<@assertEquals actual=1 expected=(1..*1)?size />
-<@assertEquals actual=1 expected=(2..*1)?size />
-<@assertEquals actual=2 expected=(2..*2)?size />
-<@assertEquals actual=1 expected=(0..*-1)?size />
-<@assertEquals actual=1 expected=(1..*-1)?size />
-<@assertEquals actual=1 expected=(2..*-1)?size />
-<@assertEquals actual=2 expected=(0..*-2)?size />
-<@assertEquals actual=2 expected=(1..*-2)?size />
-<@assertEquals actual=2 expected=(2..*-2)?size />
-
-
-<#--------------------->
-<#-- String slicing: -->
-
-<#assign s = 'abcd'>
-
-<@assertEquals actual=s[0..] expected="abcd" />
-<@assertEquals actual=s[1..] expected="bcd" />
-<@assertEquals actual=s[2..] expected="cd" />
-<@assertEquals actual=s[3..] expected="d" />
-<@assertEquals actual=s[4..] expected="" />
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[5..] />
-</...@assertFails>
-<@assertFails message="6 is out of bounds">
-  <#assign _ = s[6..] />
-</...@assertFails>
-
-<@assertEquals actual=s[1..2] expected="bc" />
-<@assertEquals actual=s[1..1] expected="b" />
-<@assertEquals actual=s[0..1] expected="ab" />
-<@assertEquals actual=s[0..0] expected="a" />
-<@assertFails message="4 is out of bounds">
-  <#assign _ = s[1..4] />
-</...@assertFails>
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[1..5] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-1..1] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-2..1] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[0..-1] />
-</...@assertFails>
-
-<@assertEquals actual=s[1..<3] expected="bc" />
-<@assertEquals actual=s[1..!3] expected="bc" />
-<@assertEquals actual=s[1..<2] expected="b" />
-<@assertEquals actual=s[1..<0] expected="b" />
-<@assertEquals actual=s[1..<1] expected="" />
-<@assertEquals actual=s[0..<0] expected="" />
-<@assertEquals actual=s[5..<5] expected="" />
-<@assertEquals actual=s[6..<6] expected="" />
-<@assertEquals actual=s[-5..<-5] expected="" />
-<@assertFails message="negative">
-  <#assign _ = s[-5..<1] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[2..<-4] />
-</...@assertFails>
-<@assertFails message="decreasing">
-  <#assign _ = s[2..<0] />
-</...@assertFails>
-
-<@assertEquals actual=s[1..*-1] expected="b" />
-<@assertEquals actual=s[1..*0] expected="" />
-<@assertEquals actual=s[1..*1] expected="b" />
-<@assertEquals actual=s[1..*2] expected="bc" />
-<@assertEquals actual=s[1..*3] expected="bcd" />
-<@assertEquals actual=s[1..*4] expected="bcd" />
-<@assertEquals actual=s[1..*5] expected="bcd" />
-<@assertEquals actual=s[4..*1] expected="" />
-<@assertEquals actual=s[5..*0] expected="" />
-<@assertEquals actual=s[6..*0] expected="" />
-<@assertEquals actual=s[-5..*0] expected="" />
-<@assertEquals actual=s[0..*0] expected="" />
-<@assertEquals actual=s[0..*-1] expected="a" />
-<@assertEquals actual=s[0..*-2] expected="a" />
-<@assertEquals actual=s[0..*-3] expected="a" />
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[5..*1] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-1..*1] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-2..*1] />
-</...@assertFails>
-<@assertFails message="decreasing">
-  <#assign _ = s[1..*-2] />
-</...@assertFails>
-<@assertFails message="decreasing">
-  <#assign _ = s[1..*-3] />
-</...@assertFails>
-<@assertFails message="4 is out of bounds">
-  <#assign _ = s[4..*-1] />
-</...@assertFails>
-
-<#-- Legacy string backward-range bug kept for compatibility: -->
-<@assertEquals actual=s[1..0] expected="" />
-<@assertEquals actual=s[2..1] expected="" />
-<@assertFails message="negative">
-  <@assertEquals actual=s[0..-1] expected="" />
-</...@assertFails>
-<@assertFails message="decreasing">
-  <@assertEquals actual=s[3..1] expected="" />
-</...@assertFails>
-<#-- But it isn't emulated for operators introduced after 2.3.20: -->
-<@assertFails message="decreasing">
-  <@assertEquals actual=s[3..<1] expected="" />
-</...@assertFails>
-<@assertFails message="decreasing">
-  <@assertEquals actual=s[3..*-2] expected="" />
-</...@assertFails>
-
-<#assign r = 1..2>
-<@assertEquals actual=s[r] expected="bc" />
-<#assign r = 2..1>
-<@assertEquals actual=s[r] expected="" />
-<#assign r = 1..<2>
-<@assertEquals actual=s[r] expected="b" />
-<#assign r = 2..<4>
-<@assertEquals actual=s[r] expected="cd" />
-<#assign r = 2..>
-<@assertEquals actual=s[r] expected="cd" />
-<#assign r = 1..*2>
-<@assertEquals actual=s[r] expected="bc" />
-
-<#----------------------->
-<#-- Sequence slicing: -->
-
-<#assign s = ['a', 'b', 'c', 'd']>
-
-<@assertEquals actual=join(s[0..]) expected="abcd" />
-<@assertEquals actual=join(s[1..]) expected="bcd" />
-<@assertEquals actual=join(s[2..]) expected="cd" />
-<@assertEquals actual=join(s[3..]) expected="d" />
-<@assertEquals actual=join(s[4..]) expected="" />
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[5..] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-1..] />
-</...@assertFails>
-
-<@assertEquals actual=join(s[1..2]) expected="bc" />
-<@assertEquals actual=join(s[1..1]) expected="b" />
-<@assertEquals actual=join(s[0..1]) expected="ab" />
-<@assertEquals actual=join(s[0..0]) expected="a" />
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[1..5] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-1..0] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[0..-1] />
-</...@assertFails>
-
-<@assertEquals actual=join(s[1..<3]) expected="bc" />
-<@assertEquals actual=join(s[1..!3]) expected="bc" />
-<@assertEquals actual=join(s[1..<2]) expected="b" />
-<@assertEquals actual=join(s[1..<0]) expected="b" />
-<@assertEquals actual=join(s[1..<1]) expected="" />
-<@assertEquals actual=join(s[0..<0]) expected="" />
-
-<@assertEquals actual=join(s[1..0]) expected="ba" />
-<@assertEquals actual=join(s[2..1]) expected="cb" />
-<@assertEquals actual=join(s[2..0]) expected="cba" />
-<@assertEquals actual=join(s[2..<0]) expected="cb" />
-<@assertEquals actual=join(s[1..<0]) expected="b" />
-<@assertEquals actual=join(s[0..<0]) expected="" />
-<@assertEquals actual=join(s[3..<1]) expected="dc" />
-<@assertEquals actual=join(s[2..<1]) expected="c" />
-<@assertEquals actual=join(s[1..<1]) expected="" />
-<@assertEquals actual=join(s[0..<1]) expected="a" />
-<@assertEquals actual=join(s[0..<0]) expected="" />
-<@assertEquals actual=join(s[5..<5]) expected="" />
-<@assertEquals actual=join(s[-5..<-5]) expected="" />
-
-<@assertEquals actual=join(s[0..*-4]) expected="a" />
-<@assertEquals actual=join(s[1..*-4]) expected="ba" />
-<@assertEquals actual=join(s[1..*-3]) expected="ba" />
-<@assertEquals actual=join(s[1..*-2]) expected="ba" />
-<@assertEquals actual=join(s[1..*-1]) expected="b" />
-<@assertEquals actual=join(s[1..*0]) expected="" />
-<@assertEquals actual=join(s[1..*1]) expected="b" />
-<@assertEquals actual=join(s[1..*2]) expected="bc" />
-<@assertEquals actual=join(s[1..*3]) expected="bcd" />
-<@assertEquals actual=join(s[1..*4]) expected="bcd" />
-<@assertEquals actual=join(s[1..*5]) expected="bcd" />
-<@assertEquals actual=join(s[0..*3]) expected="abc" />
-<@assertEquals actual=join(s[2..*3]) expected="cd" />
-<@assertEquals actual=join(s[3..*3]) expected="d" />
-<@assertEquals actual=join(s[4..*3]) expected="" />
-<@assertFails message="5 is out of bounds">
-  <#assign _ = s[5..*3] />
-</...@assertFails>
-<@assertFails message="negative">
-  <#assign _ = s[-1..*2] />
-</...@assertFails>
-
-<#assign r = 1..2>
-<@assertEquals actual=join(s[r]) expected="bc" />
-<#assign r = 2..0>
-<@assertEquals actual=join(s[r]) expected="cba" />
-<#assign r = 1..<2>
-<@assertEquals actual=join(s[r]) expected="b" />
-<#assign r = 2..<0>
-<@assertEquals actual=join(s[r]) expected="cb" />
-<#assign r = 2..>
-<@assertEquals actual=join(s[r]) expected="cd" />
-<#assign r = 1..*2>
-<@assertEquals actual=join(s[r]) expected="bc" />
-<#assign r = 1..*-9>
-<@assertEquals actual=join(s[r]) expected="ba" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
deleted file mode 100644
index d2f5450..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
+++ /dev/null
@@ -1,50 +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.
--->
-<#include 'range-common.ftl'>
-
-<@assertEquals actual=(4..)?size expected=2147483647 />
-<@assertEquals actual=limitedJoin(4.., 3) expected="4, 5, 6, ..." />
-
-<@assertEquals actual=(4..)[0] expected=4 />
-<@assertEquals actual=(4..)[1] expected=5 />
-<@assertEquals actual=(4..)[1000000] expected=1000004 />
-<@assertFails message="out of bounds">
-	<@assertEquals actual=(4..)[-1] expected=5 />
-</@>
-
-<#assign r = 2147483646..>
-<@assertEquals actual=r?size expected=2147483647 />
-<@assertEquals actual=limitedJoin(r, 3) expected="2147483646, 2147483647, 2147483648, ..." />
-<@assertEquals actual=r[100] expected=2147483746 />
-
-<#assign r = -2..>
-<@assertEquals actual=limitedJoin(r, 5) expected="-2, -1, 0, 1, 2, ..." />
-<@assertEquals actual=r[0] expected=-2 />
-<@assertEquals actual=r[1] expected=-1 />
-
-<#function limitedJoin range limit>
-	<#assign joined="">
-	<#list range as i>
-		<#assign joined = joined + i?c>
-		<#if i_has_next><#assign joined = joined + ', '></#if>
-		<#local limit = limit - 1>
-		<#if limit == 0><#assign joined = joined + "..."><#break></#if>
-	</#list>
-	<#return joined>
-</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/recover.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/recover.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/recover.ftl
deleted file mode 100644
index f7dc437..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/recover.ftl
+++ /dev/null
@@ -1,47 +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.
--->
-<#attempt>
- <#assign sequence = ["Hello, World"]>
- ${sequence[0]}
-<#recover>
-  We should never get here.
-</#recover>
-<#attempt>
- Let's try to output an undefined variable: ${undefinedVariable}
-<#recover>
- Well, that did not work.<@assert test=.error?contains('undefinedVariable') />
- Now we nest another attempt/recover here:
- <#attempt>
-   ${sequence[1]}
- <#recover>
-   Oops...<@assert test=.error?contains('sequence[1]') />
-   Remember, freeMarker sequences are zero-based! ${sequence[0]}
- </#recover>
- Now we check the current error message.<@assert test=.error?contains('undefinedVariable') />
-</#recover>
-<#attempt>
-  <#include "nonexistent_template">
-<#recover>
-  The template is not currently available
-</#recover>
-<#attempt>
-  <#include "undefined.ftl">
-<#recover>
-  The included template had a problem.<@assert test=.error?contains('undefined_variable') />
-</#attempt>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/root.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/root.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/root.ftl
deleted file mode 100644
index e1bc7f3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/root.ftl
+++ /dev/null
@@ -1,47 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Root Lookup Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Access the same variable via the root variable (dot syntax):</p>
-
-<p>${.data_model.message}</p>
-
-<p>Access the same variable via the root variable (bracket syntax):</p>
-
-<p>${.data_model["message"]}</p>
-
-<p>Ensure that root lookups are unaffected by local variables:</p>
-
-<#macro test message>
-  ${.data_model.message}
-  ${message}
-</#macro>
-
-<@test message + " Part Deux" />
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/sequence-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/sequence-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/sequence-builtins.ftl
deleted file mode 100644
index e21bc2d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/sequence-builtins.ftl
+++ /dev/null
@@ -1,360 +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.
--->
-<@noOutput>
-<#setting locale="en_US">
-<#setting number_format="0.#########">
-
-<#assign ls = []?sort>
-<#list ls as i>
-- ${i}
-</#list>
-<@assertEquals expected=0 actual=ls?size />
-<@assertEquals expected=3 actual=set?size />
-</...@noOutput>
-Sorting scalars:
-----------------
-
-String order:
-<#assign ls = ["whale", "Barbara", "zeppelin", "aardvark", "beetroot"]?sort>
-<#list ls as i>
-- ${i}
-</#list>
-
-First: ${ls?first}
-Last: ${ls?last}
-Size ${ls?size}
-
-Numerical order:
-<#assign ls = [123?byte, 543, -324, -34?float, 0.11, 0, 111?int, 0.1?double, 1, 5]?sort>
-<#list ls as i>
-- ${i}
-</#list>
-
-First: ${ls?first}
-Last: ${ls?last}
-Size ${ls?size}
-
-Date/time order:
-<#assign x = [
-        '08:05'?time('HH:mm'),
-        '18:00'?time('HH:mm'),
-        '06:05'?time('HH:mm'),
-        '08:15'?time('HH:mm')]>
-<#list x?sort as i>
-- ${i?string('HH:mm')}
-</#list>
-
-Boolean order:
-<#assign x = [
-        true,
-        false,
-        false,
-        true]>
-<#list x?sort as i>
-- ${i?string}
-</#list>
-
-
-Sorting hashes:
----------------
-
-<#assign ls = [
-  {"name":"whale", "weight":2000?short},
-  {"name":"Barbara", "weight":53},
-  {"name":"zeppelin", "weight":-200?float},
-  {"name":"aardvark", "weight":30?long},
-  {"name":"beetroot", "weight":0.3}
-]>
-Order by name:
-<#assign ls = ls?sort_by("name")>
-<#list ls as i>
-- ${i.name}: ${i.weight}
-</#list>
-
-Order by weight:
-<#assign ls = ls?sort_by("weight")>
-<#list ls as i>
-- ${i.name}: ${i.weight}
-</#list>
-
-Order by a.x.v:
-<#assign x = [
-        {"a": {"x": {"v": "qweqw", "w": "asd"}, "y": '1998-02-20'?date('yyyy-MM-dd')}},
-        {"a": {"x": {"v": "aqweqw", "w": "asd"}, "y": '1999-01-20'?date('yyyy-MM-dd')}},
-        {"a": {"x": {"v": "dfgdf", "w": "asd"}, "y": '1999-04-20'?date('yyyy-MM-dd')}},
-        {"a": {"x": {"v": "utyu", "w": "asd"}, "y": '1999-04-19'?date('yyyy-MM-dd')}}]>
-<#list x?sort_by(['a', 'x', 'v']) as i>
-- ${i.a.x.v}
-</#list>
-
-Order by a.y, which is a date:
-<#list x?sort_by(['a', 'y']) as i>
-- ${i.a.y?string('yyyy-MM-dd')}
-</#list>
-
-Reverse:
---------
-
-Order by weight desc:
-<#assign ls = ls?reverse>
-<#list ls as i>
-- ${i.name}: ${i.weight}
-</#list>
-
-Order by weight desc desc:
-<#assign ls = ls?reverse>
-<#list ls as i>
-- ${i.name}: ${i.weight}
-</#list>
-
-Order by weight desc desc desc:
-<#assign ls = ls?reverse>
-<#list ls as i>
-- ${i.name}: ${i.weight}
-</#list>
-
-Contains:
----------
-
-<#macro test></#macro>
-<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, '1992-02-21'?date('yyyy-MM-dd')]>
-True:
-${x?seq_contains(1.0)?string}
-${x?seq_contains("2")?string}
-${x?seq_contains(true)?string}
-${x?seq_contains('1992-02-21'?date('yyyy-MM-dd'))?string}
-${abcSet?seq_contains("a")?string}
-${abcSet?seq_contains("b")?string}
-${abcSet?seq_contains("c")?string}
-
-False:
-${x?seq_contains("1")?string}
-${x?seq_contains(2)?string}
-${x?seq_contains(false)?string}
-${x?seq_contains('1992-02-22'?date('yyyy-MM-dd'))?string}
-${abcSet?seq_contains("A")?string}
-${abcSet?seq_contains(1)?string}
-${abcSet?seq_contains(true)?string}
-
-<#assign x = []>
-False: ${x?seq_contains(1)?string}
-
-Index_of:
----------
-
-<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, '1992-02-21'?date('yyyy-MM-dd')]>
-0 = ${x?seq_index_of(1.0)}
-1 = ${x?seq_index_of("2")}
-2 = ${x?seq_index_of(true)}
-6 = ${x?seq_index_of('1992-02-21'?date('yyyy-MM-dd'))}
-0 = ${abcSet?seq_index_of("a")}
-1 = ${abcSet?seq_index_of("b")}
-2 = ${abcSet?seq_index_of("c")}
-
--1 = ${x?seq_index_of("1")}
--1 = ${x?seq_index_of(2)}
--1 = ${x?seq_index_of(false)}
--1 = ${x?seq_index_of('1992-02-22'?date('yyyy-MM-dd'))}
--1 = ${abcSet?seq_index_of("A")}
--1 = ${abcSet?seq_index_of(1)}
--1 = ${abcSet?seq_index_of(true)}
-
-<#assign x = []>
--1 = ${x?seq_index_of(1)}
-
-Last_index_of:
---------------
-
-<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, 1, '1992-02-21'?date('yyyy-MM-dd')]>
-6 = ${x?seq_last_index_of(1.0)}
-1 = ${x?seq_last_index_of("2")}
-2 = ${x?seq_last_index_of(true)}
-7 = ${x?seq_last_index_of('1992-02-21'?date('yyyy-MM-dd'))}
--1 = ${x?seq_last_index_of("1")}
-0 = ${abcSet?seq_last_index_of("a")}
-1 = ${abcSet?seq_last_index_of("b")}
-2 = ${abcSet?seq_last_index_of("c")}
--1 = ${abcSet?seq_last_index_of("A")}
-
-Index_of and last_index_of with starting indices
-------------------------------------------------
-
-<#assign names = ["Joe", "Fred", "Joe", "Susan"]>
-seq_index_of "Joe":
-0 = ${names?seq_index_of("Joe", -2)}
-0 = ${names?seq_index_of("Joe", -1)}
-0 = ${names?seq_index_of("Joe", 0)}
-2 = ${names?seq_index_of("Joe", 1)}
-2 = ${names?seq_index_of("Joe", 2)}
--1 = ${names?seq_index_of("Joe", 3)}
--1 = ${names?seq_index_of("Joe", 4)}
- 
-seq_last_index_of "Joe":
--1 = ${names?seq_last_index_of("Joe", -2)}
--1 = ${names?seq_last_index_of("Joe", -1)}
-0 = ${names?seq_last_index_of("Joe", 0)}
-0 = ${names?seq_last_index_of("Joe", 1)}
-2 = ${names?seq_last_index_of("Joe", 2)}
-2 = ${names?seq_last_index_of("Joe", 3)}
-2 = ${names?seq_last_index_of("Joe", 4)}
- 
-seq_index_of "Susan":
-3 = ${names?seq_index_of("Susan", -2)}
-3 = ${names?seq_index_of("Susan", -1)}
-3 = ${names?seq_index_of("Susan", 0)}
-3 = ${names?seq_index_of("Susan", 1)}
-3 = ${names?seq_index_of("Susan", 2)}
-3 = ${names?seq_index_of("Susan", 3)}
--1 = ${names?seq_index_of("Susan", 4)}
- 
-seq_last_index_of "Susan":
--1 = ${names?seq_last_index_of("Susan", -2)}
--1 = ${names?seq_last_index_of("Susan", -1)}
--1 = ${names?seq_last_index_of("Susan", 0)}
--1 = ${names?seq_last_index_of("Susan", 1)}
--1 = ${names?seq_last_index_of("Susan", 2)}
-3 = ${names?seq_last_index_of("Susan", 3)}
-3 = ${names?seq_last_index_of("Susan", 4)}
-
-seq_index_of "a":
-0 = ${abcSet?seq_index_of("a", -2)}
-0 = ${abcSet?seq_index_of("a", -1)}
-0 = ${abcSet?seq_index_of("a", 0)}
--1 = ${abcSet?seq_index_of("a", 1)}
--1 = ${abcSet?seq_index_of("a", 2)}
--1 = ${abcSet?seq_index_of("a", 3)}
--1 = ${abcSet?seq_index_of("a", 4)}
-
-seq_index_of "b":
-1 = ${abcSet?seq_index_of("b", -2)}
-1 = ${abcSet?seq_index_of("b", -1)}
-1 = ${abcSet?seq_index_of("b", 0)}
-1 = ${abcSet?seq_index_of("b", 1)}
--1 = ${abcSet?seq_index_of("b", 2)}
--1 = ${abcSet?seq_index_of("b", 3)}
-
-seq_index_of "c":
-2 = ${abcSet?seq_index_of("c", -2)}
-2 = ${abcSet?seq_index_of("c", -1)}
-2 = ${abcSet?seq_index_of("c", 0)}
-2 = ${abcSet?seq_index_of("c", 1)}
-2 = ${abcSet?seq_index_of("c", 2)}
--1 = ${abcSet?seq_index_of("c", 3)}
- 
-seq_last_index_of "a":
--1 = ${abcSet?seq_last_index_of("a", -2)}
--1 = ${abcSet?seq_last_index_of("a", -1)}
-0 = ${abcSet?seq_last_index_of("a", 0)}
-0 = ${abcSet?seq_last_index_of("a", 1)}
-0 = ${abcSet?seq_last_index_of("a", 2)}
-0 = ${abcSet?seq_last_index_of("a", 3)}
-0 = ${abcSet?seq_last_index_of("a", 4)}
-
-seq_last_index_of "b":
--1 = ${abcSet?seq_last_index_of("b", -2)}
--1 = ${abcSet?seq_last_index_of("b", -1)}
--1 = ${abcSet?seq_last_index_of("b", 0)}
-1 = ${abcSet?seq_last_index_of("b", 1)}
-1 = ${abcSet?seq_last_index_of("b", 2)}
-1 = ${abcSet?seq_last_index_of("b", 3)}
-
-seq_last_index_of "c":
--1 = ${abcSet?seq_last_index_of("c", -2)}
--1 = ${abcSet?seq_last_index_of("c", -1)}
--1 = ${abcSet?seq_last_index_of("c", 0)}
--1 = ${abcSet?seq_last_index_of("c", 1)}
-2 = ${abcSet?seq_last_index_of("c", 2)}
-2 = ${abcSet?seq_last_index_of("c", 3)}
-
-Sequence builtins ignoring nulls
---------------------------------
-
-true = ${listWithNull?seq_contains('c')?string}
-2 = ${listWithNull?seq_index_of('c')}
-0 = ${listWithNull?seq_last_index_of('a')}
-
-These should throw exception, but for BC they don't:
-false = ${listWithNull?seq_contains(noSuchVar)?string}
--1 = ${listWithNull?seq_index_of(noSuchVar)}
--1 = ${listWithNull?seq_last_index_of(noSuchVar)}
-
-Sequence built-ins failing on date-type mismatch
-------------------------------------------------
-
-<#assign x = ['1992-02-21'?date('yyyy-MM-dd'), 'foo']>
-<@assertEquals actual=x?seq_index_of('foo') expected=1 />
-<@assertEquals actual=x?seq_index_of('1992-02-21'?date('yyyy-MM-dd')) expected=0 />
-<@assertFails message="dates of different types">
-  0 = ${x?seq_index_of('1992-02-21 00:00:00'?datetime('yyyy-MM-dd HH:mm:ss'))}
-</@>
-
-Chunk
------
-
-<#assign ls = ['a', 'b', 'c', 'd', 'e', 'f', 'g']>
-<#list ['NULL', '-'] as fill>
-  <#list [1, 2, 3, 4, 5, 10] as columns>
-    <@printTable ls, columns, fill />
-  </#list>
-</#list>
-<@printTable [1, 2, 3, 4, 5, 6, 7, 8, 9], 3, 'NULL' />
-<@printTable [1, 2, 3, 4, 5, 6, 7, 8, 9], 3, '-' />
-<@printTable [1], 3, 'NULL' />
-<@printTable [1], 3, '-' />
-<@printTable [], 3, 'NULL' />
-<@printTable [], 3, '-' />
-
-<#macro printTable ls columns fill>
-  columns = ${columns}, fill = ${fill}:<#lt>
-  <#if fill='NULL'>
-    <#local rows = ls?chunk(columns)>
-  <#else>
-    <#local rows = ls?chunk(columns, fill)>
-  </#if>
-  Rows: ${rows?size}
-  <#list rows as row>
-    <#list row as i>${i} </#list>  <-- Columns: ${row?size}
-  </#list>
-  
-</#macro>
-
-
-Join
-----
-
-<#assign xs = [1, "two", "three", 4]>
-- ${xs?join(", ")}
-- ${[]?join(", ")}
-- ${xs?join(", ", "(empty)", ".")}
-- ${[]?join(", ", "(empty)", ".")}
-- ${listWithNull?join(", ")}
-- ${listWithNull?join(", ", "(empty)")}
-- ${listWithNull?join(", ", "(empty)", ".")}
-- ${listWithNullsOnly?join(", ")}
-- ${listWithNullsOnly?join(", ", "(empty)")}
-- ${listWithNullsOnly?join(", ", "(empty)", ".")}
-- ${abcSet?join(", ", "(empty)", ".")}
-- ${abcCollection?join(", ", "(empty)", ".")}
-<@assertFails message="index 1">${['a', [], 'c']?join(", ", "(empty)", ".")}</@>
-
-Misc
-----
-
-First of set 1: ${abcSet?first}
-First of set 2: ${abcSetNonSeq?first}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/setting.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/setting.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/setting.ftl
deleted file mode 100644
index 89f3e23..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/setting.ftl
+++ /dev/null
@@ -1,53 +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.
--->
-<#setting locale='de_DE'>
-<@assertEquals expected='de_DE' actual=.locale />
-<@assertEquals expected='de' actual=.lang />
-<@assertEquals expected='java.util.Locale "de_DE"' actual=javaObjectInfo.info(.locale_object) />
-
-<#setting number_format="'f'#">
-<@assertEquals expected='f1' actual=1?string />
-
-<#setting boolean_format="t,f">
-<@assertEquals expected='t' actual=true?string />
-
-<#setting date_format="'df'">
-<@assertEquals expected='df' actual=.now?date?string />
-
-<#setting time_format="'tf'">
-<@assertEquals expected='tf' actual=.now?time?string />
-
-<#setting datetime_format="'dtf'">
-<@assertEquals expected='dtf' actual=.now?string />
-
-<#setting time_zone='GMT+00'>
-<#assign t1='2000'?datetime('yyyy')>
-<#setting time_zone='GMT+01'>
-<#assign t2='2000'?datetime('yyyy')>
-<@assertEquals expected=1000*60*60 actual=t1?long-t2?long />
-
-<#setting sql_date_and_time_time_zone='GMT+01'>
-
-<#setting url_escaping_charset='ISO-8859-1'>
-<@assertEquals expected='%E1' actual='á'?url />
-<#setting url_escaping_charset='UTF-8'>
-<@assertEquals expected='%C3%A1' actual='á'?url />
-
-<#setting output_encoding="ISO-8859-2">
-<@assertEquals expected="ISO-8859-2" actual=.output_encoding />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/simplehash-char-key.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/simplehash-char-key.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/simplehash-char-key.ftl
deleted file mode 100644
index 07a3f1e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/simplehash-char-key.ftl
+++ /dev/null
@@ -1,44 +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.
--->
-<@assertEquals expected="string" actual=mStringC.c />
-<@assertEquals expected=1 actual=mStringC?keys?size />
-<@assertEquals expected="null" actual=mStringC.d!'null' />
-<@assertEquals expected=1 actual=mStringC?keys?size />
-
-<@assertEquals expected="null" actual=mStringCNull.c!'null' />
-<@assertEquals expected=1 actual=mStringCNull?keys?size />
-<@assertEquals expected="null" actual=mStringCNull.d!'null' />
-<@assertEquals expected=1 actual=mStringCNull?keys?size />
-
-<@assertEquals expected="char" actual=mCharC.c />
-<@assertEquals expected=1 actual=mCharC?keys?size />
-<@assertEquals expected="null" actual=mCharC.d!'null' />
-<@assertEquals expected=1 actual=mCharC?keys?size />
-
-<@assertEquals expected="null" actual=mCharCNull.c!'null' />
-<@assertEquals expected=1 actual=mCharCNull?keys?size />
-<@assertEquals expected="null" actual=mCharCNull.d!'null' />
-<@assertEquals expected=1 actual=mCharCNull?keys?size />
-
-<@assertEquals expected="char" actual=mMixed.c />
-<@assertEquals expected="string" actual=mMixed.s />
-<@assertEquals expected="string2" actual=mMixed.s2 />
-<@assertEquals expected="null" actual=mMixed.s2n!'null' />
-<@assertEquals expected="null" actual=mMixed.wrong!'null' />
-<@assertEquals expected=4 actual=mMixed?keys?size />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/specialvars.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/specialvars.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/specialvars.ftl
deleted file mode 100644
index 50416c9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/specialvars.ftl
+++ /dev/null
@@ -1,38 +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.
--->
-<#-- Mostly just checks if the expressions doesn't fail -->
-<#assign works = .data_model>
-<#attempt>
-  ${noSuchVariableExists}
-<#recover>
-  <#assign works = .error>
-</#attempt>
-<#assign works = .globals>
-${.lang} == en
-${.locale} == en_US
-<#assign works = .locals!>
-<#assign works = .main>
-<#assign works = .node!>
-${.output_encoding?lower_case} == utf-8
-${.template_name} == specialvars.ftl
-${.url_escaping_charset?lower_case} == iso-8859-1
-<#assign foo = "x">
-${.vars['foo']} == x
-<#assign works = .version>
-${.now?is_datetime?c} == true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtin-coercion.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtin-coercion.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtin-coercion.ftl
deleted file mode 100644
index 5d2e094..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtin-coercion.ftl
+++ /dev/null
@@ -1,34 +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.
--->
-Was broken 2.3.19:
-<#setting number_format="0.#">
-<@assert test=1232?contains('2') />
-<@assert test=1232?index_of('2') == 1 />
-<@assert test=1232?last_index_of('2') == 3 />
-<@assert test=1232?left_pad(6) == '  1232' /><@assert test=1232?left_pad(6, '0') == '001232' />
-<@assert test=1232?right_pad(6) == '1232  ' /><@assert test=1232?right_pad(6, '0') == '123200' />
-<@assert test=1232?matches('[1-3]+') />
-<@assert test=1232?replace('2', 'z') == '1z3z' />
-<@assert test=1232?replace('2', 'z', 'r') == '1z3z' />
-<@assert test=1232?split('2')[1] == '3' /><@assert test=1232?split('2')[2] == '' />
-<@assert test=1232?split('2', 'r')[1] == '3' />
-
-Was no broken in 2.3.19:
-<@assert test=1232?starts_with('12') />
-<@assert test=1232?ends_with('32') />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps-matches.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps-matches.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps-matches.ftl
deleted file mode 100644
index 201f404..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps-matches.ftl
+++ /dev/null
@@ -1,118 +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.
--->
-<#assign input>
-L16
-L27
-L38
-L49
-</#assign>
-
-List mode:
-<#assign matches = input?matches(".+") >
-Size: ${matches?size}
-<#list 0..<matches?size as i>[${matches[i]}]</#list>
-<#list matches as m>[${m}]</#list>
-
-Iterator mode:
-<#assign matches = input?matches(".+") >
-<#list matches as m>[${m}]</#list>
-<#list matches as m>[${m}(${matches?join(', ')})]</#list>
-<#list matches as m>[${m}]</#list>
-
-Iterator mode changes to list mode:
-<#assign matches = input?matches(".+") >
-<#list matches as m>[${m}]/${matches?size}</#list>
-<#list matches as m>[${m}]</#list>
-
-Iterator mode changes to list mode 2:
-<#assign matches = input?matches(".+") >
-<#list matches as m>[${m}]</#list>
-<#list matches as m>[${m}]/${matches?size}<#t></#list>
-
-List mode with embedded iteration:
-<#assign matches = input?matches(".+") >
-<#list 0..<matches?size as i>[${matches[i]}(${matches?join(', ')})]</#list>
-
-Entire input match:
-<#assign matches = input?matches(r".*(\d)(\d)") >
-<#assign firstGS = false>
-<#list matches as m>
-- M: ${m}
-    <#if firstGS?is_boolean>
-      <#assign firstGS = m?groups>
-    </#if>
-    <#list m?groups as g>
-    - G: ${g}
-    </#list>
-</#list>
-firstGS was: ${firstGS?join(', ')}
-
-Entire input match 2:
-<#assign match = "x12"?matches(r"x(\d)(\d)") >
-Matches: ${match?c}
-<#list match?groups as g>
-- G: ${g}
-</#list>
-As list:
-<#list match as m>
-- M: ${m}
-  <#list m?groups as g>
-    - G: ${g}
-  </#list>
-</#list>
-Groups again:
-<#list match?groups as g>
-- G: ${g}
-</#list>
-
-Entire input match 3:
-<#assign match = "x12"?matches(r"y(\d)(\d)") >
-Matches: ${match?c}
-<@assertEquals expected=3 actual=match?groups?size />
-<@assertEquals expected=0 actual=match?size />
-
-Entire input match 4:
-<#assign match = "x12"?matches(r"x(\d)(\d)") >
-Matches: ${match?c}
-<#assign gs = match?groups>
-<@assertEquals expected=3 actual=gs?size />
-<@assertEquals expected=1 actual=match?size />
-- G: ${gs[0]}
-- G: ${match?groups[1]}
-- G: ${gs[2]}
-
-Substring match nested into entire input match:
-<#assign match = "x12"?matches(r"x(\d)(\d)") >
-<#list match?groups as g>
-- G: ${g} (<#list match as m>[${m}{${m?groups?join(', ')}}]</#list>)
-</#list>
-
-Different entire input and substring matches:
-<#assign match = "123"?matches(r"(\d+?)") >
-${match?groups?join(", ")}
-<#list match as m>
-- M: ${m} (Gs: ${m?groups?join(", ")})
-</#list>
-
-Different entire input and substring matches 2:
-<#assign match = "123"?matches(r"\d+?") >
-${match?groups?join(", ")}
-<#list match as m>
-- M: ${m} (Gs: ${m?groups?join(", ")})
-</#list>
\ No newline at end of file


[12/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl
new file mode 100644
index 0000000..a5accaf
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl
@@ -0,0 +1,155 @@
+<#--
+  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.
+-->
+<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
+<#setting time_zone="GMT+02">
+<@assertEquals actual=d?string.xs  expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string.iso expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string('xs')  expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string('iso') expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string.xs_nz  expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?string.iso_nz expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?string.xs_fz  expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string.iso_fz expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?string.xs_u  expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?string.iso_u expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?string.xs_s_u  expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?string.iso_s_u expected="2010-05-15T20:38:05Z" />
+
+<@assertEquals actual=d?date?string.xs  expected="2010-05-15+02:00" />
+<@assertEquals actual=d?date?string.iso expected="2010-05-15" />
+<@assertEquals actual=d?date?string.xs_nz  expected="2010-05-15" />
+<@assertEquals actual=d?date?string.iso_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?string.xs_fz  expected="2010-05-15+02:00" />
+<@assertEquals actual=d?date?string.iso_fz expected="2010-05-15" />
+
+<@assertEquals actual=d?time?string.xs  expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?string.iso expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?string.xs_nz  expected="22:38:05.023" />
+<@assertEquals actual=d?time?string.iso_nz expected="22:38:05.023" />
+<@assertEquals actual=d?time?string.xs_fz  expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?string.iso_fz expected="22:38:05.023+02:00" />
+
+<#-- java.sql treatment -->
+<@assertEquals actual=sqlDate?string.xs  expected="2010-05-15" />
+<@assertEquals actual=sqlDate?string.iso expected="2010-05-15" />
+<@assertEquals actual=sqlDate?string.xs_fz  expected="2010-05-15+02:00" />
+<@assertEquals actual=sqlDate?string.iso_fz expected="2010-05-15" />
+<@assertEquals actual=sqlDate?string.xs_nz  expected="2010-05-15" />
+<@assertEquals actual=sqlDate?string.iso_nz expected="2010-05-15" />
+<@assertEquals actual=sqlTime?string.xs  expected="22:38:05.023" />
+<@assertEquals actual=sqlTime?string.iso expected="22:38:05.023" />
+<@assertEquals actual=sqlTime?string.xs_fz  expected="22:38:05.023+02:00" />
+<@assertEquals actual=sqlTime?string.iso_fz expected="22:38:05.023+02:00" />
+<@assertEquals actual=sqlTime?string.xs_nz  expected="22:38:05.023" />
+<@assertEquals actual=sqlTime?string.iso_nz expected="22:38:05.023" />
+
+<#assign d = "12:30:15:1 +0200"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?string.xs  expected="12:30:15.001+02:00" />
+<@assertEquals actual=d?string.iso expected="12:30:15.001+02:00" />
+<@assertEquals actual=d?string.xs_ms  expected="12:30:15.001+02:00" />
+<@assertEquals actual=d?string.iso_ms expected="12:30:15.001+02:00" />
+<@assertEquals actual=d?string.iso_s expected="12:30:15+02:00" />
+<@assertEquals actual=d?string.iso_m expected="12:30+02:00" />
+<@assertEquals actual=d?string.iso_h expected="12+02:00" />
+<#assign d = "12:30:15:10 +0200"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?string.xs  expected="12:30:15.01+02:00" />
+<@assertEquals actual=d?string.iso expected="12:30:15.01+02:00" />
+<@assertEquals actual=d?string.xs_ms  expected="12:30:15.010+02:00" />
+<@assertEquals actual=d?string.iso_ms expected="12:30:15.010+02:00" />
+<#assign d = "12:30:15:100 +0200"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?string.xs  expected="12:30:15.1+02:00" />
+<@assertEquals actual=d?string.iso expected="12:30:15.1+02:00" />
+<@assertEquals actual=d?string.xs_ms  expected="12:30:15.100+02:00" />
+<@assertEquals actual=d?string.iso_ms expected="12:30:15.100+02:00" />
+<#assign d = "12:30:15:0 +0200"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?string.xs  expected="12:30:15+02:00" />
+<@assertEquals actual=d?string.iso expected="12:30:15+02:00" />
+<@assertEquals actual=d?string.xs_ms  expected="12:30:15.000+02:00" />
+<@assertEquals actual=d?string.iso_ms expected="12:30:15.000+02:00" />
+
+<#setting time_zone="GMT+02">
+<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
+<@assertEquals actual=d?string.xs  expected="2010-05-15+02:00" />
+<@assertEquals actual=d?string.iso expected="2010-05-15" />
+<#setting time_zone="GMT+00">
+<@assertEquals actual=d?string.xs  expected="2010-05-14Z" />
+<@assertEquals actual=d?string.iso expected="2010-05-14" />
+
+<#setting time_zone="GMT+02:30">
+<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
+<@assertEquals actual=d?string.xs  expected="2010-05-15T00:00:00+02:30" />
+<@assertEquals actual=d?string.iso expected="2010-05-15T00:00:00+02:30" />
+
+<#setting time_zone="GMT-05">
+<#setting locale = "en_US">
+<#assign d = "BC 0001-05-15"?date("G yyyy-MM-dd")>
+<#-- Tests that: (a) BC 1 isn't 0 like in ISO 8601; (b) No Julian calendar is used.  -->
+<@assertEquals actual=d?string.xs  expected="-1-05-13-05:00" />
+<@assertEquals actual=d?string.iso expected="0000-05-13" />
+
+<#assign dt = "2010-05-15T01:02:03"?datetime.xs>
+<#setting datetime_format="xs">
+<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" />
+<#setting datetime_format="xs u">
+<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
+<#setting datetime_format="iso u">
+<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
+<#setting datetime_format="xs fz">
+<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" />
+<#setting datetime_format="xs fz u">
+<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
+<#setting datetime_format="xs nz u">
+<@assertEquals actual=dt?string expected="2010-05-15T06:02:03" />
+<#setting datetime_format="iso m nz">
+<@assertEquals actual=dt?string expected="2010-05-15T01:02" />
+
+<#assign d = dt?date>
+<#setting date_format="xs">
+<@assertEquals actual=d?string expected="2010-05-15-05:00" />
+<#setting date_format="iso">
+<@assertEquals actual=d?string expected="2010-05-15" />
+<#setting date_format="xs fz">
+<@assertEquals actual=d?string expected="2010-05-15-05:00" />
+<#setting date_format="xs fz u">
+<@assertEquals actual=d?string expected="2010-05-15Z" />
+<#setting date_format="iso fz u">
+<@assertEquals actual=d?string expected="2010-05-15" />
+<#setting date_format="xs nz">
+<@assertEquals actual=d?string expected="2010-05-15" />
+
+<#assign t = dt?time>
+<@assertEquals actual=d?string expected="2010-05-15" />
+<#setting time_format="xs">
+<@assertEquals actual=t?string expected="01:02:03-05:00" />
+<#setting time_format="iso_m">
+<@assertEquals actual=t?string expected="01:02-05:00" />
+<#setting time_format="xs fz">
+<@assertEquals actual=t?string expected="01:02:03-05:00" />
+<#setting time_format="xs nz">
+<@assertEquals actual=t?string expected="01:02:03" />
+<#setting time_format="iso nz ms">
+<@assertEquals actual=t?string expected="01:02:03.000" />
+
+<@assertFails message="Use ?date, ?time, or ?datetime">${unknownDate?string.xs}</@>
+<@assertFails message="Use ?date, ?time, or ?datetime">${unknownDate?string.iso}</@>
+<@assertFails message="format string">${.now?string.xs_fz_nz}</@>
+<@assertFails message="format string">${.now?string.xs_u_fu}</@>
+<@assertFails message="format string">${.now?string.xs_s_ms}</@>
+<@assertFails message="format string">${.now?string.xs_q}</@>
+<@assertFails message="format string">${.now?string.xss}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl
new file mode 100644
index 0000000..82001db
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl
@@ -0,0 +1,71 @@
+<#--
+  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.
+-->
+<#setting locale="en_US">
+<#setting time_zone="GMT">
+<#setting datetime_format="">
+${date}
+${unknownDate?datetime}
+${date?string}
+${date?string[""]}
+${date?string.short}
+${date?string.medium}
+${date?string.long}
+${date?string.short_short}
+${date?string.short_medium}
+${date?string.short_long}
+${date?string.medium_short}
+${date?string.medium_medium}
+${date?string.medium_long}
+${date?string.long_short}
+${date?string.long_medium}
+${date?string.long_long}
+${unknownDate?date}
+${date?date?string[""]}
+${date?date?string.short}
+${date?date?string.medium}
+${date?date?string.long}
+${unknownDate?time}
+${date?time?string[""]}
+${date?time?string.short}
+${date?time?string.medium}
+${date?time?string.long}
+<#setting locale="hu_hu">
+<#setting datetime_format="long_long">
+${date}
+<#setting locale="en_US">
+<#setting datetime_format="EEE, dd MMM yyyyy HH:mm:ss z">
+${date}
+${unknownDate?string["EEE, dd MMM yyyy HH:mm:ss z"]}
+${unknownDate?string("EEE, dd MMM yyyy HH:mm:ss z")}
+${unknownDate?string.yyyy}
+
+<#setting datetime_format="yyyy">
+<#assign s = date?string>
+${s}
+<#setting datetime_format="MM">
+${s}
+
+<#-- Check ?string lazy evaluation bug was fixed: -->
+<#setting datetime_format="yyyy">
+<#assign s = date?string>
+<#-- no ${s} -->
+<#setting datetime_format="MM">
+${s}
+<#assign s = date?string>
+${s}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateparsing.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateparsing.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateparsing.ftl
new file mode 100644
index 0000000..d830f95
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateparsing.ftl
@@ -0,0 +1,84 @@
+<#--
+  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.
+-->
+<#setting locale="en_US">
+<#setting time_zone="GMT">
+<#setting datetime_format="G yyyy-MM-dd HH:mm:ss.S Z">
+<#setting date_format="G yyyy-MM-dd Z">
+<#setting time_format="HH:mm:ss.S Z">
+
+<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000" actual='AD 1998-10-30 19:30:44.512 +0400'?datetime?string />
+<@assertEquals expected="AD 1998-10-29 +0000" actual='AD 1998-10-30 +0400'?date?string />
+<@assertEquals expected="15:30:44.512 +0000" actual='19:30:44.512 +0400'?time?string />
+
+<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000"
+               actual='10/30/1998 19:30:44:512 GMT+04:00'?datetime("MM/dd/yyyy HH:mm:ss:S z")?string />
+<@assertEquals expected="AD 1998-10-29 +0000"
+               actual='10/30/1998 GMT+04:00'?date("MM/dd/yyyy z")?string />
+<@assertEquals expected="15:30:44.512 +0000"
+               actual='19:30:44:512 GMT+04:00'?time("HH:mm:ss:S z")?string />
+
+<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000" actual='1998-10-30T19:30:44.512+04:00'?datetime.xs?string />
+<@assertEquals expected="AD 1998-10-29 +0000" actual='1998-10-30+04:00'?date.xs?string />
+<@assertEquals expected="15:30:44.512 +0000" actual='19:30:44.512+04:00'?time.xs?string />
+
+<#assign gmtStr='1998-10-30T19:30:44.512'?datetime.xs?string />
+<#setting time_zone="GMT+01:00">
+<#assign gmt01Str='1998-10-30T19:30:44.512'?datetime.xs?string />
+<#setting time_zone="default">
+<#assign defStr='1998-10-30T19:30:44.512'?datetime.xs?string />
+<@assert test = gmtStr != gmt01Str />
+<@assert test = defStr != gmtStr || defStr != gmt01Str />
+
+<#assign refDate = "AD 1998-10-30 +0000"?date>
+<#assign refTime = "15:30:44.512 +0000"?time>
+<#assign refDateTime = "AD 1998-10-30 15:30:44.512 +0000"?datetime>
+<#setting time_zone="UTC">
+<#list ['xs', 'xs_nz', 'xs_fz', 'xs s', 'xs ms'] as format>
+  <#setting date_format=format>
+  <#setting time_format=format>
+  <#setting datetime_format=format>
+  <@assertEquals expected=refDate actual="1998-10-30Z"?date />
+  <@assertEquals expected=refTime actual="15:30:44.512Z"?time />
+  <@assertEquals expected=refDateTime actual="1998-10-30T15:30:44.512Z"?datetime />
+</#list>
+<#list ['iso', 'iso_nz', 'iso_fz', 'iso m'] as format>
+  <#setting date_format=format>
+  <#setting time_format=format>
+  <#setting datetime_format=format>
+  <@assertEquals expected=refDate actual="1998-10-30"?date />
+  <@assertEquals expected=refDate actual="19981030"?date />
+  <@assertEquals expected=refTime actual="15:30:44,512Z"?time />
+  <@assertEquals expected=refTime actual="153044,512Z"?time />
+  <@assertEquals expected=refDateTime actual="1998-10-30T15:30:44,512Z"?datetime />
+  <@assertEquals expected=refDateTime actual="19981030T153044,512Z"?datetime />
+</#list>
+
+<#setting time_zone="GMT+01:00">
+<#assign refDateTime='1998-10-30T19:30:44.512'?datetime.xs />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512"?datetime.xs />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512"?datetime.iso />
+<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.xs_u />
+<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.iso_u />
+<#setting time_zone="UTC">
+<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.xs />
+<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.iso />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01:00"?datetime.xs />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01:00"?datetime.xs_u />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01"?datetime.iso />
+<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01"?datetime.iso_u />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-object-wrapper.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-object-wrapper.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-object-wrapper.ftl
new file mode 100644
index 0000000..21efc05
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-object-wrapper.ftl
@@ -0,0 +1,59 @@
+<#--
+  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.
+-->
+<#list array as item>
+${item}
+</#list>
+${array?size}
+${array[0]}
+${array[1]}
+<#list list as item>
+${item}
+</#list>
+${list?size}
+${list?hasContent?then('not empty', 'empty')}
+${list[0]}
+${map.key}
+${map?api.get(objKey)}
+${obj.foo}
+<#if obj.foo?exists>hasfoo<#else>nofoo</#if>
+<#if obj.baz?exists>hasbaz<#else>nobaz</#if>
+${obj.bar[0]}
+${obj.getFoo()}
+${obj.overloaded(1?int)}
+${obj.overloaded("String")}
+${resourceBundle.message}
+${resourceBundle("format", date)}
+<#assign static = statics["org.apache.freemarker.core.templatesuite.models.BeanTestClass"]>
+${static.staticMethod()}
+${static.staticOverloaded(1)}
+${static.staticOverloaded("String")}
+${static.STATIC_FINAL_FIELD}
+${static.STATIC_FIELD}
+<#assign enum = enums["org.apache.freemarker.core.templatesuite.models.EnumTestClass"]>
+${enum.ONE}
+${enum.TWO}
+${enum.THREE}
+${(enum.ONE == enum.ONE)?string("true", "false")}
+${(enum.ONE == enum.TWO)?string("true", "false")}
+${enums["org.apache.freemarker.core.templatesuite.models.BeanTestClass"]?exists?string("true", "false")}
+${obj.something}
+${obj.publicInner.x}
+${obj.publicInner.m()}
+<@assertFails message="obj.privateInner.x">${obj.privateInner.x}</@>
+<@assertFails message="obj.privateInner.m">${obj.privateInner.m()}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-xmlns.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-xmlns.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-xmlns.ftl
new file mode 100644
index 0000000..4f01835
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default-xmlns.ftl
@@ -0,0 +1,28 @@
+<#ftl ns_prefixes={"D" : "http://x.com", "y" : "http://y.com"}>
+<#--
+  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.
+-->
+<#assign r = doc.*[0]>
+${r["N:t1"]?default('-')} = No NS
+${r["t2"]?default('-')} = x NS
+${r["y:t3"]?default('-')} = y NS
+${r["./D:t4"]?default('-')} = x NS
+
+<#assign bool = doc["true()"]>
+${bool?string}
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default.ftl
new file mode 100644
index 0000000..6ecf8b3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/default.ftl
@@ -0,0 +1,34 @@
+<#--
+  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.
+-->
+${UNDEFINED!"foo"}
+
+<#assign duck = (FOO.BAR)!"luck">
+${duck}
+
+<#list UNDEFINED![] as item>
+   ${item}
+</#list>
+
+${UNDEFINED![]?size}
+
+<#if UNDEFINED??>
+   UNDEFINED is defined.
+<#else>
+   UNDEFINED is undefined.
+</#if>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/encoding-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/encoding-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/encoding-builtins.ftl
new file mode 100644
index 0000000..6ee2a26
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/encoding-builtins.ftl
@@ -0,0 +1,52 @@
+<#--
+  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.
+-->
+FreeMarker: Encoding built-in tests
+
+<#assign x = "&<>\"'{}\\a/">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+rtf:  [${x?rtf}]
+<#assign x = "a&a<a>a\"a'a{a}a\\">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+rtf:  [${x?rtf}]
+<#assign x = "<<<<<">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+<#assign x = "{{{{{">
+rtf:  [${x?rtf}]
+<#assign x = "">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+rtf:  [${x?rtf}]
+<#assign x = "a">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+rtf:  [${x?rtf}]
+<#assign x = "&">
+html: [${x?html}]
+xml:  [${x?xml}]
+xhtml: [${x?xhtml}]
+<#assign x = "{">
+rtf:  [${x?rtf}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/escapes.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/escapes.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/escapes.ftl
new file mode 100644
index 0000000..20efc67
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/escapes.ftl
@@ -0,0 +1,79 @@
+<#--
+  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.
+-->
+<#assign h=["","a","b","c"]>
+<#assign g={"x":1,"y":2,"z":3}>
+<#escape x as h[x]>
+${1}
+${2}
+${3}
+<#escape x as g[x]>
+${"x"}
+${"y"}
+${"z"}
+<#noescape>${1}</#noescape>
+<#noescape><#noescape>${1}</#noescape></#noescape>
+</#escape>
+${1}
+${2}
+${3}
+</#escape>
+<#escape x as x?html>
+${"<&>"}
+<#escape x as x?xml>
+${"<&>"}
+</#escape>
+${"<&>"}
+</#escape>
+---
+<#assign x = "<Mooo>">
+${x} = <Mooo>
+<#escape x as x?upper_case>
+  ${x} = <MOOO>
+  <#escape x as x?html>
+    ${x} = &lt;MOOO&gt;
+    <#noescape>
+      ${x} = <MOOO>
+    </#noescape>
+    ${x} = &lt;MOOO&gt;
+  </#escape>
+  ${x} = <MOOO>
+  <#noescape>
+    ${x} = <Mooo>
+    <#escape x as x?html>
+      ${x} = &lt;Mooo&gt;
+      <#noescape>
+        ${x} = <Mooo>
+      </#noescape>
+      ${x} = &lt;Mooo&gt;
+    </#escape>
+    ${x} = <Mooo>
+  </#noescape>
+  ${x} = <MOOO>
+</#escape>
+<#escape az as ["red", "green", "blue"][az-1]>
+  ${1} ${2} ${3}
+</#escape>
+---
+<#assign s = 'A&B'>
+<#escape x as '<' + x?html + '>[' + x?lower_case + '](' + x + ')'>
+  ${s} ${s + 2}
+  <#escape x as '{' + x?lower_case + '}' + x>
+    ${s} ${s + 2}
+  </#escape>
+</#escape>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception.ftl
new file mode 100644
index 0000000..83ae356
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception.ftl
@@ -0,0 +1,31 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Exception Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message} <br />
+${test}</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception2.ftl
new file mode 100644
index 0000000..83ae356
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception2.ftl
@@ -0,0 +1,31 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Exception Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message} <br />
+${test}</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception3.ftl
new file mode 100644
index 0000000..f386fec
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/exception3.ftl
@@ -0,0 +1,31 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Exception Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message} <br />
+${%@#$test}</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/existence-operators.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/existence-operators.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/existence-operators.ftl
new file mode 100644
index 0000000..2f9bdce
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/existence-operators.ftl
@@ -0,0 +1,141 @@
+<#--
+  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.
+-->
+<@isIRE>${v}</@>
+<@isIRE>${w}</@>
+<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
+
+<@assertEquals actual=v!'-' expected='-' />
+<@assertEquals actual=(v)!'-' expected='-' />
+<@assertEquals actual=(v!) expected='' />
+<@assertEquals actual=((v)!) expected='' />
+<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
+<@assertEquals actual=v?? expected=false />
+<@assertEquals actual=(v)?? expected=false />
+<@assertEquals actual=v?default('-') expected='-' />
+<@assertEquals actual=(v)?default('-') expected='-' />
+<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
+<@assertEquals actual=v?exists expected=false />
+<@assertEquals actual=(v)?exists expected=false />
+<@assertEquals actual=v?if_exists expected='' />
+<@assertEquals actual=(v)?if_exists expected='' />
+<@assertEquals actual=v?has_content expected=false />
+<@assertEquals actual=(v)?has_content expected=false />
+
+<@assertEquals actual=v?default(w, '-') expected='-' />
+<@assertEquals actual=v!w!'-' expected='-' />
+<#assign w = 'W'>
+<@assertEquals actual=v?default(w, '-') expected='W' />
+<@assertEquals actual=v!w!'-' expected='W' />
+
+<#list ['V', 1.5] as v>
+	<@assertEquals actual=v!'-' expected=v />
+	<@assertEquals actual=(v)!'-' expected=v />
+	<@assert test=v?? />
+	<@assert test=(v)?? />
+	<@assertEquals actual=v?default('-') expected=v />
+	<@assertEquals actual=(v)?default('-') expected=v />
+	<@assert test=v?exists />
+	<@assert test=(v)?exists />
+	<@assertEquals actual=v?if_exists expected=v />
+	<@assertEquals actual=(v)?if_exists expected=v />
+	<@assert test=v?has_content />
+	<@assert test=(v)?has_content />
+</#list>
+<@assert test=!v?? />
+<@assert test=!v?exists />
+<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
+
+<@isIRE>${u.v!'-'}</@>
+<@assertEquals actual=(u.v)!'-' expected='-' />
+<@isIRE>${u.v??}</@>
+<@assertEquals actual=(u.v)?? expected=false />
+<@isIRE>${u.v?default('-')}</@>
+<@assertEquals actual=(u.v)?default('-') expected='-' />
+<@isIRE>${u.v?exists}</@>
+<@assertEquals actual=(u.v)?exists expected=false />
+<@isIRE>${u.v?if_exists}</@>
+<@assertEquals actual=(u.v)?if_exists expected='' />
+<@isIRE>${u.v?has_content}</@>
+<@assertEquals actual=(u.v)?has_content expected=false />
+
+<#assign u = { 'x': 'X' } >
+<@assertEquals actual=u.v!'-' expected='-' />
+<@assertEquals actual=(u.v)!'-' expected='-' />
+<@assertEquals actual=u.v?? expected=false />
+<@assertEquals actual=(u.v)?? expected=false />
+<@assertEquals actual=u.v?default('-') expected='-' />
+<@assertEquals actual=(u.v)?default('-') expected='-' />
+<@assertEquals actual=u.v?exists expected=false />
+<@assertEquals actual=(u.v)?exists expected=false />
+<@assertEquals actual=u.v?if_exists expected='' />
+<@assertEquals actual=(u.v)?if_exists expected='' />
+<@assertEquals actual=u.v?has_content expected=false />
+<@assertEquals actual=(u.v)?has_content expected=false />
+
+<#assign u = { 'v': 'V' } >
+<@assertEquals actual=u.v!'-' expected='V' />
+<@assertEquals actual=(u.v)!'-' expected='V' />
+<@assert test=u.v?? />
+<@assert test=(u.v)?? />
+<@assertEquals actual=u.v?default('-') expected='V' />
+<@assertEquals actual=(u.v)?default('-') expected='V' />
+<@assert test=u.v?exists />
+<@assert test=(u.v)?exists />
+<@assertEquals actual=u.v?if_exists expected='V' />
+<@assertEquals actual=(u.v)?if_exists expected='V' />
+<@assert test=u.v?has_content />
+<@assert test=(u.v)?has_content />
+
+<#list 1..4 as i>
+  <#if i == 3><#assign x = 'X'></#if>
+  <@assertEquals actual=((x!'-') == '-') expected=(i < 3) />
+</#list>
+
+<#macro attemptTest>
+  <#attempt>
+    ${fails}
+  <#recover>
+    <@assert test=isNonFastIREMessage(.error) />
+  </#attempt>
+</#macro>
+<@attemptTest />
+${(callMacroFromExpression(attemptTest))!}
+
+<#macro interpretTest><@'$\{fails}'?interpret /></#macro>
+<#attempt>
+  <@interpretTest />
+<#recover>
+  <@assert test=isNonFastIREMessage(.error) />
+</#attempt>
+<#attempt>
+  ${(callMacroFromExpression(interpretTest))!}
+<#recover>
+  <@assert test=isNonFastIREMessage(.error) />
+</#attempt>
+
+<@assertEquals actual='fails'?eval!'-' expected='-' />
+<@assertEquals actual=('fails')?eval!'-' expected='-' />
+
+<#macro isIRE><@assertFails exception="InvalidReferenceException"><#nested></@></#macro>
+<#macro isNonFastIRE><@assertFails exception="InvalidReferenceException" message="Tip:"><#nested></@></#macro>
+<#function isNonFastIREMessage msg><#return msg?contains('Tip:') && msg?contains('null or missing')></#function>
+<#function callMacroFromExpression m>
+  <#local captured><@m /></#local>
+  <#return captured>
+</#function>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashconcat.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashconcat.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashconcat.ftl
new file mode 100644
index 0000000..127d828
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashconcat.ftl
@@ -0,0 +1,60 @@
+[#ftl]
+[#--
+  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.
+--]
+[#assign a = {"a":1, "b":2, "c":3, "X": 4}]
+[#assign b = {"d":10, "e":20, "f":30, "X": 40}]
+
+a:
+[@dump a /]
+
+B:
+[@dump b /]
+
+a + B:
+[@dump a + b /]
+
+B + a:
+[@dump b + a /]
+
+a + a:
+[@dump a + a /]
+
+{} + a:
+[@dump {} + a /]
+
+a + {}:
+[@dump a + {} /]
+
+{} + {}:
+[@dump {} + {} /]
+
+a + b + {} + b + {} + a:
+[@dump a + b + {} + b + {} + a /]
+
+
+[#macro dump s]
+[#list s?keys as k]
+  ${k} = ${s[k]}
+[/#list]
+  ---
+[#list s?values as v]
+  ${v}
+[/#list]
+  ---
+[/#macro]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashliteral.ftl
new file mode 100644
index 0000000..0a02a3a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/hashliteral.ftl
@@ -0,0 +1,100 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Hash Literal Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now perform a hash assignment:</p>
+
+<#assign mymessage = "hello", foo="bar", one="1">
+<#assign test = { "test1": "test23", 
+                 "test45" : message, 
+                  mymessage : "hello all", 
+                  foo: one}>
+
+${test.test1}
+${test.test45}
+${test.hello}
+${test.bar}
+
+<p>Now update the assignment and repeat:</p>
+
+<#assign mymessage = "world">
+
+${test.test1}
+${test.test45}
+${test.hello}
+
+${test.bar}
+
+<p>Now reassign the list and repeat:</p>
+
+<#assign hash= {"temp" : "Temporary"}>
+<#assign test = { "test1" : "test23", 
+                        "test45" : message, 
+                        mymessage : "hello all", 
+                        foo : one, 
+                        "hash" : hash[ "temp" ], 
+                        "true" : hash.temp, 
+                        "newhash" : hash}>
+
+${test.test1}
+${test.test45}
+${test.hello?if_exists}
+
+${test.bar}
+${test.hash}
+${test.true}
+${test.newhash.temp}
+
+<p>Pathological case: zero item hash:</p>
+
+<#assign test = {}>
+${test.test1?if_exists}
+
+<p>Hash of number literals:</p>
+<#assign test = {"1" : 2}>
+${test["1"]}
+
+<p>Hash concatenation:</p>
+<#assign cc = { "a" : 1, "b" : 2 } + { "b" : 3, "c" : 4 }>
+<#list cc?keys?sort as key>
+${key} => ${cc[key]}
+</#list>
+
+<p>Empty hash concatenation:</p>
+${({} + { "a" : "foo" }).a}, ${({ "a" : "bar" } + {}).a}
+
+</body>
+</html>
+<@noOutput>
+
+<#assign m = { 'a': 1, 'b', 2, 'a': 3 }>
+<@assertEquals expected="a, b" actual=m?keys?join(', ') />
+<@assertEquals expected="3, 2" actual=m?values?join(', ') />
+<@assertEquals expected=3 actual=m['a'] />
+<@assertEquals expected=2 actual=m['b'] />
+
+</...@noOutput>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/helloworld.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/helloworld.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/helloworld.ftl
new file mode 100644
index 0000000..91816f6
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/helloworld.ftl
@@ -0,0 +1,30 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Exec Model Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${exec( "java freemarker.test.HelloWorld" )}</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-escaping.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-escaping.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-escaping.ftl
new file mode 100644
index 0000000..9b39235
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-escaping.ftl
@@ -0,0 +1,81 @@
+<#--
+  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.
+-->
+<#macro m\-a data\-color>
+    <#local \.namespace = 123>
+    <a-b>${data\-color}<#nested \.namespace></a-b><#t>
+</#macro>
+<#macro "m-b2"></#macro>
+<#macro "m/b2"></#macro>
+
+<@m\-a data\-color="red"; loop\-var>${loop\-var}</@>
+
+<#function f\-a p\-a>
+    <#return p\-a + " works">
+</#function>
+${f\-a("f-a")}
+
+<#assign \-\-\-\.\: = 'dash-dash-dash etc.'>
+${\-\-\-\.\:}
+${.vars['---.:']}
+<#assign hash = { '--moz-prop': 'propVal' }>
+${hash.\-\-moz\-prop}
+${hash['--moz-prop']}
+
+<#assign ls\:a = 1..3>
+List: <#list ls\:a as \:i>${\:i}</#list>
+
+<#assign sw\-a=1>
+Switch: <#switch sw\-a>
+    <#case 1>OK<#break>
+    <#default>Fails
+</#switch>
+
+<#escape \-x as \-x?upper_case>${'escaped'}</#escape>
+
+<#if false && sw\-a == 1>
+    <#visit x\-y2 using x\-y1>
+    <#recurse x\-y2 using x\-y1>
+    <#import i\-a as i\-b>
+    <#include i\-c>
+</#if>
+
+<#assign @as@_a = 'as1'>
+${@as@_a}
+<#assign 'as-c' = 'as2'>
+${.vars['as-c']}
+<#assign "as/b" = 'as3'>
+${.vars["as/b"]}
+<#assign "as'c" = 'as4'>
+${.vars["as'c"]}
+<#assign 'as"d' = 'as5'>
+${.vars['as"d']}
+
+<#global g\-a=1 g\-b=2 "g-c"=3>
+
+<#macro catchAll x y attrs...>
+<catchAll x=${x} y=${y}<#list attrs?keys?sort as k> ${k}=${attrs[k]}</#list> />
+</#macro>
+<@catchAll x=1 y=2 z=3 data\-foo=4 a\:b\.c=5 />
+
+<#macro dumpNS>
+    <#list .namespace?keys?sort as k>
+        ${k} = <#local v = .namespace[k]><#if v?is_string>${v}<#else>...</#if><#lt>
+    </#list>
+</#macro>
+<@dumpNS />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-non-ascii.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-non-ascii.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-non-ascii.ftl
new file mode 100644
index 0000000..59a4b0e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/identifier-non-ascii.ftl
@@ -0,0 +1,21 @@
+<#--
+  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.
+-->
+<#macro árvíztűrőTükörfúrógép טֶקסט>${טֶקסט}</#macro>
+<#assign 한국어_키보드="Korean Keyboard">
+<@árvíztűrőTükörfúrógép 한국어_키보드 />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/if.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/if.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/if.ftl
new file mode 100644
index 0000000..97c3f4b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/if.ftl
@@ -0,0 +1,109 @@
+<#--
+  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.
+-->
+<#assign x = 1>
+
+- <#if x == 1>good</#if>
+- <#if x == 1></#if>good
+- <#if x == 1>goo${missing!'d'}</#if>
+- <#if x == 0>wrong</#if>good
+
+- <#if x == 1>good<#else>wrong</#if>
+- <#if x == 0>wrong<#else>good</#if>
+
+- <#if x == 1>good<#elseif x == 2>wrong<#else>wrong</#if>
+- <#if x == 1>good<#elseif x == 1>wrong<#else>wrong</#if>
+- <#if x == 0>wrong<#elseif x == 1>good<#else>wrong</#if>
+- <#if x == 0>wrong<#elseif x == 2>wrong<#else>good</#if>
+
+- <#if x == 1>good<#elseif x == 1>wrong</#if>
+- <#if x == 0>wrong<#elseif x == 1>good</#if>
+- <#if x == 0>wrong<#elseif x == 2>wrong</#if>good
+- <#if x == 0>wrong<#elseif x == 1><#else>wrong</#if>good
+
+<#-- Same with pre-calculable results, just in case later the dead code will be optimized out: -->
+- <#if 1 == 1>good</#if>
+- <#if 1 == 0>wrong</#if>good
+- <#if 1 == 1>goo${missing!'d'}</#if>
+- <#if 1 == 0>wrong</#if>good
+
+- <#if 1 == 1>good<#else>wrong</#if>
+- <#if 1 == 0>wrong<#else>good</#if>
+
+- <#if 1 == 1>good<#elseif 1 == 2>wrong<#else>wrong</#if>
+- <#if 1 == 1>good<#elseif 1 == 1>wrong<#else>wrong</#if>
+- <#if 1 == 0>wrong<#elseif 1 == 1>good<#else>wrong</#if>
+- <#if 1 == 0>wrong<#elseif 1 == 2>wrong<#else>good</#if>
+
+- <#if 1 == 1>good<#elseif 1 == 1>wrong</#if>
+- <#if 1 == 0>wrong<#elseif 1 == 1>good</#if>
+- <#if 1 == 0>wrong<#elseif 1 == 2>wrong</#if>good
+- <#if 1 == 0>wrong<#elseif 1 == 1><#else>wrong</#if>good
+
+<#-- Varying branch choice of the same AST nodes: -->
+<#list [1, 2, 3, 4] as x>
+- <#if x == 1>1</#if>
+- <#if x == 2>2</#if>
+- <#if x == 3>3</#if>
+- <#if x == 1>is 1<#else>isn't 1</#if>
+- <#if x == 2>is 2<#else>isn't 2</#if>
+- <#if x == 3>is 3<#else>isn't 3</#if>
+- Finally, it's: <#if x == 1>1<#elseif x == 2>2<#elseif x == 3>3<#else>4</#if>
+</#list>
+
+<#-- nested -->
+<#list [1, 2, 3] as x><#list [1, 2, 3] as y>
+  <#assign y = x * x>
+  <#if x == 1>
+    1:
+    <#if (x > y)>
+      > ${y}
+    <#elseif x == y>
+      == ${y}
+    <#else>
+      <= ${y}
+    </#if>
+  <#elseif x == 2>
+    2:
+    <#if (x > y)>
+      > ${y}
+    <#elseif x == y>
+      == ${y}
+    <#else>
+      <= ${y}
+    </#if>
+  <#else>
+    3:
+    <#if (x > y)>
+      > ${y}
+    <#elseif x == y>
+      == ${y}
+    <#else>
+      <= ${y}
+    </#if>
+    <#if x == 3 && y == 3>
+      End
+    </#if>
+  </#if>
+</#list></#list>
+
+<#-- parsing errors -->
+<@assertFails message="valid #if-#elseif-#else"><@"<#if t><#else><#elseif t2></#if>"?interpret /></@>
+<@assertFails message="valid #if-#elseif-#else"><@"<#if t><#else><#else></#if>"?interpret /></@>
+<@assertFails message="valid #if-#elseif-#else"><@"<#else></#else>"?interpret /></@>
+<@assertFails message="valid #if-#elseif-#else"><@"<#elseif t></#elseif>"?interpret /></@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import.ftl
new file mode 100644
index 0000000..bddd857
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import.ftl
@@ -0,0 +1,45 @@
+<#--
+  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.
+-->
+--
+<#-- import "/import_lib.ftl" as my -->
+--
+
+<#if mail?exists || test?exists>
+  <#stop "mail or test should not exist">
+</#if>
+
+${my.mail}
+<@my.test foo="bar"/>
+
+<#assign mail="jsmith@other1.com">
+${my.mail}
+<@my.test foo="bar"/>
+
+<#assign mail in my>
+  jsmith@other2.com<#t>
+</#assign>
+${my.mail}
+<@my.test foo="bar"/>
+
+<#import "/import_lib.ftl" as my2>
+${my2.mail}
+<#assign mail="jsmith@other3.com" in my2>
+${my.mail}
+
+${my2.doubleUp("foobar")}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import_lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import_lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import_lib.ftl
new file mode 100644
index 0000000..3329af9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/import_lib.ftl
@@ -0,0 +1,31 @@
+<#--
+  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.
+-->
+<#macro test foo>
+  Test ${foo}.
+  Email: ${mail}
+  <#if .main.mail?exists>
+    Email in the root: ${.main.mail}
+  </#if>
+</#macro>
+
+<#function doubleUp foo>
+   <#return foo+foo>
+</#function>
+
+<#assign mail = "jsmith@acme.com">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include.ftl
new file mode 100644
index 0000000..3e997e7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include.ftl
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Include Instruction Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+${message}
+
+<#if message?exists>
+	<p>Message exists!
+</#if>
+
+<p>Test normal includes:</p>
+<#include "included.ftl">
+
+${foo}
+${nestedMessage}
+
+<@twice>
+Kilroy
+</...@twice>
+
+<p>Test subdir includes:</p>
+<#include "subdir/include-subdir.ftl">
+</body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2-included.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2-included.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2-included.ftl
new file mode 100644
index 0000000..db9dfc1
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2-included.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+${'A'} próba

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2.ftl
new file mode 100644
index 0000000..5f3ccc3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/include2.ftl
@@ -0,0 +1,32 @@
+<#--
+  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.
+-->
+<#include "include2" + "-included.ftl">
+<#assign s = "de">
+<#include "inclu" + s + "2-included.ftl">
+
+<#assign bTrue=true>
+<#assign bFalse=false>
+<#include "include2-included.ftl" ignore_missing=true>
+<#include "include2-included.ftl" ignore_missing=bTrue>
+<#include "include2-included.ftl" ignore_missing=false>
+<#include "include2-included.ftl" ignore_missing=bFalse>
+
+<@assertFails message="not found"><#include "missing.ftl"></@>
+[<#include "missing.ftl" ignore_missing=true>]
+[<#include "missing.ftl" ignore_missing=bTrue>]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/included.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/included.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/included.ftl
new file mode 100644
index 0000000..f711a67
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/included.ftl
@@ -0,0 +1,30 @@
+<#--
+  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.
+-->
+<p>A test of included files:</p>
+
+<#if .globals.message?exists>
+	<p>Message exists!:<br />
+        ${.globals.message}</p>
+<#else>
+        <p>No message :(</p>
+</#if>
+
+<#assign foo="assigning from included template", bar=" Can you see me? ">
+<#macro twice><#nested/>${bar}<#nested/></#macro>
+<#include "nestedinclude.ftl">

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/interpret.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/interpret.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/interpret.ftl
new file mode 100644
index 0000000..41f8425
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/interpret.ftl
@@ -0,0 +1,25 @@
+<#--
+  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.
+-->
+<#global x=["a", "b", "c"]>
+<#global templateSource = r"<#list x as y>${y}</#list>">
+<@templateSource?interpret>def</@>
+<@[templateSource]?interpret>def</@>
+<@[templateSource,"id"]?interpret>def</@>
+
+<#assign t = '<#macro m>M</#macro>'?interpret><@t /><@m/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/iterators.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/iterators.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/iterators.ftl
new file mode 100644
index 0000000..389abf3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/iterators.ftl
@@ -0,0 +1,71 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: List Iterator Test</title>
+</head>
+<body>
+<#assign list= ["one", "two", "three", "four", "five"]>
+<#assign hash = {"key", list}>
+<#assign  hash2 = {"value", hash}>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now iterate over a list:</p>
+
+<#list list as item>
+<p>${item}</p>
+</#list>
+
+<p>Now iterate again:</p>
+
+<#list list as item>
+<p>${item_index}. ${item}</p>
+</#list>
+
+<p>Iterate over a list in a hash:</p>
+
+<#list hash.key as item>
+<p>${item}</p>
+</#list>
+
+<#list hash.key as item>
+<p>${item}</p>
+</#list>
+
+<#list hash[ "key" ] as item>
+<p>${item}</p>
+</#list>
+
+<#list hash["key"] as item>
+<p>${item}</p>
+</#list>
+
+<#list hash2["value"].key as key>
+<p>${key}</p>
+</#list>
+
+<#list hash2.value.key as az>
+<p>${az}</p>
+</#list>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/lastcharacter.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/lastcharacter.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/lastcharacter.ftl
new file mode 100644
index 0000000..e762356
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/lastcharacter.ftl
@@ -0,0 +1,31 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Last Character Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+  
+    #{message?capitalize?length}
+    
+    ${message [1..] ? upper_case}
+    
+    message: ${message ?capitalize[0..10]}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list-bis.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list-bis.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list-bis.ftl
new file mode 100644
index 0000000..e52307f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list-bis.ftl
@@ -0,0 +1,48 @@
+<#--
+  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.
+-->
+<#list ['a', 'b', 'c'] as x>
+    ${x?index}: ${x} [<#list ['A', 'B', 'C'] as x>${x?index}:${x}<#sep>, </#list>]
+</#list>
+
+<#list ['a', 'b', 'c'] as i>
+    ${i?index}: ${i} <#list ['A', 'B', 'C'] as j>${i?index}${i}/${j?index}${j}<#sep>, </#list>
+</#list>
+
+<#list ['a', 'b', 'c']><#items as x>${x?index}:${x}<#sep>, </#items></#list>
+<#list ['a', 'b', 'c']><#items as x>${x?counter}. ${x};<#sep> </#items></#list>
+
+<#list ['a', 'b', 'c'] as x>${x}<#if x?hasNext>, </#if></#list>
+<#list ['a', 'b', 'c'] as x\-y>${x\-y}<#if x\-y?hasNext>, </#if></#list>
+
+<#list ['a', 'b', 'c'] as x><#if x?isFirst>${x?capFirst}<#else>${x}</#if><#sep>, </#sep><#if x?isLast>.</#if></#list>
+
+<#list ['a', 'b', 'c'] as x>${x?isOddItem?c}/${x?isEvenItem?c}<#sep> </#list>
+
+<#list ['a', 'b', 'c'] as x>
+    <td class="${x?itemParity}Row">${x}</td>
+</#list>
+
+<#list ['a', 'b', 'c'] as x>
+    <td class="row${x?itemParityCap}">${x}</td>
+</#list>
+
+<#list ['a', 'b', 'c', 'd', 'e', 'f', 'g'] as x>
+    <td class="${x?itemCycle('R', 'G', 'B')}">${x}</td>
+</#list>
+<@assertFails message="expects 1"><#list 1..1 as x>${x?itemCycle()}</#list></@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list.ftl
new file mode 100644
index 0000000..280491c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list.ftl
@@ -0,0 +1,44 @@
+<#--
+  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.
+-->
+<@testList ["aardvark", "bear", "cat", "dog"] />
+
+<@testList ["aardvark"] />
+
+<@testList [] />
+
+<@testList listables.list />
+
+<@testList listables.linkedList />
+
+<@testList listables.set />
+
+<@testList listables.iterator />
+
+<@testList listables.emptyList />
+
+<@testList listables.emptyLinkedList />
+
+<@testList listables.emptySet />
+
+<@testList listables.emptyIterator />
+
+<#macro testList seq>
+Size: <#attempt>${seq?size}<#recover>failed</#attempt>
+Items: <#list seq as i>@${i_index} ${i}<#if i_has_next>, <#else>.</#if></#list>
+</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list2.ftl
new file mode 100644
index 0000000..db64a4b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list2.ftl
@@ -0,0 +1,90 @@
+<#--
+  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.
+-->
+<@testList ["aardvark", "bear", "cat", "dog"] />
+
+<@testList ["aardvark"] />
+
+<@testList [] />
+
+<@testList listables.list />
+
+<@testList listables.set />
+
+<@testList listables.getIterator />
+
+<@testList listables.emptyList />
+
+<@testList listables.emptySet />
+
+<@testList listables.getEmptyIterator />
+
+<#macro testList xs>
+=== [${resolve(xs)?join(", ")}] ===
+<#assign resolveCallCnt = 0>
+
+-- List+sep:
+<#list resolve(xs) as x>
+    ${x}<#sep>,</#sep>
+</#list>
+-- List+else:
+<#list resolve(xs) as x>
+    ${x}
+<#else>
+    Empty!
+</#list>
+-- List+items:
+<#list resolve(xs)>
+    [
+    <#items as x>
+        ${x!'U'}
+    </#items>
+    ]
+</#list>
+-- List+items+else:
+<#list resolve(xs)>
+    [
+    <#items as x>
+        ${x!'U'}
+    </#items>
+    ]
+<#else>
+    Empty!
+</#list>
+-- List+items+sep+else:
+<#list resolve(xs)>
+    [
+    <#items as x>
+        ${x!'U'}<#sep>,</#sep>
+    </#items>
+    ]
+<#else>
+    Empty!
+</#list>
+<@assertEquals expected=5 actual=resolveCallCnt />
+--
+</#macro>
+
+<#function resolve xs>
+    <#assign resolveCallCnt = (resolveCallCnt!0) + 1>
+    <#if xs?isMethod>
+        <#return xs()>
+    <#else>
+        <#return xs>
+    </#if>
+</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list3.ftl
new file mode 100644
index 0000000..d2fcf71
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/list3.ftl
@@ -0,0 +1,70 @@
+<#--
+  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.
+-->
+[
+<#list listables.list as i>
+    [<#list listables.list as j>(${i}@${i_index}, ${j}@${j_index})<#sep>, </#sep></#list>]<#sep>,</#sep>
+</#list>
+]
+
+<#macro hits xs style="">
+    <#list xs>
+        <p>${xs?size} hits:
+        <div class="hits">
+            <#switch style>
+                <#case "hidden">
+                    ...
+                    <#break>
+                <#case "other">
+                    <#items as x>
+                        <div class="hitOther">${x}</div>
+                    </#items>
+                    <#break>
+                <#case "none">
+                <#default>
+                    <#items as x>
+                        <div class="hit">${x}</div>
+                    </#items>
+                    <#break>
+            </#switch>
+        </div>
+    <#else>
+        <p>Nothing.
+    </#list>
+</#macro>
+
+<@hits ['a', 'b'] />
+
+<@hits ['a', 'b'], "other" />
+
+<@hits ['a', 'b'], "hidden" />
+
+<@hits [] />
+
+<#list listables.list as i><#if i_index gt 1>...<#break></#if>${i}<#sep>, </#sep></#list>
+<#list listables.list>[<#items as i><#if i_index gt 1>...<#break></#if>${i}<#sep>, </#sep></#items>]</#list>
+
+<@testAutoClosedSep 1..3 />
+<@testAutoClosedSep [1] />
+<@testAutoClosedSep [] />
+
+<#macro testAutoClosedSep xs>
+<#list xs as x>${x}<#sep>, <#else>Empty</#list>
+<#list xs as x>${x}<#sep><#if x_index == 0> /*first*/, <#else>, </#if><#else>Empty</#list>
+<#list xs>[<#items as x>${x}<#sep>, </#items>]<#else>Empty</#list>
+</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhash.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhash.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhash.ftl
new file mode 100644
index 0000000..6f22b43
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhash.ftl
@@ -0,0 +1,70 @@
+<#--
+  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.
+-->
+<#setting booleanFormat='Y,N'>
+
+<#macro listings maps>
+  <#list maps as m>
+    Map:
+    
+    [
+    <#list m as k, v>
+      ${k!'null'} = ${v!'null'}
+    </#list>
+    ]
+  
+    [
+    <#list m as k, v>
+      ${k!'null'} = ${v!'null'}<#sep>;</#sep> // @${k?index}=@${v?index}; ${k?itemParity}=${v?itemParity}; ${k?hasNext}=${v?hasNext}
+    <#else>
+      Empty
+    </#list>
+    ]
+  
+    {
+    <#list m>
+      [
+      <#items as k, v>
+        ${k!'null'} = ${v!'null'}<#sep>;</#sep> // @${k?index}=@${v?index}; ${k?itemParity}=${v?itemParity}; ${k?hasNext}=${v?hasNext}
+      </#items>
+      ]
+    <#else>
+      Empty
+    </#list>
+    }
+
+  </#list>
+</#macro>
+
+Non-empty maps:
+
+<@listings listables.hashEx2s />
+<@listings [ listables.hashNonEx2 ] />
+
+Empty maps:
+
+<@listings listables.emptyHashes />
+
+<#list { 'a': { 'aa': 11 }, 'b': { 'ba': 21, 'bb': 22 }, 'c': {} } as k1, v1>
+  ${k1} @ ${k1?index}, ${v1?size}
+  <#list v1 as k2, v2>
+    ${k2} = ${v2}  @ ${k2?index} // inside ${k1} @ ${k1?index}, ${v1?size}
+  </#list>
+  ${k1} @ ${k1?index}, ${v1?size}
+  --
+</#list>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhashliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhashliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhashliteral.ftl
new file mode 100644
index 0000000..06694c9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listhashliteral.ftl
@@ -0,0 +1,35 @@
+<#--
+  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.
+-->
+<#list [ { "a": 1, "b": 2, "a": 3 }, { } ] as h>
+  KVPs:
+  <#list h as k, v>
+    ${k} = ${v}
+  </#list>
+  
+  Keys:
+  <#list h?keys as k>
+    ${k}
+  </#list>
+  
+  Values:
+  <#list h?values as v>
+    ${v}
+  </#list>
+
+</#list>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listliteral.ftl
new file mode 100644
index 0000000..d48578c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/listliteral.ftl
@@ -0,0 +1,84 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: List Literal Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now perform a list assignment:</p>
+
+<#assign hash = {"temp", "Temporary"}>
+<#assign mymessage = "hello">
+<#assign test = [ "test1", "test23", "test45", message, mymessage]>
+
+The list contains #{test?size} items.
+
+<#list test as item>
+<p>${item}</p>
+</#list>
+
+<p>Now update the assignment and repeat:</p>
+
+<#assign mymessage = "world">
+
+<#list test as item>
+<p>${item}</p>
+</#list>
+
+<p>Now reassign the list and repeat:</p>
+
+<#assign test = [ hash.temp, "test1", "test23", "test45", mymessage, "hash", hash["temp"]]>
+<#assign test = [ "foo", "bar" ] + test>
+
+<#list test[1..4] as item>
+<p>${item}</p>
+</#list>
+
+<p>Silly, but necessary tests, for one and zero element lists:</p>
+
+<#assign test = [ "Hello, world" ]>
+
+<#list test as item>
+<p>${item}</p>
+</#list>
+
+<p>Zero item test:</p>
+
+<#assign test = []>
+
+<#list test as item>
+<p>${item}</p>
+</#list>
+
+<p>Dumb test for number literals -- these weren't working as expected:</p>
+
+<#assign test = [] + [1, 2,3, 5, 7]>
+
+<#list test as item>
+<p>${item}</p>
+<#if item == 5><#break></#if>
+</#list>
+
+</body>
+</html>



[11/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization.ftl
new file mode 100644
index 0000000..cf46fbf
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization.ftl
@@ -0,0 +1,32 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Localization Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Hello, in the default language.</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en.ftl
new file mode 100644
index 0000000..f8292bc
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en.ftl
@@ -0,0 +1,32 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Localization Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Hello, in the English language.</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en_AU.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en_AU.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en_AU.ftl
new file mode 100644
index 0000000..938f681
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/localization_en_AU.ftl
@@ -0,0 +1,32 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Localization Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>G'day, mate!</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/logging.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/logging.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/logging.ftl
new file mode 100644
index 0000000..c44d6b8
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/logging.ftl
@@ -0,0 +1,42 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Logging Test</title>
+</head>
+<body>
+
+A simple test follows:
+
+${message.test[ "me" ]}
+
+<if message>
+	<p>Message exists!
+	<transform message.sdf>
+		...and even generates output!
+	</transform>
+	</p>
+</if>
+
+<compress>
+Try this for size.
+</compress>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/loopvariable.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/loopvariable.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/loopvariable.ftl
new file mode 100644
index 0000000..bc77b82
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/loopvariable.ftl
@@ -0,0 +1,49 @@
+<#--
+  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.
+-->
+<#setting locale="en_US">
+---
+<#macro myLoop from to>
+  <#list from..to as x>
+  - <#nested x></#list>*
+</#macro>
+<#list 2..1 as i>
+  ${i}
+  <@myLoop from=1 to=3; i>
+    L1 ${i}
+    <@myLoop from=1 to=2; i>
+      L2 ${i}: <#list 1..3 as i>${i}; </#list>
+    </@>
+  </@>
+</#list>
+---
+<#macro repeat count>
+  <#list 1..count as x>
+    <#nested x, x/2, x==count>
+  </#list>
+</#macro>
+<#macro test2>
+<#local c = 123>
+<@repeat count=4 ; c, halfc, last>
+  <#local c = .locals.c + 0.1>
+  ${c} ${halfc}<#if last> Last!</#if>
+</...@repeat>
+${c}
+</#macro>
+<@test2/>
+---
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros-return.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros-return.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros-return.ftl
new file mode 100644
index 0000000..220fa2a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros-return.ftl
@@ -0,0 +1,34 @@
+<#--
+  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.
+-->
+<#macro m>m{<#return>}</#macro>
+<@m/>
+
+<#macro m><#if true>m{<#return>}</#if></#macro>
+<@m/>
+
+<#macro m><#if true>m{<#return></#if>}</#macro>
+<@m/>
+
+<#macro b>b{<#nested>}</#macro>
+<#macro m><@b><#return></@></#macro>
+<@m/>
+
+<#macro b>b{<#nested>}</#macro>
+<#macro m>m:<@b><#return></@></#macro>
+<@m/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros.ftl
new file mode 100644
index 0000000..9d8f456
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros.ftl
@@ -0,0 +1,101 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Function Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now perform function tests:</p>
+
+<#assign urls = {"home" : "/home.html", "about" : "/about.html"}>
+<#assign images = {"home" : "/images/home.png", "about" : "/image/about-us.jpeg"}>
+<#assign preferences = {"showImages" : true}>
+<#assign "español" = français><#macro français(url, image, alt)>
+    <#local var = "Kilroy">
+    <a href="${url}">
+    <#if preferences.showImages>
+        <img src="${image}" border="0" alt="${alt}">
+    <#else>
+        ${alt}
+    </#if>
+    </a>
+    ${var} was here.
+</#macro>
+
+<p>Function is defined, now let's call it:</p>
+
+   <@español urls.home images.home "Home" /><#t>
+
+<p>Again, but with different parameters:</p>
+
+<@français 
+   url=urls.about 
+   image=images.about 
+   alt="About Us"
+/>
+
+<#if var?exists>
+   Something is wrong here.
+<#else>
+   Good.
+</#if>
+
+<p>A recursive function call:</p>
+
+<#macro recurse(dummy, a=3)>
+    <#if (a > 0)>
+        <@recurse dummy  a - 1 />
+    </#if>
+    ${a}
+</#macro>
+
+<@recurse urls />
+
+<p>Test "catch-all" macro parameter:</p>
+
+<#macro "catch-all" foo bar...>
+foo=${foo} baz=[<#list bar?keys?sort as key>${key}=${bar[key]}<#if key_has_next>, </#if></#list>]
+</#macro>
+<#assign catchall = .namespace["catch-all"]>
+
+<@catchall foo="a"/>
+<@catchall foo="a" bar="b"/>
+<@catchall foo="a" bar="b" baz="c"/>
+
+<#macro fmt pattern args...>
+  <#list args as arg>
+    <#local pattern = pattern?replace("{" + arg_index + "}", arg)>
+  </#list>
+  ${pattern}<#lt>
+</#macro>
+
+<#macro m a=1 b=2>
+</#macro>
+<@assertFails message='"c"'><@m c=3 /></@>
+<@assertFails message='3'><@m 9 8 7 /></@>
+
+<@fmt "Hello {0}! Today is {1}.", "World", "Monday" />
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros2.ftl
new file mode 100644
index 0000000..55ceefd
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/macros2.ftl
@@ -0,0 +1,35 @@
+<#--
+  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.
+-->
+<#macro m1 a b=a>
+${a} ${b}
+</#macro>
+<@m1 a="1"/>
+<#macro m2 a=b b="">
+${a} ${b}
+</#macro>
+<@m2 b="2"/>
+<#macro m3 d b=c[a] a=d c={"3":"4"}>
+${b}
+</#macro>
+<@m3 d="3"/>
+<#attempt>
+<@m3 d="4"/>
+<#recover>
+m3 with d="4" Failed!
+</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/multimodels.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/multimodels.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/multimodels.ftl
new file mode 100644
index 0000000..f356386
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/multimodels.ftl
@@ -0,0 +1,84 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Test of Multiple Model implementations</title>
+</head>
+<body>
+
+<p>Let's begin with a simple model:</p>
+<p>${message}</p>
+
+<p>Cool, now get into the first model. This implements a scalar, list, and
+hash as a single class. Let's try some tests...</p>
+
+<p>${data}</p>
+
+<p>Now as a list...</p>
+
+<#list data as item>${item}<br />
+</#list>
+
+<p>Index into a list...</p>
+<p>${data[ 1 ]}</p>
+<p>List size is: ${data.size}</p>
+<p>List size is: ${data["size"]}</p>
+
+<p>Now, again, as a hash. First using dot notation, then using [] notation:</p>
+
+<p>${data.selftest}</p>
+<p>${data["selftest"]}</p>
+
+<p>Now for the tricky stuff... use a model to index into another model...</p>
+<p>${test}</p>
+<p>${data[ test ]}</p>
+<p>${self}</p>
+<p>${data[ self + "test" ]}</p>
+
+<p>Same thing, this time a List index...</p>
+<p>${zero}</p>
+<p>${data[ zero ]}</p>
+<p>${data[ zero + 1 ]}</p>
+
+<p>Now, do the same recursively...</p>
+<p>${data}</p>
+<p>${data.model2}</p>
+<p>${data.model2( "test" )}</p>
+<p>${data.model2( data, data.selftest, message )}</p>
+
+<p>Does this really not work?</p>
+<p>${data[ 10 ]}</p>
+<p>${data[ 10 ].selftest}</p>
+<p>${data[ 10 ].message}</p>
+
+<p>(Again, with Hashes)</p>
+<p>${data.nesting1.nested}</p>
+<p>${data.nesting1.nested.selftest}</p>
+
+<p>${data["nesting1"].nested}</p>
+<p>${data["nesting1"].nested["selftest"]}</p>
+<p>${data["nesting1"]["nested"]["selftest"]}</p>
+
+<p>As I suspected! (Manual on Expressions needs updating.)</p>
+
+<p>Second test on list size</p>
+<p>${data.one.size}</p>
+<p>${data.one["size"]}</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nested.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nested.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nested.ftl
new file mode 100644
index 0000000..46f4492
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nested.ftl
@@ -0,0 +1,29 @@
+<#--
+  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.
+-->
+<#macro repeat count>
+  <#local y = "test">
+  <#list 1..count as x>
+    ${y} ${count}/${x}: <#nested x, "asdf"> <#-- the second body parameter is not used below -->
+  </#list>
+</#macro>
+<@repeat count=3>${y?default("undefined")} ${x?default("undefined")} ${count?default("undefined")}</...@repeat>
+<#global x = "X">
+<#global y = "Y">
+<#global count = "Count">
+<@repeat count=3 ; param1>${y?default("undefined")} ${x?default("undefined")} ${count?default("undefined")} ${param1}</...@repeat>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nestedinclude.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nestedinclude.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nestedinclude.ftl
new file mode 100644
index 0000000..c6e7b11
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/nestedinclude.ftl
@@ -0,0 +1,21 @@
+<#--
+  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.
+-->
+<#assign nestedMessage = "I'm here, mon!">
+${.main.bar}
+<#-- ${.root.message} -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-defaultresolver.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-defaultresolver.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-defaultresolver.ftl
new file mode 100644
index 0000000..04b6665
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-defaultresolver.ftl
@@ -0,0 +1,23 @@
+<#--
+  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.
+-->
+<#attempt>
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("works")}
+<#recover>
+fails
+</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-optin.ftl
new file mode 100644
index 0000000..a2cd276
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/new-optin.ftl
@@ -0,0 +1,30 @@
+<#--
+  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.
+-->
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("works")}
+<#attempt>
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel2"?new("works")}
+<#recover>
+fails
+</#attempt>
+
+<#include "subdir/new-optin.ftl">
+
+<#include "subdir/new-optin-2.ftl">
+
+<#include "subdir/subsub/new-optin.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines1.ftl
new file mode 100644
index 0000000..18f4b32
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines1.ftl
@@ -0,0 +1,29 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Newlines Test</title>
+</head>
+<body>
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines2.ftl
new file mode 100644
index 0000000..ac8337c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/newlines2.ftl
@@ -0,0 +1,33 @@
+<#--
+  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.
+-->
+<#assign message="Hello, world!\n">
+<#assign normalizeNewlines = "org.apache.freemarker.core.util.NormalizeNewlines"?new()>
+<@normalizeNewlines>
+<html>
+<head>
+<title>FreeMarker: Newlines the Second Test</title>
+</head>
+<body>
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+</body>
+</html>
+</...@normalizeNewlines>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/noparse.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/noparse.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/noparse.ftl
new file mode 100644
index 0000000..f7f1be3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/noparse.ftl
@@ -0,0 +1,62 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: NoParse Test</title>
+</head>
+<body>
+<#noparse>
+
+A simple test follows:
+
+${message}
+
+A more rigorous test, showing that we're not faking it:
+
+${message@#$%&}
+
+</#noparse>
+<#if message?exists>
+	<p>Message exists!
+	<#noparse>
+		...and even generates output!
+		<#if message>
+			Nested statements are ok, too.
+		</#if>
+	</#noparse>
+	</p>
+</#if>
+
+Here's another edge case, this time, trying to output a &lt;noparse&gt;
+inside another &lt;noparse&gt;
+
+<#noparse>
+
+This is what the noparse instruction looks like:
+
+<#nop</#noparse><#noparse>arse>This part of the template wont be parsed by the 
+FreeMarker parser. Instead, it will be treated as verbatim text information,
+and output as such.</#nop</#noparse><#noparse>arse>
+
+The rest of the template appears here.
+</#noparse>
+
+Simple.
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-format.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-format.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-format.ftl
new file mode 100644
index 0000000..d060a44
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-format.ftl
@@ -0,0 +1,42 @@
+<#--
+  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.
+-->
+<#setting number_format = ",##0.##">
+<#setting locale = "fr_FR">
+${1}
+${1?c}
+${1234567.886}
+${1234567.886?c}
+<#setting number_format = "0.00">
+${1}
+${1?c}
+${1234567.886}
+${1234567.886?c}
+${int?c}
+${double?c}
+${double2?c}
+${double3?c}
+${double4?c}
+${bigDecimal?c}
+${bigDecimal2?c}
+<@assertEquals expected="INF" actual="INF"?number?c />
+<@assertEquals expected="INF" actual="INF"?number?c />
+<@assertEquals expected="-INF" actual="-INF"?number?c />
+<@assertEquals expected="-INF" actual="-INF"?number?float?c />
+<@assertEquals expected="NaN" actual="NaN"?number?float?c />
+<@assertEquals expected="NaN" actual="NaN"?number?float?c />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-literal.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-literal.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-literal.ftl
new file mode 100644
index 0000000..c881d0f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-literal.ftl
@@ -0,0 +1,133 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Number Literal Test</title>
+</head>
+<body>
+<#assign hash = {"1" : "one", 
+                 "12" : "twelve", 
+                "2one" : "two-one", 
+                "one2" : "one-two"}
+         list = ["zero", 
+                 "one", 
+                 "two", 
+                 "three", 
+                 "four", 
+                 "five", 
+                 "six", 
+                 "seven", 
+                 "eight", 
+                 "nine", 
+                 "ten",
+                 "eleven",
+                 "twelve"],
+          foo = "bar",
+          one = "one",
+          "1" = "one",
+          "12" = "twelve",
+          "2one" = "two-one",
+          "one2" = "one-two",
+          call = "org.apache.freemarker.core.templatesuite.models.SimpleTestMethod"?new()
+>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now perform a number assignment:</p>
+
+#{1.300000?double}
+
+<#assign mynumber = 1.8, USA="en_US" />
+<#assign myfloat = mynumber?float />
+
+My number is: ${mynumber}
+<#setting locale="en_US">
+My float is: #{myfloat ; m6}
+The int part is: ${myfloat?int}
+
+<#assign mymessage = mynumber?string>
+
+${mymessage + 3}
+
+<p>Now use numbers in assignment</p>
+
+<#assign mymessage = 1 + 5>
+${mymessage}
+
+<#assign mymessage = mymessage + 2>
+#{mymessage}
+
+<p>Try numbers in tests</p>
+
+<#if (mymessage == 152)>
+MyMessage is 152
+<#else>
+MyMessage is not 152, its: ${mymessage}.
+</#if >
+
+<if (mymessage > 5)>
+   MyMessage is greater than five.
+</if
+
+<#switch mymessage>
+	<#case 1>
+		MyMessage is one
+		<#break>
+
+	<#case 15>
+		MyMessage is fifteen
+		<#break>
+	
+	<#case 152>
+		MyMessage is one-five-two
+		<#break>
+	
+	<#default>
+		MyMessage is: ${mymessage}.
+		<#break>
+	
+</#switch>
+
+<p>Now for numbers in dynamic keys:</p>
+
+<#assign one = 1>
+<#assign two = 2>
+
+${list[ 1 ]}
+${list[ 1 + 2 ]}
+
+<p>Numbers in hashes:</p>
+
+${hash[ 1 + "2" ]}
+${hash[ "1" + 2 ]}
+${hash[ "1" + two ]}
+
+
+<p>Numbers in method calls:</p>
+
+${call( 1 )}
+${call( one )}
+${call( one + "2" )}
+${call( one + 2 )}
+${call( 1 + 2 )}
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-math-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-math-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-math-builtins.ftl
new file mode 100644
index 0000000..6dab082
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-math-builtins.ftl
@@ -0,0 +1,78 @@
+<#--
+  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.
+-->
+<@assertEquals actual=0?abs expected=0 />
+<@assertEquals actual=3?abs expected=3 />
+<@assertEquals actual=(-3)?abs expected=3 />
+<@assertEquals actual=3.5?abs expected=3.5 />
+<@assertEquals actual=(-3.5)?abs expected=3.5 />
+
+<@assert test=fNan?abs?is_nan />
+<@assert test=dNan?abs?is_nan />
+<@assert test=fNinf?abs?is_infinite />
+<@assert test=dPinf?abs?is_infinite />
+<@assert test=fNinf lt 0 />
+<@assert test=dPinf gt 0 />
+<@assert test=fNinf?abs gt 0 />
+<@assert test=dPinf?abs gt 0 />
+
+<@assertEquals actual=fn?abs expected=0.05 />
+<@assertEquals actual=dn?abs expected=0.05 />
+<@assertEquals actual=ineg?abs expected=5 />
+<@assertEquals actual=ln?abs expected=5 />
+<@assertEquals actual=sn?abs expected=5 />
+<@assertEquals actual=bn?abs expected=5 />
+<@assertEquals actual=bin?abs expected=5 />
+<@assertEquals actual=bdn?abs expected=0.05 />
+
+<@assertEquals actual=fp?abs expected=0.05 />
+<@assertEquals actual=dp?abs expected=0.05 />
+<@assertEquals actual=ip?abs expected=5 />
+<@assertEquals actual=lp?abs expected=5 />
+<@assertEquals actual=sp?abs expected=5 />
+<@assertEquals actual=bp?abs expected=5 />
+<@assertEquals actual=bip?abs expected=5 />
+<@assertEquals actual=bdp?abs expected=0.05 />
+
+<@assert test=!0?is_infinite />
+<@assert test=!fn?is_infinite />
+<@assert test=!dn?is_infinite />
+<@assert test=!ineg?is_infinite />
+<@assert test=!ln?is_infinite />
+<@assert test=!sn?is_infinite />
+<@assert test=!bn?is_infinite />
+<@assert test=!bin?is_infinite />
+<@assert test=!bdn?is_infinite />
+<@assert test=!fNan?is_infinite />
+<@assert test=!dNan?is_infinite />
+<@assert test=fNinf?is_infinite />
+<@assert test=dPinf?is_infinite />
+
+<@assert test=!0?is_nan />
+<@assert test=!fn?is_nan />
+<@assert test=!dn?is_nan />
+<@assert test=!ineg?is_nan />
+<@assert test=!ln?is_nan />
+<@assert test=!sn?is_nan />
+<@assert test=!bn?is_nan />
+<@assert test=!bin?is_nan />
+<@assert test=!bdn?is_nan />
+<@assert test=fNan?is_nan />
+<@assert test=dNan?is_nan />
+<@assert test=!fNinf?is_nan />
+<@assert test=!dPinf?is_nan />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-to-date.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-to-date.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-to-date.ftl
new file mode 100644
index 0000000..403e033
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/number-to-date.ftl
@@ -0,0 +1,35 @@
+<#--
+  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.
+-->
+${1305575275540?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
+${1305575275540?number_to_date?iso_utc} == 2011-05-16
+${1305575275540?number_to_time?iso_utc_ms} == 19:47:55.54Z
+
+${1305575275540?long?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
+${1305575275540?double?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
+${bigInteger?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
+${bigDecimal?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
+${1000?float?number_to_datetime?iso_utc} == 1970-01-01T00:00:01Z
+${1000?int?number_to_datetime?iso_utc} == 1970-01-01T00:00:01Z
+${0?byte?number_to_datetime?iso_utc} == 1970-01-01T00:00:00Z
+
+<#attempt>
+${9999991305575275540?number_to_datetime?iso_utc} <#-- doesn't fit into long -->
+<#recover>
+failed
+</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/numerical-cast.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/numerical-cast.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/numerical-cast.ftl
new file mode 100644
index 0000000..221b61b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/numerical-cast.ftl
@@ -0,0 +1,82 @@
+<#ftl>
+<#--
+  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.
+-->
+<#setting locale="en_US">
+<#setting number_format="0.#########">
+
+<#assign testlist= [ 0, 1, -1, 0.5, 1.5, -0.5,
+	 -1.5, 0.25, -0.25, 1.75, -1.75,
+	 1.01, -1.01, 0.01, -0.01,
+	 127, 128, -127, -128,
+	 32767, 32768, -32767, -32768,
+	 2147483647, 2147483648, -2147483647, -2147483648,
+	 4294967295, 4294967296, -4294967295, -4294967296,
+	 2147483647.1, 2147483648.1, -2147483647.1, -2147483648.1,
+	 4294967295.1, 4294967296.1, -4294967295.1, -4294967296.1
+	 2147483647.5, 2147483648.5, -2147483647.5, -2147483648.5,
+	 4294967295.5, 4294967296.5, -4294967295.5, -4294967296.5
+  ] />
+
+?int:
+<#list testlist as result>
+    ${result}?int=${result?int}
+</#list>
+
+?double
+<#list testlist as result>
+    ${result}?double=${result?double}
+</#list>
+
+?long
+<#list testlist as result>
+    ${result}?long=${result?long}
+</#list>
+
+?long from date
+    ${"2011-05-08 18:00:15 GMT"?date("yyyy-MM-dd HH:mm:ss z")?long} = 1304877615000
+
+?float
+<#list testlist as result>
+    ${result}?float=${result?float}
+</#list>
+
+?byte
+<#list testlist as result>
+    ${result}?byte=${result?byte}
+</#list>
+
+?short
+<#list testlist as result>
+    ${result}?short=${result?short}
+</#list>
+
+?floor
+<#list testlist as result>
+    ${result}?floor=${result?floor}
+</#list>
+
+?ceiling
+<#list testlist as result>
+    ${result}?ceiling=${result?ceiling}
+</#list>
+
+?round
+<#list testlist as result>
+    ${result}?round=${result?round}
+</#list>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding1.ftl
new file mode 100644
index 0000000..da1128f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding1.ftl
@@ -0,0 +1,30 @@
+<#--
+  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.
+-->
+Output charset: ${.output_encoding?default("undefined")}
+URL escaping charset: ${.url_escaping_charset?default("undefined")}
+
+<#assign s="a/%b">
+<#setting url_escaping_charset="UTF-16">
+${s?url}
+${s?url}
+<#setting url_escaping_charset="ISO-8859-1">
+${s?url}
+${s?url}
+${s?url('UTF-16')}
+${s?url}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding2.ftl
new file mode 100644
index 0000000..3a4f24d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding2.ftl
@@ -0,0 +1,28 @@
+<#--
+  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.
+-->
+Output charset: ${.output_encoding?default("undefined")}
+URL escaping charset: ${.url_escaping_charset?default("undefined")}
+
+<#assign s="a/%b">
+UTF-16: ${s?url}
+ISO-8859-1: ${s?url('ISO-8859-1')}
+UTF-16: ${s?url}
+<#setting url_escaping_charset="ISO-8859-1">
+ISO-8859-1: ${s?url}
+ISO-8859-1: ${s?url}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding3.ftl
new file mode 100644
index 0000000..3a4f24d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/output-encoding3.ftl
@@ -0,0 +1,28 @@
+<#--
+  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.
+-->
+Output charset: ${.output_encoding?default("undefined")}
+URL escaping charset: ${.url_escaping_charset?default("undefined")}
+
+<#assign s="a/%b">
+UTF-16: ${s?url}
+ISO-8859-1: ${s?url('ISO-8859-1')}
+UTF-16: ${s?url}
+<#setting url_escaping_charset="ISO-8859-1">
+ISO-8859-1: ${s?url}
+ISO-8859-1: ${s?url}
\ No newline at end of file


[15/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java
deleted file mode 100644
index 96eb1a5..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java
+++ /dev/null
@@ -1,64 +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.test.templatesuite.models;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.freemarker.core.model.TemplateMethodModel;
-
-/**
- * Another test of the interaction between MethodModels and TransformModels.
- */
-public class TransformMethodWrapper2 implements TemplateMethodModel {
-
-    /**
-     * Executes a method call.
-     *
-     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
-     * the values of the arguments passed to the method.
-     * @return the <tt>TemplateModel</tt> produced by the method, or null.
-     */
-    @Override
-    public Object exec(List arguments) {
-        TransformModel1 cTransformer = new TransformModel1();
-        Iterator    iArgument = arguments.iterator();
-
-        // Sets up properties of the Transform model based on the arguments
-        // passed into this method
-
-        while ( iArgument.hasNext() ) {
-            String  aArgument = (String) iArgument.next();
-
-            if ( aArgument.equals( "quote" )) {
-                cTransformer.setQuotes( true );
-            } else if ( aArgument.equals( "tag" )) {
-                cTransformer.setTags( true );
-            } else if ( aArgument.equals( "ampersand" )) {
-                cTransformer.setAmpersands( true );
-            } else {
-                cTransformer.setComment( aArgument );
-            }
-        }
-
-        // Now return the transform class.
-        return cTransformer;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java
deleted file mode 100644
index 0875679..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java
+++ /dev/null
@@ -1,175 +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.test.templatesuite.models;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Map;
-
-import org.apache.freemarker.core.model.TemplateTransformModel;
-
-/**
- * A TemplateTransformModel that includes properties. These properties can be
- * set at model construction time, or, for the purposes of this demonstration,
- * can be passed in from a wrapper TemplateMethodModel.
- */
-public class TransformModel1 implements TemplateTransformModel {
-
-    private boolean m_bAmpersands = false;
-    private boolean m_bQuotes = false;
-    private boolean m_bTags = false;
-    private String  m_aComment = "";
-
-    private static final int READER_BUFFER_SIZE = 4096;
-
-    @Override
-    public Writer getWriter(final Writer out,
-                            final Map args) {
-        final StringBuilder buf = new StringBuilder();
-        return new Writer(out) {
-            @Override
-            public void write(char cbuf[], int off, int len) {
-                buf.append(cbuf, off, len);
-            }
-
-            @Override
-            public void flush() {
-            }
-
-            @Override
-            public void close() throws IOException {
-                StringReader sr = new StringReader(buf.toString());
-                StringWriter sw = new StringWriter();
-                transform(sr, sw);
-                out.write(sw.toString());
-            }
-        };
-    }
-
-
-    /**
-     * Indicates whether we escape ampersands. This property can be set either
-     * while the model is being constructed, or via a property passed in through
-     * a <code>TemplateMethodModel</code>.
-     */
-    public void setAmpersands( boolean bAmpersands ) {
-        m_bAmpersands = bAmpersands;
-    }
-
-    /**
-     * Indicates whether we escape quotes. This property can be set either
-     * while the model is being constructed, or via a property passed in through
-     * a <code>TemplateMethodModel</code>.
-     */
-    public void setQuotes( boolean bQuotes ) {
-        m_bQuotes = bQuotes;
-    }
-
-    /**
-     * Indicates whether we escape tags. This property can be set either
-     * while the model is being constructed, or via a property passed in through
-     * a <code>TemplateMethodModel</code>.
-     */
-    public void setTags( boolean bTags ) {
-        m_bTags = bTags;
-    }
-
-    /**
-     * Sets a comment for this transformation. This property can be set either
-     * while the model is being constructed, or via a property passed in through
-     * a <code>TemplateMethodModel</code>.
-     */
-    public void setComment( String aComment ) {
-        m_aComment = aComment;
-    }
-
-    /**
-     * Performs a transformation/filter on FreeMarker output.
-     *
-     * @param source the input to be transformed
-     * @param output the destination of the transformation
-     */
-    public void transform(Reader source, Writer output)
-    throws IOException {
-        // Output the source, converting unsafe certain characters to their
-        // equivalent entities.
-        int n = 0;
-        boolean bCommentSent = false;
-        char[]  aBuffer = new char[ READER_BUFFER_SIZE ];
-        int i = source.read( aBuffer );
-        while (i >= 0) {
-            for ( int j = 0; j < i; j++ ) {
-                char c = aBuffer[j];
-                switch (c) {
-                    case '&':
-                        if ( m_bAmpersands ) {
-                            output.write("&amp;");
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    case '<':
-                        if ( m_bTags ) {
-                            output.write("&lt;");
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    case '>':
-                        if ( m_bTags ) {
-                            output.write("&gt;");
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    case '"':
-                        if ( m_bQuotes ) {
-                            output.write("&quot;");
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    case '\'':
-                        if ( m_bQuotes ) {
-                            output.write("&apos;");
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    case '*':
-                        if ( ! bCommentSent ) {
-                            output.write( m_aComment );
-                            bCommentSent = true;
-                        } else {
-                            output.write( c );
-                        }
-                        break;
-                    default:
-                        output.write(c);
-                }
-                n++;
-            }
-            i = source.read( aBuffer );
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java
deleted file mode 100644
index 940cb17..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java
+++ /dev/null
@@ -1,63 +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.test.templatesuite.models;
-
-import java.util.Date;
-
-public class VarArgTestModel {
-
-    public int bar(Integer... xs) {
-        int sum = 0;
-        for (Integer x : xs) {
-            if (x != null) {
-                sum *= 100;
-                sum += x;
-            }
-        }
-        return sum;
-    }
-
-    public int bar2(int first, int... xs) {
-        int sum = 0;
-        for (int x : xs) {
-            sum *= 100;
-            sum += x;
-        }
-        return -(sum * 100 + first);
-    }
-    
-    public int overloaded(int x, int y) {
-        return x * 100 + y;
-    }
-
-    public int overloaded(int... xs) {
-        int sum = 0;
-        for (int x : xs) {
-            sum *= 100;
-            sum += x;
-        }
-        return -sum;
-    }
-    
-    public String noVarArgs(String s, boolean b, int i, Date d) {
-        return s + ", " + b + ", " + i + ", " + d.getTime();
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html
deleted file mode 100644
index cabffb0..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html
+++ /dev/null
@@ -1,42 +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.
--->
-<html>
-<head>
-</head>
-<body>
-
-<p>JUnit test-suite that processes FreeMarker templates and compare their
-output to reference files.</p>
-
-<p>To add a test-case, go to
-<tt>src/test/resources/freemarker/test/templatesuite/</tt> and inside that
-directory:</p>
-<ol>
-  <li>Add a template to under <tt>templates/</tt> with whatever meaningful
-      file name</li>
-  <li>Add the expected output to <tt>references/</tt> with exactly the same
-      file name</li>
-  <li>Add a new <tt>testcase</tt> elemen to <tt>testcases.xml</tt></li>
-  <li>If you want to add items to the data-model or do something else special,
-      modify the <tt>setUp()</tt> method in
-      <tt>src/test/java/freemarker/test/templatesuite/TemplateTestCase.java</tt>
-      </li>
-</ol>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt
new file mode 100644
index 0000000..33a7186
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Arithmetic Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Perform a number assignment:</p>
+
+
+3.234
+2.00
+0.6172500000000000000000000000000000000000
+1.620089104901
+1.6201
+
+<P>Display a number with at least 3 digits after the decimal point</P>
+
+1234.000
+
+<p>Now use numbers in assignment</p>
+
+
+1257.77
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt
new file mode 100644
index 0000000..0bab0bc
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+Y Y Y
+N N N
+y y y
+n n n
+y y y
+n n n
+str:n str:n
+nein ja
+theStringValue theStringValue
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt
new file mode 100644
index 0000000..8dc1290
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Boolean Values Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+
+<p>Now perform scalar boolean tests:</p>
+
+<p>
+    b is true.<br />
+</p>
+
+<p>    This makes sense.<br />
+</p>
+
+<p>
+    boolean3 succeeded.<br />
+</p>
+
+<p>
+    boolean4 succeeded.<br />
+</p>
+
+<p>
+    boolean4 || boolean5 succeeded.<br />
+</p>
+
+<p>
+    boolean5 || boolean4 || boolean5 succeeded.<br />
+</p>
+
+<p>    boolean4 && boolean5 failed.<br />
+</p>
+ 
+<p>Now test list models:</p>
+
+<p>
+    list1 succeeded.<br />
+</p>
+
+<p>
+    list2 succeeded.<br />
+</p>
+
+<p>Test hash models:</p>
+
+<p>
+    hash1 succeeded: Hello, world.<br />
+</p>
+
+<p>
+    hash2 succeeded.<br />
+</p>
+
+<p>Test not operator:</p>
+
+<p>
+   Not boolean1 succeeded
+</p>
+
+<p>
+   Not boolean1 succeeded
+</p>
+
+<p>   Not boolean2 failed
+</p>
+
+<p>   Not boolean2 failed
+</p>
+
+<p>
+   Message is "Hello, world!"
+</p>
+
+<p>   Message is "Hello, world!"
+</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt
new file mode 100644
index 0000000..4532027
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+<head>
+  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+éáőű
+õÕûÛ
+őŐűŰ
+</body>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt
new file mode 100644
index 0000000..d5902e3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Comment Test</title>
+</head>
+<body>
+	<p>Message exists!
+	</p>
+
+a  b
+a  b
+
+6
+7
+8
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt
new file mode 100644
index 0000000..8d9d372
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Numeric Operations Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Start with the increment operator:</p>
+<p>a1 = 0</p>
+<p>a1 = 1</p>
+<p>a1 = 2</p>
+
+<p>Now the decrement operator:</p>
+<p>a2 = 5</p>
+<p>a2 = 4</p>
+<p>a2 = 3</p>
+<p>a2 = 2</p>
+<p>a2 = 1</p>
+<p>a2 = 0</p>
+<p>a2 = -1</p>
+
+<p>Now the add operator:</p>
+<p>op1 = 5, op2 = 3, op3 = 8</p>
+<p>op3 = 11</p>
+
+<p>And the subtract operator:</p>
+<p>op1 = 5, op2 = 3, op3 = 2</p>
+<p>op3 = -1</p>
+
+<p>The comparison operators:</p>
+   <p>Item is: 0</p>
+   <p>Item is less than five.</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is: 1</p>
+   <p>Item is less than five.</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is: 2</p>
+   <p>Item is less than five.</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is: 3</p>
+   <p>Item is less than five.</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 4</p>
+   <p>Item is less than five.</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 5</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 6</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 7</p>
+   <p>Item is less than or equals to seven.</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 8</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 9</p>
+   <p>Item is greater than two.</p>
+   <p>Item is: 10</p>
+   <p>Item is greater than two.</p>
+   <p>Item is greater than or equal to ten.</p>
+   <p>Item is: 11</p>
+   <p>Item is greater than two.</p>
+   <p>Item is greater than or equal to ten.</p>
+   <p>Item is: 12</p>
+   <p>Item is greater than two.</p>
+   <p>Item is greater than or equal to ten.</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt
new file mode 100644
index 0000000..43c7eed
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Compress Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>This is the same message, using the &quot;compress&quot; tag:</p>
+<p>Hello, world!</p>
+<p>This is the same message, using the &quot;StandardCompress&quot; transform model:</p>
+<p>Hello, world!</p>
+<p>This multi-line message should be compressed to a single line.</p>
+
+<p>An example where the first character is not whitespace but the second character is:</p>
+<p>x y</p>
+
+<p>The end.</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt
new file mode 100644
index 0000000..9180262
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+Nov 15, 2002 2:54:13 PM
+Nov 15, 2002 2:54:13 PM
+Nov 15, 2002 2:54:13 PM
+Nov 15, 2002 2:54:13 PM
+11/15/02 2:54 PM
+Nov 15, 2002 2:54:13 PM
+November 15, 2002 2:54:13 PM GMT
+11/15/02 2:54 PM
+11/15/02 2:54:13 PM
+11/15/02 2:54:13 PM GMT
+Nov 15, 2002 2:54 PM
+Nov 15, 2002 2:54:13 PM
+Nov 15, 2002 2:54:13 PM GMT
+November 15, 2002 2:54 PM
+November 15, 2002 2:54:13 PM
+November 15, 2002 2:54:13 PM GMT
+Nov 15, 2002
+Nov 15, 2002
+11/15/02
+Nov 15, 2002
+November 15, 2002
+2:54:13 PM
+2:54:13 PM
+2:54 PM
+2:54:13 PM
+2:54:13 PM GMT
+2002. november 15. 14:54:13 GMT
+Fri, 15 Nov 02002 14:54:13 GMT
+Fri, 15 Nov 2002 14:54:13 GMT
+Fri, 15 Nov 2002 14:54:13 GMT
+2002
+
+2002
+2002
+
+2002
+11
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt
new file mode 100644
index 0000000..e015315
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+array-0
+array-1
+2
+array-0
+array-1
+list-0
+list-1
+list-2
+3
+not empty
+list-0
+value
+objValue
+foo-value
+hasfoo
+nobaz
+bar-value-0
+foo-value
+overloaded-int-1
+overloaded-String-String
+Message
+1974-11-14
+static-method
+static-overloaded-int-1
+static-overloaded-String-String
+static-final-field
+static-field
+ONEx
+TWOx
+THREEx
+true
+false
+false
+42
+1
+m
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt
new file mode 100644
index 0000000..3a52c46
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+No NS = No NS
+x NS = x NS
+y NS = y NS
+x NS = x NS
+
+true
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt
new file mode 100644
index 0000000..fd48463
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+foo
+
+luck
+
+
+0
+
+   UNDEFINED is undefined.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt
new file mode 100644
index 0000000..ccfe5c8
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+FreeMarker: Encoding built-in tests
+
+html: [&amp;&lt;&gt;&quot;&#39;{}\a/]
+xml:  [&amp;&lt;&gt;&quot;&apos;{}\a/]
+xhtml: [&amp;&lt;&gt;&quot;&#39;{}\a/]
+rtf:  [&<>"'\{\}\\a/]
+html: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
+xml:  [a&amp;a&lt;a&gt;a&quot;a&apos;a{a}a\]
+xhtml: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
+rtf:  [a&a<a>a"a'a\{a\}a\\]
+html: [&lt;&lt;&lt;&lt;&lt;]
+xml:  [&lt;&lt;&lt;&lt;&lt;]
+xhtml: [&lt;&lt;&lt;&lt;&lt;]
+rtf:  [\{\{\{\{\{]
+html: []
+xml:  []
+xhtml: []
+rtf:  []
+html: [a]
+xml:  [a]
+xhtml: [a]
+rtf:  [a]
+html: [&amp;]
+xml:  [&amp;]
+xhtml: [&amp;]
+rtf:  [\{]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt
new file mode 100644
index 0000000..c0a5440
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+a
+b
+c
+a
+b
+c
+a
+1
+a
+b
+c
+&lt;&amp;&gt;
+&amp;lt;&amp;amp;&amp;gt;
+&lt;&amp;&gt;
+---
+<Mooo> = <Mooo>
+  <MOOO> = <MOOO>
+    &LT;MOOO&GT; = &lt;MOOO&gt;
+      <MOOO> = <MOOO>
+    &LT;MOOO&GT; = &lt;MOOO&gt;
+  <MOOO> = <MOOO>
+    <Mooo> = <Mooo>
+      &lt;Mooo&gt; = &lt;Mooo&gt;
+        <Mooo> = <Mooo>
+      &lt;Mooo&gt; = &lt;Mooo&gt;
+    <Mooo> = <Mooo>
+  <MOOO> = <MOOO>
+  red green blue
+---
+  <A&amp;B>[a&b](A&B) <A&amp;B2>[a&b2](A&B2)
+    <{a&amp;b}A&amp;B>[{a&b}a&b]({a&b}A&B) <{a&amp;b2}A&amp;B2>[{a&b2}a&b2]({a&b2}A&B2)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt
new file mode 100644
index 0000000..0ea4395
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt
@@ -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.
+ */
+<html>
+<head>
+<title>FreeMarker: Exception Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world! <br />
+freemarker.template.TemplateModelException: Throwing from ExceptionModel!
+	at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:57)
+	at freemarker.template.compiler.Expression.getStringValue(Expression.java:65)
+	at freemarker.template.compiler.DollarVariable.process(DollarVariable.java:62)
+	at freemarker.template.compiler.NestedTemplateElements.process(NestedTemplateElements.java:76)
+	at freemarker.template.Template.process(Template.java:266)
+	at freemarker.template.Template.process(Template.java:289)
+	at freemarker.test.TestException.runTest(TestException.java:91)
+	at junit.framework.TestCase.runBare(TestCase.java:140)
+	at junit.framework.TestResult$1.protect(TestResult.java:106)
+	at junit.framework.TestResult.runProtected(TestResult.java:124)
+	at junit.framework.TestResult.run(TestResult.java:109)
+	at junit.framework.TestCase.run(TestCase.java:131)
+	at junit.framework.TestSuite.runTest(TestSuite.java:173)
+	at junit.framework.TestSuite.run(TestSuite.java:168)
+	at junit.swingui.TestRunner$17.run(TestRunner.java:644)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt
new file mode 100644
index 0000000..bf441d3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Exception Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world! <br />
+<!-- Template Error: Couldn't get value of variable test: Couldn't read string value of test: freemarker.template.TemplateModelException: Throwing from ExceptionModel!
+	at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:42)
+	at freemarker.template.expression.Variable.getValue(Variable.java:69)
+	at freemarker.template.instruction.VariableInstruction.process(VariableInstruction.java:55)
+	at freemarker.template.compiler.TemplateArrayList.process(TemplateArrayList.java:69)
+	at freemarker.template.Template.process(Template.java:226)
+	at freemarker.test.TestException2.runTest(TestException2.java:83)
+	at junit.framework.TestCase.runBare(TestCase.java:140)
+	at junit.framework.TestResult$1.protect(TestResult.java:106)
+	at junit.framework.TestResult.runProtected(TestResult.java:124)
+	at junit.framework.TestResult.run(TestResult.java:109)
+	at junit.framework.TestCase.run(TestCase.java:131)
+	at junit.framework.TestSuite.runTest(TestSuite.java:173)
+	at junit.framework.TestSuite.run(TestSuite.java:168)
+	at junit.swingui.TestRunner$17.run(TestRunner.java:644)
+ -->
+</p>
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt
new file mode 100644
index 0000000..6089e87
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+<html><head></head><body bgcolor="#ffffff">
+Template Compilation Error: Identifier expected at line 10.
+</body></html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt
new file mode 100644
index 0000000..acb1f78
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Extended Hash Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>A hash set of 8 animals follows:</p>
+
+<p>
+  elephant, 
+
+  cat, 
+
+  zebra, 
+
+  dog, 
+
+  aardvark, 
+
+  kiwi, 
+
+  squirrel, 
+
+  gecko.
+</p>
+
+<p>The first animal is an elephant, and the last is a 
+gecko.</p>
+
+<p>A hash set of 8 digits follows:<p>
+
+<p>
+  six, 
+
+  four, 
+
+  eight, 
+
+  five, 
+
+  one, 
+
+  two, 
+
+  seven, 
+
+  three.
+</p>
+
+<p>The zebra number is eight.</p>
+
+<p>The end.</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt
new file mode 100644
index 0000000..9736322
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+a:
+  a = 1
+  b = 2
+  c = 3
+  X = 4
+  ---
+  1
+  2
+  3
+  4
+  ---
+
+B:
+  d = 10
+  e = 20
+  f = 30
+  X = 40
+  ---
+  10
+  20
+  30
+  40
+  ---
+
+a + B:
+  a = 1
+  b = 2
+  c = 3
+  X = 40
+  d = 10
+  e = 20
+  f = 30
+  ---
+  1
+  2
+  3
+  40
+  10
+  20
+  30
+  ---
+
+B + a:
+  d = 10
+  e = 20
+  f = 30
+  X = 4
+  a = 1
+  b = 2
+  c = 3
+  ---
+  10
+  20
+  30
+  4
+  1
+  2
+  3
+  ---
+
+a + a:
+  a = 1
+  b = 2
+  c = 3
+  X = 4
+  ---
+  1
+  2
+  3
+  4
+  ---
+
+{} + a:
+  a = 1
+  b = 2
+  c = 3
+  X = 4
+  ---
+  1
+  2
+  3
+  4
+  ---
+
+a + {}:
+  a = 1
+  b = 2
+  c = 3
+  X = 4
+  ---
+  1
+  2
+  3
+  4
+  ---
+
+{} + {}:
+  ---
+  ---
+
+a + b + {} + b + {} + a:
+  a = 1
+  b = 2
+  c = 3
+  X = 4
+  d = 10
+  e = 20
+  f = 30
+  ---
+  1
+  2
+  3
+  4
+  10
+  20
+  30
+  ---
+
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt
new file mode 100644
index 0000000..3af1052
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Hash Literal Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now perform a hash assignment:</p>
+
+
+test23
+Hello, world!
+hello all
+1
+
+<p>Now update the assignment and repeat:</p>
+
+
+test23
+Hello, world!
+hello all
+
+1
+
+<p>Now reassign the list and repeat:</p>
+
+
+test23
+Hello, world!
+
+
+1
+Temporary
+Temporary
+Temporary
+
+<p>Pathological case: zero item hash:</p>
+
+
+
+<p>Hash of number literals:</p>
+2
+
+<p>Hash concatenation:</p>
+a => 1
+b => 3
+c => 4
+
+<p>Empty hash concatenation:</p>
+foo, bar
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt
new file mode 100644
index 0000000..b1072fd
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Exec Model Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!
+</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt
new file mode 100644
index 0000000..1c62bd5
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+<a-b>red123</a-b>
+
+f-a works
+
+dash-dash-dash etc.
+dash-dash-dash etc.
+propVal
+propVal
+
+List: 123
+
+Switch: OK
+ESCAPED
+
+
+as1
+as2
+as3
+as4
+as5
+
+<catchAll x=1 y=2 a:b.c=5 data-foo=4 z=3 />
+
+---.: = dash-dash-dash etc.
+@as@_a = as1
+as/b = as3
+as'c = as4
+as"d = as5
+as-c = as2
+catchAll = ...
+dumpNS = ...
+f-a = ...
+hash = ...
+ls:a = ...
+m/b2 = ...
+m-a = ...
+m-b2 = ...
+sw-a = ...
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt
new file mode 100644
index 0000000..8a8d04f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+Korean Keyboard

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt
new file mode 100644
index 0000000..7c9d1d8
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ */
+
+- good
+- good
+- good
+- good
+
+- good
+- good
+
+- good
+- good
+- good
+- good
+
+- good
+- good
+- good
+- good
+
+- good
+- good
+- good
+- good
+
+- good
+- good
+
+- good
+- good
+- good
+- good
+
+- good
+- good
+- good
+- good
+
+- 1
+- 
+- 
+- is 1
+- isn't 2
+- isn't 3
+- Finally, it's: 1
+- 
+- 2
+- 
+- isn't 1
+- is 2
+- isn't 3
+- Finally, it's: 2
+- 
+- 
+- 3
+- isn't 1
+- isn't 2
+- is 3
+- Finally, it's: 3
+- 
+- 
+- 
+- isn't 1
+- isn't 2
+- isn't 3
+- Finally, it's: 4
+
+    1:
+      == 1
+    1:
+      <= 2
+    1:
+      <= 3
+    2:
+      > 1
+    2:
+      == 2
+    2:
+      <= 3
+    3:
+      > 1
+    3:
+      > 2
+    3:
+      == 3
+      End
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt
new file mode 100644
index 0000000..b51a4f4
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+--
+--
+
+
+jsmith@acme.com
+  Test bar.
+  Email: jsmith@acme.com
+
+jsmith@acme.com
+  Test bar.
+  Email: jsmith@acme.com
+    Email in the root: jsmith@other1.com
+
+jsmith@other2.com
+  Test bar.
+  Email: jsmith@other2.com
+    Email in the root: jsmith@other1.com
+
+jsmith@other2.com
+jsmith@other3.com
+
+foobarfoobar
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt
new file mode 100644
index 0000000..c72d69c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Include Instruction Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+Hello, world!
+
+	<p>Message exists!
+
+<p>Test normal includes:</p>
+<p>A test of included files:</p>
+
+	<p>Message exists!:<br />
+        Hello, world!</p>
+
+ Can you see me? 
+
+assigning from included template
+I'm here, mon!
+
+Kilroy
+ Can you see me? Kilroy
+
+<p>Test subdir includes:</p>
+<p>This is include-subdir.ftl</p>
+<p>Testing including from same directory</p>
+<p>This is include-subdir2.ftl</p>
+<p>Testing including from relative parent</p>
+<p>A test of included files:</p>
+
+	<p>Message exists!:<br />
+        Hello, world!</p>
+
+ Can you see me? 
+<p>Testing including from loader root</p>
+<p>A test of included files:</p>
+
+	<p>Message exists!:<br />
+        Hello, world!</p>
+
+ Can you see me? 
+<p>Testing including through acquisition</p>
+<p>This is include-subdir2.ftl</p>
+</body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt
new file mode 100644
index 0000000..b7c43a9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+A próba
+A próba
+
+A próba
+A próba
+A próba
+A próba
+
+[]
+[]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt
new file mode 100644
index 0000000..fe862e6
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+abcdef
+abcdef
+abcdef
+
+M
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt
new file mode 100644
index 0000000..fb44def
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: List Iterator Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now iterate over a list:</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>Now iterate again:</p>
+
+<p>0. one</p>
+<p>1. two</p>
+<p>2. three</p>
+<p>3. four</p>
+<p>4. five</p>
+
+<p>Iterate over a list in a hash:</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+<p>one</p>
+<p>two</p>
+<p>three</p>
+<p>four</p>
+<p>five</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt
new file mode 100644
index 0000000..dbe5fd0
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Last Character Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+  
+    13
+    
+    ELLO, WORLD!
+    
+    message: Hello, Worl

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt
new file mode 100644
index 0000000..3b9b76d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+    0: a [0:A, 1:B, 2:C]
+    1: b [0:A, 1:B, 2:C]
+    2: c [0:A, 1:B, 2:C]
+
+    0: a 0a/0A, 0a/1B, 0a/2C
+    1: b 1b/0A, 1b/1B, 1b/2C
+    2: c 2c/0A, 2c/1B, 2c/2C
+
+0:a, 1:b, 2:c
+1. a; 2. b; 3. c;
+
+a, b, c
+a, b, c
+
+A, b, c.
+
+true/false false/true true/false
+
+    <td class="oddRow">a</td>
+    <td class="evenRow">b</td>
+    <td class="oddRow">c</td>
+
+    <td class="rowOdd">a</td>
+    <td class="rowEven">b</td>
+    <td class="rowOdd">c</td>
+
+    <td class="R">a</td>
+    <td class="G">b</td>
+    <td class="B">c</td>
+    <td class="R">d</td>
+    <td class="G">e</td>
+    <td class="B">f</td>
+    <td class="R">g</td>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt
new file mode 100644
index 0000000..05373bd
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+Size: 4
+Items: @0 aardvark, @1 bear, @2 cat, @3 dog.
+
+Size: 1
+Items: @0 aardvark.
+
+Size: 0
+Items: 
+
+Size: 3
+Items: @0 11, @1 22, @2 33.
+
+Size: 3
+Items: @0 11, @1 22, @2 33.
+
+Size: 3
+Items: @0 11, @1 22, @2 33.
+
+Size: failed
+Items: @0 11, @1 22, @2 33.
+
+Size: 0
+Items: 
+
+Size: 0
+Items: 
+
+Size: 0
+Items: 
+
+Size: failed
+Items: 
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt
new file mode 100644
index 0000000..cb9e6d4
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt
@@ -0,0 +1,211 @@
+/*
+ * 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.
+ */
+=== [aardvark, bear, cat, dog] ===
+
+-- List+sep:
+    aardvark,
+    bear,
+    cat,
+    dog
+-- List+else:
+    aardvark
+    bear
+    cat
+    dog
+-- List+items:
+    [
+        aardvark
+        bear
+        cat
+        dog
+    ]
+-- List+items+else:
+    [
+        aardvark
+        bear
+        cat
+        dog
+    ]
+-- List+items+sep+else:
+    [
+        aardvark,
+        bear,
+        cat,
+        dog
+    ]
+--
+
+=== [aardvark] ===
+
+-- List+sep:
+    aardvark
+-- List+else:
+    aardvark
+-- List+items:
+    [
+        aardvark
+    ]
+-- List+items+else:
+    [
+        aardvark
+    ]
+-- List+items+sep+else:
+    [
+        aardvark
+    ]
+--
+
+=== [] ===
+
+-- List+sep:
+-- List+else:
+    Empty!
+-- List+items:
+-- List+items+else:
+    Empty!
+-- List+items+sep+else:
+    Empty!
+--
+
+=== [11, 22, 33] ===
+
+-- List+sep:
+    11,
+    22,
+    33
+-- List+else:
+    11
+    22
+    33
+-- List+items:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+else:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+sep+else:
+    [
+        11,
+        22,
+        33
+    ]
+--
+
+=== [11, 22, 33] ===
+
+-- List+sep:
+    11,
+    22,
+    33
+-- List+else:
+    11
+    22
+    33
+-- List+items:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+else:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+sep+else:
+    [
+        11,
+        22,
+        33
+    ]
+--
+
+=== [11, 22, 33] ===
+
+-- List+sep:
+    11,
+    22,
+    33
+-- List+else:
+    11
+    22
+    33
+-- List+items:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+else:
+    [
+        11
+        22
+        33
+    ]
+-- List+items+sep+else:
+    [
+        11,
+        22,
+        33
+    ]
+--
+
+=== [] ===
+
+-- List+sep:
+-- List+else:
+    Empty!
+-- List+items:
+-- List+items+else:
+    Empty!
+-- List+items+sep+else:
+    Empty!
+--
+
+=== [] ===
+
+-- List+sep:
+-- List+else:
+    Empty!
+-- List+items:
+-- List+items+else:
+    Empty!
+-- List+items+sep+else:
+    Empty!
+--
+
+=== [] ===
+
+-- List+sep:
+-- List+else:
+    Empty!
+-- List+items:
+-- List+items+else:
+    Empty!
+-- List+items+sep+else:
+    Empty!
+--
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt
new file mode 100644
index 0000000..26fc60d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+[
+    [(11@0, 11@0), (11@0, 22@1), (11@0, 33@2)],
+    [(22@1, 11@0), (22@1, 22@1), (22@1, 33@2)],
+    [(33@2, 11@0), (33@2, 22@1), (33@2, 33@2)]
+]
+
+
+        <p>2 hits:
+        <div class="hits">
+                        <div class="hit">a</div>
+                        <div class="hit">b</div>
+        </div>
+
+        <p>2 hits:
+        <div class="hits">
+                        <div class="hitOther">a</div>
+                        <div class="hitOther">b</div>
+        </div>
+
+        <p>2 hits:
+        <div class="hits">
+                    ...
+        </div>
+
+        <p>Nothing.
+
+11, 22, ...
+[11, 22, ...]
+
+1, 2, 3
+1 /*first*/, 2, 3
+[1, 2, 3]
+1
+1
+[1]
+Empty
+Empty
+Empty
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt
new file mode 100644
index 0000000..e251238
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt
@@ -0,0 +1,157 @@
+/*
+ * 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.
+ */
+
+Non-empty maps:
+
+    Map:
+    
+    [
+      k1 = v1
+      2 = v2
+      k3 = v3
+      null = v4
+      Y = v5
+      N = null
+    ]
+  
+    [
+      k1 = v1; // @0=@0; odd=odd; Y=Y
+      2 = v2; // @1=@1; even=even; Y=Y
+      k3 = v3; // @2=@2; odd=odd; Y=Y
+      null = v4; // @3=@3; even=even; Y=Y
+      Y = v5; // @4=@4; odd=odd; Y=Y
+      N = null // @5=@5; even=even; N=N
+    ]
+  
+    {
+      [
+        k1 = v1; // @0=@0; odd=odd; Y=Y
+        2 = v2; // @1=@1; even=even; Y=Y
+        k3 = v3; // @2=@2; odd=odd; Y=Y
+        null = v4; // @3=@3; even=even; Y=Y
+        Y = v5; // @4=@4; odd=odd; Y=Y
+        N = null // @5=@5; even=even; N=N
+      ]
+    }
+
+    Map:
+    
+    [
+      k1 = v1
+      2 = v2
+      k3 = v3
+      null = v4
+      Y = v5
+      N = null
+    ]
+  
+    [
+      k1 = v1; // @0=@0; odd=odd; Y=Y
+      2 = v2; // @1=@1; even=even; Y=Y
+      k3 = v3; // @2=@2; odd=odd; Y=Y
+      null = v4; // @3=@3; even=even; Y=Y
+      Y = v5; // @4=@4; odd=odd; Y=Y
+      N = null // @5=@5; even=even; N=N
+    ]
+  
+    {
+      [
+        k1 = v1; // @0=@0; odd=odd; Y=Y
+        2 = v2; // @1=@1; even=even; Y=Y
+        k3 = v3; // @2=@2; odd=odd; Y=Y
+        null = v4; // @3=@3; even=even; Y=Y
+        Y = v5; // @4=@4; odd=odd; Y=Y
+        N = null // @5=@5; even=even; N=N
+      ]
+    }
+
+    Map:
+    
+    [
+      k1 = 11
+      k2 = 22
+    ]
+  
+    [
+      k1 = 11; // @0=@0; odd=odd; Y=Y
+      k2 = 22 // @1=@1; even=even; N=N
+    ]
+  
+    {
+      [
+        k1 = 11; // @0=@0; odd=odd; Y=Y
+        k2 = 22 // @1=@1; even=even; N=N
+      ]
+    }
+
+
+Empty maps:
+
+    Map:
+    
+    [
+    ]
+  
+    [
+      Empty
+    ]
+  
+    {
+      Empty
+    }
+
+    Map:
+    
+    [
+    ]
+  
+    [
+      Empty
+    ]
+  
+    {
+      Empty
+    }
+
+    Map:
+    
+    [
+    ]
+  
+    [
+      Empty
+    ]
+  
+    {
+      Empty
+    }
+
+
+  a @ 0, 1
+    aa = 11  @ 0 // inside a @ 0, 1
+  a @ 0, 1
+  --
+  b @ 1, 2
+    ba = 21  @ 0 // inside b @ 1, 2
+    bb = 22  @ 1 // inside b @ 1, 2
+  b @ 1, 2
+  --
+  c @ 2, 0
+  c @ 2, 0
+  --

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt
new file mode 100644
index 0000000..937f0ea
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+  KVPs:
+    a = 3
+    b = 2
+  
+  Keys:
+    a
+    b
+  
+  Values:
+    3
+    2
+
+  KVPs:
+  
+  Keys:
+  
+  Values:
+



[08/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns4.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns4.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns4.ftl
new file mode 100644
index 0000000..e97bfc0
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns4.ftl
@@ -0,0 +1,70 @@
+<#ftl ns_prefixes = {"x" : "http://x", "y" : "http://y"}>
+<#--
+  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.
+-->
+<#recurse doc >
+
+<#macro book>
+  <html>
+    <head>
+      <title><#recurse .node["x:title"]></title>
+    </head>
+    <body>
+      <h1><#recurse .node["x:title"]></h1>
+      <#recurse>
+    </body>
+  </html>
+</#macro>
+
+<#macro chapter>
+  <h2><#recurse .node["y:title"]></h2>
+  <#recurse>
+</#macro>
+
+<#macro 'x:chapter'>
+  <h2><#recurse .node["y:title"]></h2>
+  <#recurse>
+</#macro>
+
+<#macro para>
+  <p><#recurse>
+</#macro>
+
+<#macro 'x:para'>
+  <p><#recurse>
+</#macro>
+
+<#macro 'y:para'>
+  <p><#recurse>
+</#macro>
+
+<#macro "x:title">
+  <#--
+    We have handled this element imperatively,
+    so we do nothing here.
+  -->
+</#macro>
+
+<#macro "y:title">
+  <#--
+    We have handled this element imperatively,
+    so we do nothing here.
+  -->
+</#macro>
+
+<#macro @text>${.node?html}</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns5.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns5.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns5.ftl
new file mode 100644
index 0000000..edc3b4a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns5.ftl
@@ -0,0 +1,28 @@
+<#ftl ns_prefixes = {"D": "http://y.com", "xx" : "http://x.com"}>
+<#--
+  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.
+-->
+<#assign r = doc["N:root"]>
+${r["N:t1"][0]?default('-')} = No NS
+${r["xx:t2"][0]?default('-')} = x NS
+${r["t3"][0]?default('-')} = y NS
+${r["xx:t4"][0]?default('-')} = x NS
+${r["//t1"][0]?default('-')} = No NS
+${r["//t2"][0]?default('-')} = -
+${r["//t3"][0]?default('-')} = -
+${r["//t4"][0]?default('-')} = -

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/testcases.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/testcases.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/testcases.xml
new file mode 100644
index 0000000..866da69
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/testcases.xml
@@ -0,0 +1,211 @@
+<?xml version="1.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.
+-->
+
+<!DOCTYPE testCases [
+  <!ELEMENT testCases (setting?, testCase*)>
+  <!ELEMENT testCase (setting?)>
+     <!ATTLIST testCase 
+               name CDATA #REQUIRED
+               template CDATA #IMPLIED
+               expected CDATA #IMPLIED
+               noOutput CDATA #IMPLIED
+     >
+     <!-- The default of `template` is "${name?keep_before('[#endTN]')}.ftl" -->
+     <!-- The default of `expected` is "${name}.txt" -->
+     <!-- The default of `noOutput` is false -->
+     
+ <!ELEMENT setting EMPTY>
+     <!ATTLIST setting 
+            auto_import CDATA #IMPLIED
+            source_encoding CDATA #IMPLIED
+            locale CDATA #IMPLIED
+            object_wrapper CDATA #IMPLIED
+            output_encoding CDATA #IMPLIED
+            output_dir CDATA #IMPLIED
+            new_builtin_class_resolver CDATA #IMPLIED
+            url_escaping_charset CDATA #IMPLIED
+            incompatible_improvements CDATA #IMPLIED
+            time_zone CDATA #IMPLIED
+            api_builtin_enabled CDATA #IMPLIED
+      >
+]>
+<!--
+Note that for the incompatible_improvements setting you can specify a list of versions, for example:
+<setting incompatible_improvements="min, 3.0.5, max" /> 
+-->
+
+<testCases>
+   <setting source_encoding="UTF-8" output_encoding="UTF-8" />
+   
+   <testCase name="api-builtins" noOutput="true">
+      <setting api_builtin_enabled="true" />
+   </testCase>
+   <testCase name="arithmetic" />
+   <testCase name="assignments" noOutput="true" />
+   <testCase name="boolean" />
+   <testCase name="charset-in-header" />
+   <testCase name="comment" />
+   <testCase name="comparisons" />
+   <testCase name="compress" />
+   <testCase name="then-builtin" noOutput="true" />
+   <testCase name="dateformat-java" />
+   <testCase name="dateformat-iso-like" noOutput="true" />
+   <testCase name="dateformat-iso-bi" noOutput="true" />
+   <testCase name="dateparsing" noOutput="true" />
+   <testCase name="default"/>
+   <testCase name="default-object-wrapper">
+      <setting api_builtin_enabled="true" />
+   </testCase>
+   <testCase name="default-xmlns" />
+   <testCase name="encoding-builtins" />
+   <testCase name="escapes" />
+   <testCase name="hashliteral" />
+   <testCase name="identifier-non-ascii" />
+   <testCase name="identifier-escaping" />
+   <testCase name="import">
+      <setting auto_import="import_lib.ftl as my"/>
+   </testCase>
+   <testCase name="include" />
+   <testCase name="include2">
+      <setting source_encoding="utf-8" />
+   </testCase>
+   <testCase name="interpret"/>
+   <testCase name="iterators"/>
+   <testCase name="lastcharacter"/>
+   <testCase name="list[#endTN]-simpleTemplateModels" expected="list.txt">
+      <setting object_wrapper="org.apache.freemarker.core.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list[#endTN]-collectionAdapter" expected="list.txt">
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list2[#endTN]-simpleTemplateModels" expected="list2.txt">
+      <setting object_wrapper="org.apache.freemarker.core.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list2[#endTN]-collectionAdapter" expected="list2.txt">
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list3[#endTN]-simpleTemplateModels" expected="list3.txt">
+      <setting object_wrapper="org.apache.freemarker.core.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list3[#endTN]-collectionAdapter" expected="list3.txt">
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="list-bis" />
+   <testCase name="list-bis[#endTN]-collectionAdapter" expected="list-bis.txt">
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="listhash" />
+   <testCase name="listhashliteral" />
+   <testCase name="listliteral" />
+   <testCase name="localization" >
+      <setting locale="en_AU"/>
+   </testCase>
+   <testCase name="loopvariable" />
+   <testCase name="macros"/>
+   <testCase name="macros2"/>
+   <testCase name="macros-return"/>
+   <testCase name="multimodels"/>
+   <testCase name="nested" />
+   <testCase name="newlines1" />
+   <testCase name="newlines2" />
+   <testCase name="noparse" />
+   <testCase name="number-format" />
+   <testCase name="number-literal" >
+      <setting locale="fr_FR"/>
+   </testCase>
+   <testCase name="numerical-cast" />
+   <testCase name="output-encoding1"/>
+   <testCase name="output-encoding2">
+       <setting output_encoding="UTF-16"/>
+   </testCase>
+   <testCase name="output-encoding3">
+       <setting output_encoding="ISO-8859-1" url_escaping_charset="UTF-16" />
+   </testCase>
+   <testCase name="precedence"/>
+   <testCase name="range" noOutput="true" />
+   <testCase name="recover" />
+   <testCase name="root" />
+   <testCase name="setting" noOutput="true" />
+   <testCase name="sequence-builtins[#endTN]-with-SimpleTemplateModel" expected="sequence-builtins.txt">
+      <setting object_wrapper="org.apache.freemarker.core.templatesuite.models.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
+   </testCase>
+   <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper" expected="sequence-builtins.txt">
+      <setting object_wrapper="default"/> 
+   </testCase>
+   <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper-collAdapters" expected="sequence-builtins.txt">
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)"/>
+   </testCase>
+   <testCase name="simplehash-char-key" noOutput="true" />
+   <testCase name="existence-operators" noOutput="true" />
+   <testCase name="string-builtins1" />
+   <testCase name="string-builtins2" />
+   <testCase name="string-builtins3" noOutput="true" />
+   <testCase name="string-builtins-regexps" />
+   <testCase name="string-builtins-regexps-matches" />
+   <testCase name="stringbimethods" />
+   <testCase name="stringliteral"/>
+   <testCase name="if" />
+   <testCase name="switch" />
+   <testCase name="switch-builtin" noOutput="true" />
+   <testCase name="transforms"/>
+   <testCase name="type-builtins" />
+   <testCase name="date-type-builtins" noOutput="true" />
+   <testCase name="url" noOutput="true" />
+   <testCase name="var-layers"/>
+   <testCase name="variables"/>
+   <testCase name="whitespace-trim"/>
+   <testCase name="wstrip-in-header"/>
+   <testCase name="xml-fragment" />
+   <testCase name="xmlns1" />
+   <testCase name="xmlns2" template="xmlns1.ftl"  expected="xmlns1.txt" />
+   <testCase name="xmlns3" />
+   <testCase name="xmlns4" />
+   <testCase name="xmlns5" />
+   <testCase name="xml-ns_prefix-scope" template="xml-ns_prefix-scope-main.ftl" />
+   <testCase name="hashconcat"/>
+   <testCase name="new-defaultresolver" />
+   <testCase name="new-unrestricted" template="new-defaultresolver.ftl" expected="new-defaultresolver.txt">
+      <setting new_builtin_class_resolver="unrestricted"/>
+   </testCase>   
+   <testCase name="new-allowsnothing" template="new-defaultresolver.ftl">
+      <setting new_builtin_class_resolver="allows_nothing"/>
+   </testCase>   
+   <testCase name="new-optin">
+      <setting new_builtin_class_resolver="
+      		allowed_classes: org.apache.freemarker.core.templatesuite.models.NewTestModel,
+      		trusted_templates: subdir/new-optin.ftl, subdir/subsub/*"
+      />
+   </testCase>   
+   <testCase name="specialvars">
+      <setting locale="en_US" output_encoding="utf-8" url_escaping_charset="iso-8859-1"/>
+   </testCase>   
+   <testCase name="number-to-date" />
+   <testCase name="varargs" />
+   <testCase name="boolean-formatting"  />
+   <testCase name="number-math-builtins" noOutput="true" />
+   <testCase name="string-builtin-coercion" noOutput="true" />
+   
+   <testCase name="overloaded-methods[#endTN]-inc-dow" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.DefaultObjectWrapperInc"/>
+   </testCase>
+   <testCase name="overloaded-methods[#endTN]-desc-dow" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.DefaultObjectWrapperDesc"/>
+   </testCase>
+</testCases>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/arithmetic.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/arithmetic.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/arithmetic.txt
deleted file mode 100644
index 33a7186..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/arithmetic.txt
+++ /dev/null
@@ -1,46 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Arithmetic Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Perform a number assignment:</p>
-
-
-3.234
-2.00
-0.6172500000000000000000000000000000000000
-1.620089104901
-1.6201
-
-<P>Display a number with at least 3 digits after the decimal point</P>
-
-1234.000
-
-<p>Now use numbers in assignment</p>
-
-
-1257.77
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean-formatting.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean-formatting.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean-formatting.txt
deleted file mode 100644
index 0bab0bc..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean-formatting.txt
+++ /dev/null
@@ -1,31 +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.
- */
-Y Y Y
-N N N
-y y y
-n n n
-y y y
-n n n
-str:n str:n
-nein ja
-theStringValue theStringValue
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean.txt
deleted file mode 100644
index 8dc1290..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/boolean.txt
+++ /dev/null
@@ -1,102 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Boolean Values Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-
-<p>Now perform scalar boolean tests:</p>
-
-<p>
-    b is true.<br />
-</p>
-
-<p>    This makes sense.<br />
-</p>
-
-<p>
-    boolean3 succeeded.<br />
-</p>
-
-<p>
-    boolean4 succeeded.<br />
-</p>
-
-<p>
-    boolean4 || boolean5 succeeded.<br />
-</p>
-
-<p>
-    boolean5 || boolean4 || boolean5 succeeded.<br />
-</p>
-
-<p>    boolean4 && boolean5 failed.<br />
-</p>
- 
-<p>Now test list models:</p>
-
-<p>
-    list1 succeeded.<br />
-</p>
-
-<p>
-    list2 succeeded.<br />
-</p>
-
-<p>Test hash models:</p>
-
-<p>
-    hash1 succeeded: Hello, world.<br />
-</p>
-
-<p>
-    hash2 succeeded.<br />
-</p>
-
-<p>Test not operator:</p>
-
-<p>
-   Not boolean1 succeeded
-</p>
-
-<p>
-   Not boolean1 succeeded
-</p>
-
-<p>   Not boolean2 failed
-</p>
-
-<p>   Not boolean2 failed
-</p>
-
-<p>
-   Message is "Hello, world!"
-</p>
-
-<p>   Message is "Hello, world!"
-</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/charset-in-header.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/charset-in-header.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/charset-in-header.txt
deleted file mode 100644
index 4532027..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/charset-in-header.txt
+++ /dev/null
@@ -1,26 +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.
- */
-<head>
-  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
-</head>
-<body>
-éáőű
-õÕûÛ
-őŐűŰ
-</body>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comment.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comment.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comment.txt
deleted file mode 100644
index d5902e3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comment.txt
+++ /dev/null
@@ -1,34 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Comment Test</title>
-</head>
-<body>
-	<p>Message exists!
-	</p>
-
-a  b
-a  b
-
-6
-7
-8
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comparisons.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comparisons.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comparisons.txt
deleted file mode 100644
index 8d9d372..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/comparisons.txt
+++ /dev/null
@@ -1,93 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Numeric Operations Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Start with the increment operator:</p>
-<p>a1 = 0</p>
-<p>a1 = 1</p>
-<p>a1 = 2</p>
-
-<p>Now the decrement operator:</p>
-<p>a2 = 5</p>
-<p>a2 = 4</p>
-<p>a2 = 3</p>
-<p>a2 = 2</p>
-<p>a2 = 1</p>
-<p>a2 = 0</p>
-<p>a2 = -1</p>
-
-<p>Now the add operator:</p>
-<p>op1 = 5, op2 = 3, op3 = 8</p>
-<p>op3 = 11</p>
-
-<p>And the subtract operator:</p>
-<p>op1 = 5, op2 = 3, op3 = 2</p>
-<p>op3 = -1</p>
-
-<p>The comparison operators:</p>
-   <p>Item is: 0</p>
-   <p>Item is less than five.</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is: 1</p>
-   <p>Item is less than five.</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is: 2</p>
-   <p>Item is less than five.</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is: 3</p>
-   <p>Item is less than five.</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 4</p>
-   <p>Item is less than five.</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 5</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 6</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 7</p>
-   <p>Item is less than or equals to seven.</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 8</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 9</p>
-   <p>Item is greater than two.</p>
-   <p>Item is: 10</p>
-   <p>Item is greater than two.</p>
-   <p>Item is greater than or equal to ten.</p>
-   <p>Item is: 11</p>
-   <p>Item is greater than two.</p>
-   <p>Item is greater than or equal to ten.</p>
-   <p>Item is: 12</p>
-   <p>Item is greater than two.</p>
-   <p>Item is greater than or equal to ten.</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/compress.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/compress.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/compress.txt
deleted file mode 100644
index 43c7eed..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/compress.txt
+++ /dev/null
@@ -1,40 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Compress Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>This is the same message, using the &quot;compress&quot; tag:</p>
-<p>Hello, world!</p>
-<p>This is the same message, using the &quot;StandardCompress&quot; transform model:</p>
-<p>Hello, world!</p>
-<p>This multi-line message should be compressed to a single line.</p>
-
-<p>An example where the first character is not whitespace but the second character is:</p>
-<p>x y</p>
-
-<p>The end.</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/dateformat-java.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/dateformat-java.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/dateformat-java.txt
deleted file mode 100644
index 9180262..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/dateformat-java.txt
+++ /dev/null
@@ -1,55 +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.
- */
-Nov 15, 2002 2:54:13 PM
-Nov 15, 2002 2:54:13 PM
-Nov 15, 2002 2:54:13 PM
-Nov 15, 2002 2:54:13 PM
-11/15/02 2:54 PM
-Nov 15, 2002 2:54:13 PM
-November 15, 2002 2:54:13 PM GMT
-11/15/02 2:54 PM
-11/15/02 2:54:13 PM
-11/15/02 2:54:13 PM GMT
-Nov 15, 2002 2:54 PM
-Nov 15, 2002 2:54:13 PM
-Nov 15, 2002 2:54:13 PM GMT
-November 15, 2002 2:54 PM
-November 15, 2002 2:54:13 PM
-November 15, 2002 2:54:13 PM GMT
-Nov 15, 2002
-Nov 15, 2002
-11/15/02
-Nov 15, 2002
-November 15, 2002
-2:54:13 PM
-2:54:13 PM
-2:54 PM
-2:54:13 PM
-2:54:13 PM GMT
-2002. november 15. 14:54:13 GMT
-Fri, 15 Nov 02002 14:54:13 GMT
-Fri, 15 Nov 2002 14:54:13 GMT
-Fri, 15 Nov 2002 14:54:13 GMT
-2002
-
-2002
-2002
-
-2002
-11
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-object-wrapper.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-object-wrapper.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-object-wrapper.txt
deleted file mode 100644
index e015315..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-object-wrapper.txt
+++ /dev/null
@@ -1,55 +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.
- */
-array-0
-array-1
-2
-array-0
-array-1
-list-0
-list-1
-list-2
-3
-not empty
-list-0
-value
-objValue
-foo-value
-hasfoo
-nobaz
-bar-value-0
-foo-value
-overloaded-int-1
-overloaded-String-String
-Message
-1974-11-14
-static-method
-static-overloaded-int-1
-static-overloaded-String-String
-static-final-field
-static-field
-ONEx
-TWOx
-THREEx
-true
-false
-false
-42
-1
-m
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-xmlns.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-xmlns.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-xmlns.txt
deleted file mode 100644
index 3a52c46..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default-xmlns.txt
+++ /dev/null
@@ -1,25 +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.
- */
-No NS = No NS
-x NS = x NS
-y NS = y NS
-x NS = x NS
-
-true
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default.txt
deleted file mode 100644
index fd48463..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/default.txt
+++ /dev/null
@@ -1,26 +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.
- */
-foo
-
-luck
-
-
-0
-
-   UNDEFINED is undefined.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
deleted file mode 100644
index ccfe5c8..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
+++ /dev/null
@@ -1,44 +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.
- */
-FreeMarker: Encoding built-in tests
-
-html: [&amp;&lt;&gt;&quot;&#39;{}\a/]
-xml:  [&amp;&lt;&gt;&quot;&apos;{}\a/]
-xhtml: [&amp;&lt;&gt;&quot;&#39;{}\a/]
-rtf:  [&<>"'\{\}\\a/]
-html: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
-xml:  [a&amp;a&lt;a&gt;a&quot;a&apos;a{a}a\]
-xhtml: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
-rtf:  [a&a<a>a"a'a\{a\}a\\]
-html: [&lt;&lt;&lt;&lt;&lt;]
-xml:  [&lt;&lt;&lt;&lt;&lt;]
-xhtml: [&lt;&lt;&lt;&lt;&lt;]
-rtf:  [\{\{\{\{\{]
-html: []
-xml:  []
-xhtml: []
-rtf:  []
-html: [a]
-xml:  [a]
-xhtml: [a]
-rtf:  [a]
-html: [&amp;]
-xml:  [&amp;]
-xhtml: [&amp;]
-rtf:  [\{]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/escapes.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/escapes.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/escapes.txt
deleted file mode 100644
index c0a5440..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/escapes.txt
+++ /dev/null
@@ -1,49 +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.
- */
-a
-b
-c
-a
-b
-c
-a
-1
-a
-b
-c
-&lt;&amp;&gt;
-&amp;lt;&amp;amp;&amp;gt;
-&lt;&amp;&gt;
----
-<Mooo> = <Mooo>
-  <MOOO> = <MOOO>
-    &LT;MOOO&GT; = &lt;MOOO&gt;
-      <MOOO> = <MOOO>
-    &LT;MOOO&GT; = &lt;MOOO&gt;
-  <MOOO> = <MOOO>
-    <Mooo> = <Mooo>
-      &lt;Mooo&gt; = &lt;Mooo&gt;
-        <Mooo> = <Mooo>
-      &lt;Mooo&gt; = &lt;Mooo&gt;
-    <Mooo> = <Mooo>
-  <MOOO> = <MOOO>
-  red green blue
----
-  <A&amp;B>[a&b](A&B) <A&amp;B2>[a&b2](A&B2)
-    <{a&amp;b}A&amp;B>[{a&b}a&b]({a&b}A&B) <{a&amp;b2}A&amp;B2>[{a&b2}a&b2]({a&b2}A&B2)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception.txt
deleted file mode 100644
index 0ea4395..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception.txt
+++ /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.
- */
-<html>
-<head>
-<title>FreeMarker: Exception Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world! <br />
-freemarker.template.TemplateModelException: Throwing from ExceptionModel!
-	at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:57)
-	at freemarker.template.compiler.Expression.getStringValue(Expression.java:65)
-	at freemarker.template.compiler.DollarVariable.process(DollarVariable.java:62)
-	at freemarker.template.compiler.NestedTemplateElements.process(NestedTemplateElements.java:76)
-	at freemarker.template.Template.process(Template.java:266)
-	at freemarker.template.Template.process(Template.java:289)
-	at freemarker.test.TestException.runTest(TestException.java:91)
-	at junit.framework.TestCase.runBare(TestCase.java:140)
-	at junit.framework.TestResult$1.protect(TestResult.java:106)
-	at junit.framework.TestResult.runProtected(TestResult.java:124)
-	at junit.framework.TestResult.run(TestResult.java:109)
-	at junit.framework.TestCase.run(TestCase.java:131)
-	at junit.framework.TestSuite.runTest(TestSuite.java:173)
-	at junit.framework.TestSuite.run(TestSuite.java:168)
-	at junit.swingui.TestRunner$17.run(TestRunner.java:644)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception2.txt
deleted file mode 100644
index bf441d3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception2.txt
+++ /dev/null
@@ -1,47 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Exception Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world! <br />
-<!-- Template Error: Couldn't get value of variable test: Couldn't read string value of test: freemarker.template.TemplateModelException: Throwing from ExceptionModel!
-	at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:42)
-	at freemarker.template.expression.Variable.getValue(Variable.java:69)
-	at freemarker.template.instruction.VariableInstruction.process(VariableInstruction.java:55)
-	at freemarker.template.compiler.TemplateArrayList.process(TemplateArrayList.java:69)
-	at freemarker.template.Template.process(Template.java:226)
-	at freemarker.test.TestException2.runTest(TestException2.java:83)
-	at junit.framework.TestCase.runBare(TestCase.java:140)
-	at junit.framework.TestResult$1.protect(TestResult.java:106)
-	at junit.framework.TestResult.runProtected(TestResult.java:124)
-	at junit.framework.TestResult.run(TestResult.java:109)
-	at junit.framework.TestCase.run(TestCase.java:131)
-	at junit.framework.TestSuite.runTest(TestSuite.java:173)
-	at junit.framework.TestSuite.run(TestSuite.java:168)
-	at junit.swingui.TestRunner$17.run(TestRunner.java:644)
- -->
-</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception3.txt
deleted file mode 100644
index 6089e87..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exception3.txt
+++ /dev/null
@@ -1,21 +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.
- */
-<html><head></head><body bgcolor="#ffffff">
-Template Compilation Error: Identifier expected at line 10.
-</body></html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exthash.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exthash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exthash.txt
deleted file mode 100644
index acb1f78..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/exthash.txt
+++ /dev/null
@@ -1,76 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Extended Hash Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>A hash set of 8 animals follows:</p>
-
-<p>
-  elephant, 
-
-  cat, 
-
-  zebra, 
-
-  dog, 
-
-  aardvark, 
-
-  kiwi, 
-
-  squirrel, 
-
-  gecko.
-</p>
-
-<p>The first animal is an elephant, and the last is a 
-gecko.</p>
-
-<p>A hash set of 8 digits follows:<p>
-
-<p>
-  six, 
-
-  four, 
-
-  eight, 
-
-  five, 
-
-  one, 
-
-  two, 
-
-  seven, 
-
-  three.
-</p>
-
-<p>The zebra number is eight.</p>
-
-<p>The end.</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashconcat.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashconcat.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashconcat.txt
deleted file mode 100644
index 9736322..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashconcat.txt
+++ /dev/null
@@ -1,138 +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.
- */
-
-a:
-  a = 1
-  b = 2
-  c = 3
-  X = 4
-  ---
-  1
-  2
-  3
-  4
-  ---
-
-B:
-  d = 10
-  e = 20
-  f = 30
-  X = 40
-  ---
-  10
-  20
-  30
-  40
-  ---
-
-a + B:
-  a = 1
-  b = 2
-  c = 3
-  X = 40
-  d = 10
-  e = 20
-  f = 30
-  ---
-  1
-  2
-  3
-  40
-  10
-  20
-  30
-  ---
-
-B + a:
-  d = 10
-  e = 20
-  f = 30
-  X = 4
-  a = 1
-  b = 2
-  c = 3
-  ---
-  10
-  20
-  30
-  4
-  1
-  2
-  3
-  ---
-
-a + a:
-  a = 1
-  b = 2
-  c = 3
-  X = 4
-  ---
-  1
-  2
-  3
-  4
-  ---
-
-{} + a:
-  a = 1
-  b = 2
-  c = 3
-  X = 4
-  ---
-  1
-  2
-  3
-  4
-  ---
-
-a + {}:
-  a = 1
-  b = 2
-  c = 3
-  X = 4
-  ---
-  1
-  2
-  3
-  4
-  ---
-
-{} + {}:
-  ---
-  ---
-
-a + b + {} + b + {} + a:
-  a = 1
-  b = 2
-  c = 3
-  X = 4
-  d = 10
-  e = 20
-  f = 30
-  ---
-  1
-  2
-  3
-  4
-  10
-  20
-  30
-  ---
-
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashliteral.txt
deleted file mode 100644
index 3af1052..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/hashliteral.txt
+++ /dev/null
@@ -1,74 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Hash Literal Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now perform a hash assignment:</p>
-
-
-test23
-Hello, world!
-hello all
-1
-
-<p>Now update the assignment and repeat:</p>
-
-
-test23
-Hello, world!
-hello all
-
-1
-
-<p>Now reassign the list and repeat:</p>
-
-
-test23
-Hello, world!
-
-
-1
-Temporary
-Temporary
-Temporary
-
-<p>Pathological case: zero item hash:</p>
-
-
-
-<p>Hash of number literals:</p>
-2
-
-<p>Hash concatenation:</p>
-a => 1
-b => 3
-c => 4
-
-<p>Empty hash concatenation:</p>
-foo, bar
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/helloworld.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/helloworld.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/helloworld.txt
deleted file mode 100644
index b1072fd..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/helloworld.txt
+++ /dev/null
@@ -1,31 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Exec Model Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!
-</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-escaping.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-escaping.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-escaping.txt
deleted file mode 100644
index 1c62bd5..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-escaping.txt
+++ /dev/null
@@ -1,57 +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.
- */
-
-<a-b>red123</a-b>
-
-f-a works
-
-dash-dash-dash etc.
-dash-dash-dash etc.
-propVal
-propVal
-
-List: 123
-
-Switch: OK
-ESCAPED
-
-
-as1
-as2
-as3
-as4
-as5
-
-<catchAll x=1 y=2 a:b.c=5 data-foo=4 z=3 />
-
----.: = dash-dash-dash etc.
-@as@_a = as1
-as/b = as3
-as'c = as4
-as"d = as5
-as-c = as2
-catchAll = ...
-dumpNS = ...
-f-a = ...
-hash = ...
-ls:a = ...
-m/b2 = ...
-m-a = ...
-m-b2 = ...
-sw-a = ...
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-non-ascii.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-non-ascii.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-non-ascii.txt
deleted file mode 100644
index 8a8d04f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/identifier-non-ascii.txt
+++ /dev/null
@@ -1,19 +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.
- */
-Korean Keyboard

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/if.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/if.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/if.txt
deleted file mode 100644
index 7c9d1d8..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/if.txt
+++ /dev/null
@@ -1,104 +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.
- */
-
-- good
-- good
-- good
-- good
-
-- good
-- good
-
-- good
-- good
-- good
-- good
-
-- good
-- good
-- good
-- good
-
-- good
-- good
-- good
-- good
-
-- good
-- good
-
-- good
-- good
-- good
-- good
-
-- good
-- good
-- good
-- good
-
-- 1
-- 
-- 
-- is 1
-- isn't 2
-- isn't 3
-- Finally, it's: 1
-- 
-- 2
-- 
-- isn't 1
-- is 2
-- isn't 3
-- Finally, it's: 2
-- 
-- 
-- 3
-- isn't 1
-- isn't 2
-- is 3
-- Finally, it's: 3
-- 
-- 
-- 
-- isn't 1
-- isn't 2
-- isn't 3
-- Finally, it's: 4
-
-    1:
-      == 1
-    1:
-      <= 2
-    1:
-      <= 3
-    2:
-      > 1
-    2:
-      == 2
-    2:
-      <= 3
-    3:
-      > 1
-    3:
-      > 2
-    3:
-      == 3
-      End
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/import.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/import.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/import.txt
deleted file mode 100644
index b51a4f4..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/import.txt
+++ /dev/null
@@ -1,40 +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.
- */
---
---
-
-
-jsmith@acme.com
-  Test bar.
-  Email: jsmith@acme.com
-
-jsmith@acme.com
-  Test bar.
-  Email: jsmith@acme.com
-    Email in the root: jsmith@other1.com
-
-jsmith@other2.com
-  Test bar.
-  Email: jsmith@other2.com
-    Email in the root: jsmith@other1.com
-
-jsmith@other2.com
-jsmith@other3.com
-
-foobarfoobar
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include.txt
deleted file mode 100644
index c72d69c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include.txt
+++ /dev/null
@@ -1,67 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Include Instruction Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-Hello, world!
-
-	<p>Message exists!
-
-<p>Test normal includes:</p>
-<p>A test of included files:</p>
-
-	<p>Message exists!:<br />
-        Hello, world!</p>
-
- Can you see me? 
-
-assigning from included template
-I'm here, mon!
-
-Kilroy
- Can you see me? Kilroy
-
-<p>Test subdir includes:</p>
-<p>This is include-subdir.ftl</p>
-<p>Testing including from same directory</p>
-<p>This is include-subdir2.ftl</p>
-<p>Testing including from relative parent</p>
-<p>A test of included files:</p>
-
-	<p>Message exists!:<br />
-        Hello, world!</p>
-
- Can you see me? 
-<p>Testing including from loader root</p>
-<p>A test of included files:</p>
-
-	<p>Message exists!:<br />
-        Hello, world!</p>
-
- Can you see me? 
-<p>Testing including through acquisition</p>
-<p>This is include-subdir2.ftl</p>
-</body>
-</html>
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include2.txt
deleted file mode 100644
index b7c43a9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/include2.txt
+++ /dev/null
@@ -1,28 +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.
- */
-A próba
-A próba
-
-A próba
-A próba
-A próba
-A próba
-
-[]
-[]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/interpret.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/interpret.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/interpret.txt
deleted file mode 100644
index fe862e6..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/interpret.txt
+++ /dev/null
@@ -1,23 +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.
- */
-abcdef
-abcdef
-abcdef
-
-M
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/iterators.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/iterators.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/iterators.txt
deleted file mode 100644
index fb44def..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/iterators.txt
+++ /dev/null
@@ -1,84 +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.
- */
-<html>
-<head>
-<title>FreeMarker: List Iterator Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now iterate over a list:</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>Now iterate again:</p>
-
-<p>0. one</p>
-<p>1. two</p>
-<p>2. three</p>
-<p>3. four</p>
-<p>4. five</p>
-
-<p>Iterate over a list in a hash:</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-<p>one</p>
-<p>two</p>
-<p>three</p>
-<p>four</p>
-<p>five</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/lastcharacter.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/lastcharacter.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/lastcharacter.txt
deleted file mode 100644
index dbe5fd0..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/lastcharacter.txt
+++ /dev/null
@@ -1,31 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Last Character Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-  
-    13
-    
-    ELLO, WORLD!
-    
-    message: Hello, Worl

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list-bis.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list-bis.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list-bis.txt
deleted file mode 100644
index 3b9b76d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list-bis.txt
+++ /dev/null
@@ -1,51 +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.
- */
-    0: a [0:A, 1:B, 2:C]
-    1: b [0:A, 1:B, 2:C]
-    2: c [0:A, 1:B, 2:C]
-
-    0: a 0a/0A, 0a/1B, 0a/2C
-    1: b 1b/0A, 1b/1B, 1b/2C
-    2: c 2c/0A, 2c/1B, 2c/2C
-
-0:a, 1:b, 2:c
-1. a; 2. b; 3. c;
-
-a, b, c
-a, b, c
-
-A, b, c.
-
-true/false false/true true/false
-
-    <td class="oddRow">a</td>
-    <td class="evenRow">b</td>
-    <td class="oddRow">c</td>
-
-    <td class="rowOdd">a</td>
-    <td class="rowEven">b</td>
-    <td class="rowOdd">c</td>
-
-    <td class="R">a</td>
-    <td class="G">b</td>
-    <td class="B">c</td>
-    <td class="R">d</td>
-    <td class="G">e</td>
-    <td class="B">f</td>
-    <td class="R">g</td>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list.txt
deleted file mode 100644
index 05373bd..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list.txt
+++ /dev/null
@@ -1,51 +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.
- */
-Size: 4
-Items: @0 aardvark, @1 bear, @2 cat, @3 dog.
-
-Size: 1
-Items: @0 aardvark.
-
-Size: 0
-Items: 
-
-Size: 3
-Items: @0 11, @1 22, @2 33.
-
-Size: 3
-Items: @0 11, @1 22, @2 33.
-
-Size: 3
-Items: @0 11, @1 22, @2 33.
-
-Size: failed
-Items: @0 11, @1 22, @2 33.
-
-Size: 0
-Items: 
-
-Size: 0
-Items: 
-
-Size: 0
-Items: 
-
-Size: failed
-Items: 
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list2.txt
deleted file mode 100644
index cb9e6d4..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list2.txt
+++ /dev/null
@@ -1,211 +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.
- */
-=== [aardvark, bear, cat, dog] ===
-
--- List+sep:
-    aardvark,
-    bear,
-    cat,
-    dog
--- List+else:
-    aardvark
-    bear
-    cat
-    dog
--- List+items:
-    [
-        aardvark
-        bear
-        cat
-        dog
-    ]
--- List+items+else:
-    [
-        aardvark
-        bear
-        cat
-        dog
-    ]
--- List+items+sep+else:
-    [
-        aardvark,
-        bear,
-        cat,
-        dog
-    ]
---
-
-=== [aardvark] ===
-
--- List+sep:
-    aardvark
--- List+else:
-    aardvark
--- List+items:
-    [
-        aardvark
-    ]
--- List+items+else:
-    [
-        aardvark
-    ]
--- List+items+sep+else:
-    [
-        aardvark
-    ]
---
-
-=== [] ===
-
--- List+sep:
--- List+else:
-    Empty!
--- List+items:
--- List+items+else:
-    Empty!
--- List+items+sep+else:
-    Empty!
---
-
-=== [11, 22, 33] ===
-
--- List+sep:
-    11,
-    22,
-    33
--- List+else:
-    11
-    22
-    33
--- List+items:
-    [
-        11
-        22
-        33
-    ]
--- List+items+else:
-    [
-        11
-        22
-        33
-    ]
--- List+items+sep+else:
-    [
-        11,
-        22,
-        33
-    ]
---
-
-=== [11, 22, 33] ===
-
--- List+sep:
-    11,
-    22,
-    33
--- List+else:
-    11
-    22
-    33
--- List+items:
-    [
-        11
-        22
-        33
-    ]
--- List+items+else:
-    [
-        11
-        22
-        33
-    ]
--- List+items+sep+else:
-    [
-        11,
-        22,
-        33
-    ]
---
-
-=== [11, 22, 33] ===
-
--- List+sep:
-    11,
-    22,
-    33
--- List+else:
-    11
-    22
-    33
--- List+items:
-    [
-        11
-        22
-        33
-    ]
--- List+items+else:
-    [
-        11
-        22
-        33
-    ]
--- List+items+sep+else:
-    [
-        11,
-        22,
-        33
-    ]
---
-
-=== [] ===
-
--- List+sep:
--- List+else:
-    Empty!
--- List+items:
--- List+items+else:
-    Empty!
--- List+items+sep+else:
-    Empty!
---
-
-=== [] ===
-
--- List+sep:
--- List+else:
-    Empty!
--- List+items:
--- List+items+else:
-    Empty!
--- List+items+sep+else:
-    Empty!
---
-
-=== [] ===
-
--- List+sep:
--- List+else:
-    Empty!
--- List+items:
--- List+items+else:
-    Empty!
--- List+items+sep+else:
-    Empty!
---
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list3.txt
deleted file mode 100644
index 26fc60d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/list3.txt
+++ /dev/null
@@ -1,57 +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.
- */
-[
-    [(11@0, 11@0), (11@0, 22@1), (11@0, 33@2)],
-    [(22@1, 11@0), (22@1, 22@1), (22@1, 33@2)],
-    [(33@2, 11@0), (33@2, 22@1), (33@2, 33@2)]
-]
-
-
-        <p>2 hits:
-        <div class="hits">
-                        <div class="hit">a</div>
-                        <div class="hit">b</div>
-        </div>
-
-        <p>2 hits:
-        <div class="hits">
-                        <div class="hitOther">a</div>
-                        <div class="hitOther">b</div>
-        </div>
-
-        <p>2 hits:
-        <div class="hits">
-                    ...
-        </div>
-
-        <p>Nothing.
-
-11, 22, ...
-[11, 22, ...]
-
-1, 2, 3
-1 /*first*/, 2, 3
-[1, 2, 3]
-1
-1
-[1]
-Empty
-Empty
-Empty
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhash.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhash.txt
deleted file mode 100644
index e251238..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhash.txt
+++ /dev/null
@@ -1,157 +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.
- */
-
-Non-empty maps:
-
-    Map:
-    
-    [
-      k1 = v1
-      2 = v2
-      k3 = v3
-      null = v4
-      Y = v5
-      N = null
-    ]
-  
-    [
-      k1 = v1; // @0=@0; odd=odd; Y=Y
-      2 = v2; // @1=@1; even=even; Y=Y
-      k3 = v3; // @2=@2; odd=odd; Y=Y
-      null = v4; // @3=@3; even=even; Y=Y
-      Y = v5; // @4=@4; odd=odd; Y=Y
-      N = null // @5=@5; even=even; N=N
-    ]
-  
-    {
-      [
-        k1 = v1; // @0=@0; odd=odd; Y=Y
-        2 = v2; // @1=@1; even=even; Y=Y
-        k3 = v3; // @2=@2; odd=odd; Y=Y
-        null = v4; // @3=@3; even=even; Y=Y
-        Y = v5; // @4=@4; odd=odd; Y=Y
-        N = null // @5=@5; even=even; N=N
-      ]
-    }
-
-    Map:
-    
-    [
-      k1 = v1
-      2 = v2
-      k3 = v3
-      null = v4
-      Y = v5
-      N = null
-    ]
-  
-    [
-      k1 = v1; // @0=@0; odd=odd; Y=Y
-      2 = v2; // @1=@1; even=even; Y=Y
-      k3 = v3; // @2=@2; odd=odd; Y=Y
-      null = v4; // @3=@3; even=even; Y=Y
-      Y = v5; // @4=@4; odd=odd; Y=Y
-      N = null // @5=@5; even=even; N=N
-    ]
-  
-    {
-      [
-        k1 = v1; // @0=@0; odd=odd; Y=Y
-        2 = v2; // @1=@1; even=even; Y=Y
-        k3 = v3; // @2=@2; odd=odd; Y=Y
-        null = v4; // @3=@3; even=even; Y=Y
-        Y = v5; // @4=@4; odd=odd; Y=Y
-        N = null // @5=@5; even=even; N=N
-      ]
-    }
-
-    Map:
-    
-    [
-      k1 = 11
-      k2 = 22
-    ]
-  
-    [
-      k1 = 11; // @0=@0; odd=odd; Y=Y
-      k2 = 22 // @1=@1; even=even; N=N
-    ]
-  
-    {
-      [
-        k1 = 11; // @0=@0; odd=odd; Y=Y
-        k2 = 22 // @1=@1; even=even; N=N
-      ]
-    }
-
-
-Empty maps:
-
-    Map:
-    
-    [
-    ]
-  
-    [
-      Empty
-    ]
-  
-    {
-      Empty
-    }
-
-    Map:
-    
-    [
-    ]
-  
-    [
-      Empty
-    ]
-  
-    {
-      Empty
-    }
-
-    Map:
-    
-    [
-    ]
-  
-    [
-      Empty
-    ]
-  
-    {
-      Empty
-    }
-
-
-  a @ 0, 1
-    aa = 11  @ 0 // inside a @ 0, 1
-  a @ 0, 1
-  --
-  b @ 1, 2
-    ba = 21  @ 0 // inside b @ 1, 2
-    bb = 22  @ 1 // inside b @ 1, 2
-  b @ 1, 2
-  --
-  c @ 2, 0
-  c @ 2, 0
-  --

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
deleted file mode 100644
index 937f0ea..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
+++ /dev/null
@@ -1,36 +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.
- */
-  KVPs:
-    a = 3
-    b = 2
-  
-  Keys:
-    a
-    b
-  
-  Values:
-    3
-    2
-
-  KVPs:
-  
-  Keys:
-  
-  Values:
-



[13/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/varargs.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/varargs.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/varargs.txt
new file mode 100644
index 0000000..a310855
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/varargs.txt
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+0 == 0
+0 == 0
+11 == 11
+11 == 11
+1122 == 1122
+1122 == 1122
+112233 == 112233
+112233 == 112233
+
+-22334411 == -22334411
+-223311 == -223311
+-2211 == -2211
+-11 == -11
+
+0 == 0
+-11 == -11
+1122 == 1122
+-112233 == -112233
+-11223344 == -11223344
+-1122334455 == -1122334455
+
+1122 == 1122
+-1122 == -1122
+
+string, true, 123, 1000000 == string, true, 123, 1000000

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/variables.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/variables.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/variables.txt
new file mode 100644
index 0000000..5365b07
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/variables.txt
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+<html>
+<head>
+<title>FreeMarker: Variable Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>Hello, world!</p>
+
+<p>Now get into variable nesting:</p>
+
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+<p>My message.</p>
+
+<p>More deep nesting...</p>
+
+<p>My message.</p>
+<p>one</p>
+<p>one</p>
+
+
+<p>Nesting inside nesting...</p>
+
+<p>two</p>
+<p>two</p>
+<p>two</p>
+<p>two</p>
+
+<p>Test underscores...</p>
+
+<p>out</p>
+<p>out</p>
+
+SAVE
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/whitespace-trim.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/whitespace-trim.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/whitespace-trim.txt
new file mode 100644
index 0000000..e74163a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/whitespace-trim.txt
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+LB
+LB
+LB
+LB
+  IB
+  IC1  IC2C1C2  ICS CS1 CS2 C3C1C2
+B
+B
+C1CB
+C1
+C2  ICB
+  IC  ICB
+  ICCB
+--
+LB
+LB
+LB
+LB
+  IB
+  IC1  IC2C1C2  ICS CS1 CS2 C3C1C2
+B
+B
+C1CB
+C1
+C2  ICB
+  IC  ICB
+  ICCB
+--
+  IB
+  IC1C2  IB
+12
+---
+1 23
+  4
+  5  6
+---
+a
+bc
+---
+foo
+---
+foo

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstrip-in-header.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstrip-in-header.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstrip-in-header.txt
new file mode 100644
index 0000000..2cb2913
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstrip-in-header.txt
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+a
+
+b
+a
+b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstripping.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstripping.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstripping.txt
new file mode 100644
index 0000000..2aae297
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/wstripping.txt
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+a
+b
+c 
+d
+e2
+f
+g
+x
+  x
+    x
+  y
+y
+x
+y
+x
+y
+a
+  x
+b
+  x
+c
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-fragment.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-fragment.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-fragment.txt
new file mode 100644
index 0000000..cb0da5f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-fragment.txt
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+b = b
+@document = @document
+@document = @document
+
+C<>&"']]> = C<>&"']]>
+
+<root xmlns:n="http://x"><a><b><n:c>C&lt;>&amp;"']]&gt;</n:c></b></a></root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-ns_prefix-scope.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-ns_prefix-scope.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-ns_prefix-scope.txt
new file mode 100644
index 0000000..bf8e6bd
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml-ns_prefix-scope.txt
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+//e: e in NS namespace-test, e in NS namespace-test
+//n:e: e in NS foo, e in NS foo
+//bar:e: e in NS bar, e in NS bar
+
+Included:
+//n:e: e in NS foo, e in NS foo
+//n:e: e in NS foo, e in NS foo
+
+Imported:
+//n:e: e in NS bar, e in NS bar
+//n:e: e in NS bar, e in NS bar

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml.txt
new file mode 100644
index 0000000..718bba1
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xml.txt
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+  <?firstPi customKey="something"?>
+  firstPi
+  customKey="something"
+  <?secondPi secondPiData?>
+  secondPi
+  secondPiData
+2
+p
+ customKey="something"
+
+<ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text1</ns1:e11><ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text2</ns1:e11>
+<ns1:e12 xmlns:ns1="http://www.foo.com/ns1/"><![CDATA[cdata-section1]]></ns1:e12><ns1:e12 xmlns:ns1="http://www.foo.com/ns1/"><![CDATA[cdata-section2<&]]></ns1:e12>
+<ns1:e1 xmlns:ns1="http://www.foo.com/ns1/" a1="v1" a2="v2">
+    <ns1:e11>text1</ns1:e11>
+    <ns1:e12><![CDATA[cdata-section1]]></ns1:e12>
+  </ns1:e1>
+<ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text1</ns1:e11><ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text2</ns1:e11>
+a1
+v2
+rootroot
+root
+  root
+  e1
+  e11
+  e12
+  e2
+  e11
+  e12
+  root
+  root
+  e1
+  root
+  e1
+  e11
+  root
+  e1
+  e12
+  root
+  e2
+  root
+  e2
+  e11
+  root
+  e2
+  e12
+cdata-section2&lt;&amp;
+cdata-section2<&

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns1.txt
new file mode 100644
index 0000000..69af553
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns1.txt
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+<book xmlns="http://example.com/eBook">
+  <title>Test Book</title>
+  <chapter>
+    <title>Ch1</title>
+    <para>p1.1</para>
+    <para>p1.2</para>
+    <para>p1.3</para>
+  </chapter>
+  <chapter>
+    <title>Ch2</title>
+    <para>p2.1</para>
+    <para>p2.2</para>
+  </chapter>
+</book>
+
+  <html>
+    <head>
+      <title>Test Book</title>
+    </head>
+    <body>
+      <h1>Test Book</h1>
+
+  
+    <h2>Ch1</h2>
+
+    
+      <p>p1.1
+
+      <p>p1.2
+
+      <p>p1.3
+
+  
+    <h2>Ch2</h2>
+
+    
+      <p>p2.1
+
+      <p>p2.2
+
+  
+    </body>
+  </html>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns3.txt
new file mode 100644
index 0000000..f028f0a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns3.txt
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+  <html>
+    <head>
+      <title>Test Book</title>
+    </head>
+    <body>
+      <h1>Test Book</h1>
+
+  
+    <h2>Ch1</h2>
+
+    
+      <p>p1.1
+
+      <p>p1.2
+
+      <p>p1.3
+
+  
+    <h2>Ch2</h2>
+
+    
+      <p>p2.1
+
+      <p>p2.2
+
+  
+    </body>
+  </html>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns4.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns4.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns4.txt
new file mode 100644
index 0000000..f028f0a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns4.txt
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+  <html>
+    <head>
+      <title>Test Book</title>
+    </head>
+    <body>
+      <h1>Test Book</h1>
+
+  
+    <h2>Ch1</h2>
+
+    
+      <p>p1.1
+
+      <p>p1.2
+
+      <p>p1.3
+
+  
+    <h2>Ch2</h2>
+
+    
+      <p>p2.1
+
+      <p>p2.2
+
+  
+    </body>
+  </html>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns5.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns5.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns5.txt
new file mode 100644
index 0000000..6e42b09
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/xmlns5.txt
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+No NS = No NS
+x NS = x NS
+y NS = y NS
+x NS = x NS
+No NS = No NS
+- = -
+- = -
+- = -

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/BeansTestResources.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/BeansTestResources.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/BeansTestResources.properties
new file mode 100644
index 0000000..609e20b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/BeansTestResources.properties
@@ -0,0 +1,19 @@
+# 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.
+
+message=Message
+format={0,date,yyyy-MM-dd}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/defaultxmlns1.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/defaultxmlns1.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/defaultxmlns1.xml
new file mode 100644
index 0000000..ed289bb
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/defaultxmlns1.xml
@@ -0,0 +1,24 @@
+<!--
+  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.
+-->
+<root xmlns:x="http://x.com" xmlns:y="http://y.com">
+  <t1>No NS</t1>
+  <x:t2>x NS</x:t2>
+  <y:t3>y NS</y:t3>
+  <t4 xmlns="http://x.com">x NS</t4>
+</root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml-ns_prefix-scope.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml-ns_prefix-scope.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml-ns_prefix-scope.xml
new file mode 100644
index 0000000..934acac
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml-ns_prefix-scope.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<root xmlns="http://freemarker.org/test/namespace-test"
+    xmlns:foo="http://freemarker.org/test/foo"
+    xmlns:bar="http://freemarker.org/test/bar">
+  <e>e in NS namespace-test</e>
+  <foo:e>e in NS foo</foo:e>
+  <bar:e>e in NS bar</bar:e>
+</root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml.xml
new file mode 100644
index 0000000..abf7e96
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xml.xml
@@ -0,0 +1,31 @@
+<?xml version="1.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.
+-->
+<?firstPi customKey="something"?>
+<?secondPi secondPiData?>
+<ns1:root xmlns:ns1="http://www.foo.com/ns1/">
+  <ns1:e1 a1="v1" a2="v2">
+    <ns1:e11>text1</ns1:e11>
+    <ns1:e12><![CDATA[cdata-section1]]></ns1:e12>
+  </ns1:e1>
+  <ns1:e2>
+    <ns1:e11>text2</ns1:e11>
+    <ns1:e12><![CDATA[cdata-section2<&]]></ns1:e12>
+  </ns1:e2>
+</ns1:root>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlfragment.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlfragment.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlfragment.xml
new file mode 100644
index 0000000..b5578b6
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlfragment.xml
@@ -0,0 +1,19 @@
+<!--
+  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.
+-->
+<root><a><b><c xmlns="http://x">C&lt;&gt;&amp;"']]&gt;</c></b></a></root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns.xml
new file mode 100644
index 0000000..6f6453e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns.xml
@@ -0,0 +1,32 @@
+<!--
+  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.
+-->
+<book xmlns="http://example.com/eBook">
+  <title>Test Book</title>
+  <chapter>
+    <title>Ch1</title>
+    <para>p1.1</para>
+    <para>p1.2</para>
+    <para>p1.3</para>
+  </chapter>
+  <chapter>
+    <title>Ch2</title>
+    <para>p2.1</para>
+    <para>p2.2</para>
+  </chapter>
+</book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns2.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns2.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns2.xml
new file mode 100644
index 0000000..c8bfc9f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns2.xml
@@ -0,0 +1,32 @@
+<!--
+  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.
+-->
+<eb:book xmlns:eb="http://example.com/eBook">
+  <eb:title>Test Book</eb:title>
+  <eb:chapter>
+    <eb:title>Ch1</eb:title>
+    <eb:para>p1.1</eb:para>
+    <eb:para>p1.2</eb:para>
+    <eb:para>p1.3</eb:para>
+  </eb:chapter>
+  <eb:chapter>
+    <eb:title>Ch2</eb:title>
+    <eb:para>p2.1</eb:para>
+    <eb:para>p2.2</eb:para>
+  </eb:chapter>
+</eb:book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns3.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns3.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns3.xml
new file mode 100644
index 0000000..8502ead
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/models/xmlns3.xml
@@ -0,0 +1,32 @@
+<!--
+  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.
+-->
+<book xmlns:x="http://x" xmlns:y="http://y">
+  <x:title>Test Book</x:title>
+  <chapter>
+    <y:title>Ch1</y:title>
+    <para>p1.1</para>
+    <para>p1.2</para>
+    <para>p1.3</para>
+  </chapter>
+  <x:chapter>
+    <y:title>Ch2</y:title>
+    <x:para>p2.1</x:para>
+    <y:para>p2.2</y:para>
+  </x:chapter>
+</book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/api-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/api-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/api-builtins.ftl
new file mode 100644
index 0000000..5a9e2d7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/api-builtins.ftl
@@ -0,0 +1,40 @@
+<#--
+  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.
+-->
+<@assertEquals expected="b" actual=map?api.get(2?int) />
+<@assertEquals expected=2 actual=list?api.indexOf(3?int) />
+<@assert test=set?api.contains("b") />
+<@assert test=!set?api.contains("d") />
+
+<#assign dump = "">
+<#list map?api.entrySet() as entry>
+    <#assign dump = dump + entry.key + ": " + entry.value>
+    <#if entry_has_next>
+        <#assign dump = dump + ", ">
+    </#if>
+</#list>
+<@assertEquals expected="1: a, 2: b, 3: c" actual=dump />
+
+<@assert test=map?has_api />
+<@assert test=list?has_api />
+<@assert test=set?has_api />
+<@assert test=!s?has_api />
+<@assert test=!1?has_api />
+<@assert test=!""?has_api />
+<@assert test=!{}?has_api />
+<@assert test=!true?has_api />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/arithmetic.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/arithmetic.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/arithmetic.ftl
new file mode 100644
index 0000000..afd4c28
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/arithmetic.ftl
@@ -0,0 +1,50 @@
+[#ftl]
+[#--
+  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.
+--]
+<html>
+<head>
+<title>FreeMarker: Arithmetic Test</title>
+</head>
+<body>
+[#assign foo = 1234, bar = 23.77] 
+
+<p>A simple test follows:</p>
+
+<p>Perform a number assignment:</p>
+
+[#setting locale="en_US"][#assign x = 1.2345, y=2]
+
+#{ x+y ; m2M3}
+#{ y ; m2M3}
+#{ x/y ; m40M40}
+#{y/x}
+#{ y/x ; M4}
+
+<P>Display a number with at least 3 digits after the decimal point</P>
+
+#{foo ; m3}
+
+<p>Now use numbers in assignment</p>
+
+[#assign mynumber = foo + bar   [#-- a comment --] ]
+
+#{mynumber}
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/assignments.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/assignments.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/assignments.ftl
new file mode 100644
index 0000000..f9f546d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/assignments.ftl
@@ -0,0 +1,108 @@
+<#--
+  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.
+-->
+<#assign x = 1>
+<@assertEquals expected=1 actual=x />
+<#assign x = x + 1>
+<@assertEquals expected=2 actual=x />
+<#assign x += 1>
+<@assertEquals expected=3 actual=x />
+<#assign x /= 2>
+<@assertEquals expected=1.5 actual=x />
+<#assign x *= 2>
+<@assertEquals expected=3 actual=x />
+<#assign x %= 2>
+<@assertEquals expected=1 actual=x />
+<#assign x += x  x += x  x += x>
+<@assertEquals expected=8 actual=x />
+<#assign x += x, x += x, x += x>
+<@assertEquals expected=64 actual=x />
+<#assign x++>
+<@assertEquals expected=65 actual=x />
+<#assign x-->
+<@assertEquals expected=64 actual=x />
+<#assign x--, x--, x--, x++, x -= 60>
+<@assertEquals expected=2 actual=x />
+
+<#assign x = 'a'>
+<#assign x += 1>
+<@assertEquals expected='a1' actual=x />
+
+<#assign x = 1>
+<#assign x += 'a'>
+<@assertEquals expected='1a' actual=x />
+
+<#assign x = [11]>
+<#assign x += [22]>
+<@assertEquals expected=11 actual=x[0] />
+<@assertEquals expected=22 actual=x[1] />
+<@assertEquals expected=2 actual=x?size />
+
+<#assign x = { 'a': 11 }>
+<#assign x += { 'b': 22 }>
+<@assertEquals expected=11 actual=x.a />
+<@assertEquals expected=22 actual=x.b />
+<@assertEquals expected=2 actual=x?size />
+
+<#assign x = 1>
+<#global g = 11>
+<#global g -= x>
+<@assertEquals expected=10 actual=g />
+<#global g *= 2>
+<@assertEquals expected=20 actual=g />
+<#global g /= 2.5>
+<@assertEquals expected=8 actual=g />
+<#global g += 2>
+<@assertEquals expected=10 actual=g />
+<#global g++>
+<@assertEquals expected=11 actual=g />
+<#global g-->
+<@assertEquals expected=10 actual=g />
+
+<#macro m>
+    <#local v = x + g>
+    <@assertEquals expected=11 actual=v />
+    <#local v -= x>
+    <@assertEquals expected=10 actual=v />
+    <#local v *= 2>
+    <@assertEquals expected=20 actual=v />
+    <#local v /= 2.5>
+    <@assertEquals expected=8 actual=v />
+    <#local v += 2>
+    <@assertEquals expected=10 actual=v />
+    <#local v++>
+    <@assertEquals expected=11 actual=v />
+    <#local v-->
+    <@assertEquals expected=10 actual=v />
+</#macro>
+<@m />
+
+<#assign foo = 'a'>
+<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo -= 1></@>
+<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo++></@>
+<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo--></@>
+<#assign x = 1>
+<@assertFails messageRegexp=r"(?s).*expected.*number.*string.*'a'.*"><#assign x -= 'a'></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*-=.*"><#assign noSuchVar -= 1></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\+=.*"><#assign noSuchVar += 1></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\*=.*"><#assign noSuchVar *= 1></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*/=.*"><#assign noSuchVar /= 1></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*%=.*"><#assign noSuchVar %= 1></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\+\+.*"><#assign noSuchVar++></@>
+<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*--.*"><#assign noSuchVar--></@>
+<@assertFails messageRegexp=r'(?s).*assignment.*noSuchVar.*missing.*\+=.*"\$".*'><#assign $noSuchVar += 1></@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean-formatting.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean-formatting.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean-formatting.ftl
new file mode 100644
index 0000000..a521fe8
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean-formatting.ftl
@@ -0,0 +1,82 @@
+<#--
+  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.
+-->
+<#assign suppress>
+<@assertFails message="true,false">${true}</@>
+<@assertFails message="true,false">${false}</@>
+<@assertFails message="true,false">${"" + true}</@>
+<@assertFails message="true,false">${"" + false}</@>
+<@assertFails message="true,false">${true?upper_case}</@>
+<@assertFails message="true,false">${false?upper_case}</@>
+<@assertEquals expected="true" actual=true?string />
+<@assertEquals expected="false" actual=false?string />
+<@assertEquals expected="true" actual=true?c />
+<@assertEquals expected="false" actual=false?c />
+<@assertEquals expected="t" actual=true?string('t', 'f') />
+<@assertEquals expected="f" actual=false?string('t', 'f') />
+<#setting boolean_format = 'true,false'>
+<@assertFails message="true,false">${true}</@>
+
+<#setting boolean_format = 'ja,nein'>
+<@assertEquals expected="ja" actual="" + true />
+<@assertEquals expected="nein" actual="" + false />
+<@assertEquals expected="JA" actual=true?upper_case />
+<@assertEquals expected="NEIN" actual=false?upper_case />
+<@assertEquals expected="ja" actual=true?string />
+<@assertEquals expected="nein" actual=false?string />
+<@assertEquals expected="true" actual=true?c />
+<@assertEquals expected="false" actual=false?c />
+<@assertEquals expected="t" actual=true?string('t', 'f') />
+<@assertEquals expected="f" actual=false?string('t', 'f') />
+
+<#setting boolean_format = 'y,n'>
+<#assign x = false>
+<#assign n = 123><#assign m = { x: 'foo', n: 'bar' }><@assertEquals actual=m['n'] + m['123'] expected='foobar' />
+<@assertFails exception="UnexpectedTypeException">${m[false]}</@>
+<@assertFails message="can't compare">${x == 'false'}</@>
+<@assertFails message="can't compare">${x != 'false'}</@>
+<@assertFails message="can't convert">${booleanVsStringMethods.expectsString(x)}</@>
+<@assertEquals actual=booleanVsStringMethods.expectsString(booleanAndString) expected="theStringValue" />
+<@assertEquals actual=booleanVsStringMethods.expectsBoolean(x) expected=false />
+<@assertEquals actual=booleanVsStringMethods.expectsBoolean(booleanAndString) expected=true />
+<@assertEquals actual=booleanVsStringMethods.overloaded(x) expected="boolean false" />
+<@assertEquals actual=123?upper_case expected="123" />
+<@assertEquals actual=true?upper_case expected="Y" />
+
+</#assign>
+<#escape x as x?upper_case>
+<#assign x = true>${x} ${true} ${true?string}
+<#assign x = false>${x} ${false} ${false?string}
+<#noescape><#assign x = true>${x} ${true} ${true?string}</#noescape>
+</#escape>
+<#assign x = false>${x} ${false} ${false?string}
+<#assign x = true>${x} ${true} ${true?string}
+<#assign x = false>${x} ${false} ${false?string}
+${'str:' + x} ${'str:' + false}
+${x?string('ja', 'nein')} ${true?string('ja', 'nein')}
+${booleanAndString} ${booleanAndString?string}
+
+<#setting boolean_format = 'y,n'>
+<@assertEquals actual='true'?boolean expected=true />
+<@assertEquals actual='false'?boolean expected=false />
+<@assertEquals actual='y'?boolean expected=true />
+<@assertEquals actual='n'?boolean expected=false />
+<@assertFails message="can't convert">${'N'?boolean}</@>
+<@assertFails message="can't convert">${'True'?boolean}</@>
+<@assertFails message="can't convert">${0?boolean}</@>
+<@assertFails message="sequence">${[]?boolean}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl
new file mode 100644
index 0000000..ab11c64
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl
@@ -0,0 +1,142 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Boolean Values Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<#assign b=true>
+
+<p>Now perform scalar boolean tests:</p>
+
+<p><#if b>
+    b is true.<br />
+<#else>
+    b is false.<br />
+</#if></p>
+
+<p><#if false>
+    This can't be!<br />
+<#else>
+    This makes sense.<br />
+</#if></p>
+
+<p><#if boolean3>
+    boolean3 succeeded.<br />
+<#else>
+    boolean3 failed.<br />
+</#if></p>
+
+<p><#if boolean4>
+    boolean4 succeeded.<br />
+<#else>
+    boolean4 failed.<br />
+</#if></p>
+
+<p><#if boolean4 || boolean5>
+    boolean4 || boolean5 succeeded.<br />
+<#else>
+    boolean4 || boolean5 failed.<br />
+</#if></p>
+
+<p><#if boolean5 || boolean4 || boolean5>
+    boolean5 || boolean4 || boolean5 succeeded.<br />
+<#else>
+    boolean5 || boolean4 || boolean5 failed.<br />
+</#if></p>
+
+<p><#if boolean4 && boolean5>
+    boolean4 && boolean5 succeeded.<br />
+<#else>
+    boolean4 && boolean5 failed.<br />
+</#if></p>
+ 
+<p>Now test list models:</p>
+
+<p><#if list1?exists>
+    list1 succeeded.<br />
+<#else>
+    list1 failed.<br />
+</#if></p>
+
+<p><#if list2?exists>
+    list2 succeeded.<br />
+<#else>
+    list2 failed.<br />
+</#if></p>
+
+<p>Test hash models:</p>
+
+<p><#if hash1?exists>
+    hash1 succeeded: ${hash1.temp}<br />
+<#else>
+    hash1 failed: ${hash1.temp}<br />
+</#if></p>
+
+<p><#if hash2?exists>
+    hash2 succeeded.<br />
+<#else>
+    hash2 failed.<br />
+</#if></p>
+
+<p>Test not operator:</p>
+
+<p><#if ! boolean1>
+   Not boolean1 succeeded
+<#else>
+   Not boolean1 failed
+</#if></p>
+
+<p><#if !boolean1>
+   Not boolean1 succeeded
+<#else>
+   Not boolean1 failed
+</#if></p>
+
+<p><#if ! boolean2>
+   Not boolean2 succeeded
+<#else>
+   Not boolean2 failed
+</#if></p>
+
+<p><#if !boolean2>
+   Not boolean2 succeeded
+<#else>
+   Not boolean2 failed
+</#if></p>
+
+<p><#if message == "Hello, world!">
+   Message is "Hello, world!"
+<#else>
+   Message is something else (${message})
+</#if></p>
+
+<p><#if message != "Hello, world!">
+   Message is not "Hello, world!" -- it's ${message}
+<#else>
+   Message is "Hello, world!"
+</#if></p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl
new file mode 100644
index 0000000..638f4b9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl
@@ -0,0 +1,27 @@
+<#ftl encoding="ISO-8859-2">
+<#--
+  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.
+-->
+<head>
+  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+����
+<#include "charset-in-header_inc1.ftl">
+<#include "charset-in-header_inc2.ftl">
+</body>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl
new file mode 100644
index 0000000..b8dc608
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl
@@ -0,0 +1,20 @@
+<#ftl encoding="ISO-8859-1">
+<#--
+  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.
+-->
+����

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl
new file mode 100644
index 0000000..66100ec
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+őŐűŰ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl
new file mode 100644
index 0000000..9c47168
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl
@@ -0,0 +1,50 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Comment Test</title>
+</head>
+<body>
+<#--
+
+A simple test follows:
+
+${message}
+
+A more rigorous test, showing that we're not faking it:
+
+${message@#$%&}
+
+--><#-- > --><#-- -> --><#-- -- --><#-- -- > -->
+<#if message?exists>
+	<p>Message exists!
+	<#--
+		...and even generates output!
+	-->
+	</p>
+</#if>
+
+a <#-- < --> b
+a <#-- </#noparse> - -- --> b
+
+${1 + 2 + [#-- c --] <#-- c --> <!-- c --> 3}
+${<!-- > -> -- #> #] --> 7}
+${<#-- glitch... --] 8}
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl
new file mode 100644
index 0000000..a711d4d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl
@@ -0,0 +1,218 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Numeric Operations Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Start with the increment operator:</p>
+<#assign a1 = 0>
+<p>a1 = ${a1}</p>
+<#assign a1 = a1 + 1>
+<p>a1 = ${a1}</p>
+<#assign a1 = a1 + 1>
+<p>a1 = ${a1}</p>
+
+<p>Now the decrement operator:</p>
+<#assign a2 = 5>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+<p>a2 = ${a2}</p>
+<#assign a2 = a2 - 1>
+
+<p>Now the add operator:</p>
+<#assign op1 = 5>
+<#assign op2 = 3>
+<#assign op3 = op1 + op2>
+<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p>
+<#assign op3 = op3 + op2>
+<p>op3 = ${op3}</p>
+
+<p>And the subtract operator:</p>
+<#assign op3 = op1 - op2 >
+<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p>
+<#assign op3 = op3 - op2 >
+<p>op3 = ${op3}</p>
+
+<p>The comparison operators:</p>
+<#assign list1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]>
+<#list list1 as item>
+   <p>Item is: ${item}</p>
+   <#if item lt 5>
+   <p>Item is less than five.</p>
+   </#if>
+   <#if item <= 7>
+   <p>Item is less than or equals to seven.</p>
+   </#if>
+   <#if item gt 2>
+   <p>Item is greater than two.</p>
+   </#if>
+   <#if (item >= 10)>
+   <p>Item is greater than or equal to ten.</p>
+   </#if>
+</#list>
+
+<#-- Signum-based optimization test, all 9 permutations: -->
+<#-- 1 -->
+<@assert test= !(0 != 0) />
+<@assert test= (0 == 0) />
+<@assert test= !(0 > 0) />
+<@assert test= (0 >= 0) />
+<@assert test= !(0 < 0) />
+<@assert test= (0 <= 0) />
+<#-- 2 -->
+<@assert test= !(3 != 3) />
+<@assert test= (3 == 3) />
+<@assert test= !(3 > 3) />
+<@assert test= (3 >= 3) />
+<@assert test= !(3 < 3) />
+<@assert test= (3 <= 3) />
+<#-- 3 -->
+<@assert test= !(-3 != -3) />
+<@assert test= (-3 == -3) />
+<@assert test= !(-3 > -3) />
+<@assert test= (-3 >= -3) />
+<@assert test= !(-3 < -3) />
+<@assert test= (-3 <= -3) />
+<#-- 4 -->
+<@assert test= (3 != 0) />
+<@assert test= !(3 == 0) />
+<@assert test= (3 > 0) />
+<@assert test= (3 >= 0) />
+<@assert test= !(3 < 0) />
+<@assert test= !(3 <= 0) />
+<#-- 5 -->
+<@assert test= (0 != 3) />
+<@assert test= !(0 == 3) />
+<@assert test= !(0 > 3) />
+<@assert test= !(0 >= 3) />
+<@assert test= (0 < 3) />
+<@assert test= (0 <= 3) />
+<#-- 6 -->
+<@assert test= (-3 != 0) />
+<@assert test= !(-3 == 0) />
+<@assert test= !(-3 > 0) />
+<@assert test= !(-3 >= 0) />
+<@assert test= (-3 < 0) />
+<@assert test= (-3 <= 0) />
+<#-- 7 -->
+<@assert test= (0 != -3) />
+<@assert test= !(0 == -3) />
+<@assert test= (0 > -3) />
+<@assert test= (0 >= -3) />
+<@assert test= !(0 < -3) />
+<@assert test= !(0 <= -3) />
+<#-- 8 -->
+<@assert test= (-3 != 3) />
+<@assert test= !(-3 == 3) />
+<@assert test= !(-3 > 3) />
+<@assert test= !(-3 >= 3) />
+<@assert test= (-3 < 3) />
+<@assert test= (-3 <= 3) />
+<#-- 9 -->
+<@assert test= (3 != -3) />
+<@assert test= !(3 == -3) />
+<@assert test= (3 > -3) />
+<@assert test= (3 >= -3) />
+<@assert test= !(3 < -3) />
+<@assert test= !(3 <= -3) />
+<#-- Again, now on runtime: -->
+<#assign m3 = -3>
+<#assign p3 = 3>
+<#assign z = 0>
+<#-- 1 -->
+<@assert test= !(z != z) />
+<@assert test= (z == z) />
+<@assert test= !(z > z) />
+<@assert test= (z >= z) />
+<@assert test= !(z < z) />
+<@assert test= (z <= z) />
+<#-- 2 -->
+<@assert test= !(p3 != p3) />
+<@assert test= (p3 == p3) />
+<@assert test= !(p3 > p3) />
+<@assert test= (p3 >= p3) />
+<@assert test= !(p3 < p3) />
+<@assert test= (p3 <= p3) />
+<#-- 3 -->
+<@assert test= !(m3 != m3) />
+<@assert test= (m3 == m3) />
+<@assert test= !(m3 > m3) />
+<@assert test= (m3 >= m3) />
+<@assert test= !(m3 < m3) />
+<@assert test= (m3 <= m3) />
+<#-- 4 -->
+<@assert test= (p3 != z) />
+<@assert test= !(p3 == z) />
+<@assert test= (p3 > z) />
+<@assert test= (p3 >= z) />
+<@assert test= !(p3 < z) />
+<@assert test= !(p3 <= z) />
+<#-- 5 -->
+<@assert test= (z != p3) />
+<@assert test= !(z == p3) />
+<@assert test= !(z > p3) />
+<@assert test= !(z >= p3) />
+<@assert test= (z < p3) />
+<@assert test= (z <= p3) />
+<#-- 6 -->
+<@assert test= (m3 != z) />
+<@assert test= !(m3 == z) />
+<@assert test= !(m3 > z) />
+<@assert test= !(m3 >= z) />
+<@assert test= (m3 < z) />
+<@assert test= (m3 <= z) />
+<#-- 7 -->
+<@assert test= (z != m3) />
+<@assert test= !(z == m3) />
+<@assert test= (z > m3) />
+<@assert test= (z >= m3) />
+<@assert test= !(z < m3) />
+<@assert test= !(z <= m3) />
+<#-- 8 -->
+<@assert test= (m3 != p3) />
+<@assert test= !(m3 == p3) />
+<@assert test= !(m3 > p3) />
+<@assert test= !(m3 >= p3) />
+<@assert test= (m3 < p3) />
+<@assert test= (m3 <= p3) />
+<#-- 9 -->
+<@assert test= (p3 != m3) />
+<@assert test= !(p3 == m3) />
+<@assert test= (p3 > m3) />
+<@assert test= (p3 >= m3) />
+<@assert test= !(p3 < m3) />
+<@assert test= !(p3 <= m3) />
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl
new file mode 100644
index 0000000..faf4ad6
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl
@@ -0,0 +1,59 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Compress Test</title>
+</head>
+<body>
+
+<#assign utility={'standardCompress': "org.apache.freemarker.core.util.StandardCompress"?new()}>
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<#compress>
+
+  <p>This is the same message,  using the &quot;compress&quot; tag:</p>
+
+
+<p>${message}</p>
+</#compress>
+
+<@utility.standardCompress buffer_size=8>
+
+  <p>This is the same message,  using the &quot;StandardCompress&quot; transform model:</p>
+
+
+<p>${message}</p>
+</@>
+
+<@utility.standardCompress single_line=true>
+
+<p>This 
+   multi-line message 
+     should 
+be compressed 
+   to a single line.</p></@>
+
+<p>An example where the first character is not whitespace but the second character is:</p>
+<p><#compress>x y</#compress></p>
+
+<p>The end.</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl
new file mode 100644
index 0000000..f05654b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<#setting time_zone = "UTC">
+
+<@assert test=unknown?is_unknown_date_like />
+<@assert test=!timeOnly?is_unknown_date_like />
+<@assert test=!dateOnly?is_unknown_date_like />
+<@assert test=!dateTime?is_unknown_date_like />
+
+<@assert test=!unknown?is_date_only />
+<@assert test=!timeOnly?is_date_only />
+<@assert test=dateOnly?is_date_only />
+<@assert test=!dateTime?is_date_only />
+
+<@assert test=!unknown?is_time />
+<@assert test=timeOnly?is_time />
+<@assert test=!dateOnly?is_time />
+<@assert test=!dateTime?is_time />
+
+<@assert test=!unknown?is_datetime />
+<@assert test=!timeOnly?is_datetime />
+<@assert test=!dateOnly?is_datetime />
+<@assert test=dateTime?is_datetime />
+
+<@assertFails message="isn't known if">${unknown?string.xs}</@>
+<@assertEquals expected="2003-04-05T06:07:08Z" actual=unknown?datetime_if_unknown?string.xs />
+<@assertEquals expected="2003-04-05Z" actual=unknown?date_if_unknown?string.xs />
+<@assertEquals expected="06:07:08Z" actual=unknown?time_if_unknown?string.xs />
+<@assertEquals expected="2003-04-05T06:07:08Z" actual=dateTime?date_if_unknown?string.xs />
+<@assertEquals expected="2003-04-05" actual=dateOnly?time_if_unknown?string.xs />
+<@assertEquals expected="06:07:08" actual=timeOnly?date_if_unknown?string.xs />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl
new file mode 100644
index 0000000..85fb028
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl
@@ -0,0 +1,163 @@
+<#--
+  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.
+-->
+<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
+<#setting time_zone="GMT+02">
+<@assertEquals actual=d?iso_utc expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso_utc_ms expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?iso_utc_m expected="2010-05-15T20:38Z" />
+<@assertEquals actual=d?iso_utc_h expected="2010-05-15T20Z" />
+<@assertEquals actual=d?iso_utc_nz expected="2010-05-15T20:38:05" />
+<@assertEquals actual=d?iso_utc_ms_nz expected="2010-05-15T20:38:05.023" />
+<@assertEquals actual=d?iso_utc_m_nz expected="2010-05-15T20:38" />
+<@assertEquals actual=d?iso_utc_h_nz expected="2010-05-15T20" />
+<@assertEquals actual=d?iso_local expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso_local_ms expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?iso_local_m expected="2010-05-15T22:38+02:00" />
+<@assertEquals actual=d?iso_local_h expected="2010-05-15T22+02:00" />
+<@assertEquals actual=d?iso_local_nz expected="2010-05-15T22:38:05" />
+<@assertEquals actual=d?iso_local_ms_nz expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?iso_local_m_nz expected="2010-05-15T22:38" />
+<@assertEquals actual=d?iso_local_h_nz expected="2010-05-15T22" />
+
+<@assertEquals actual=d?date?iso_utc expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_ms expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_m expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_h expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_ms_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_m_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_h_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_ms expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_m expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_h expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_ms_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_m_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_h_nz expected="2010-05-15" />
+
+<@assertEquals actual=d?time?iso_utc expected="20:38:05Z" />
+<@assertEquals actual=d?time?iso_utc_ms expected="20:38:05.023Z" />
+<@assertEquals actual=d?time?iso_utc_m expected="20:38Z" />
+<@assertEquals actual=d?time?iso_utc_h expected="20Z" />
+<@assertEquals actual=d?time?iso_utc_nz expected="20:38:05" />
+<@assertEquals actual=d?time?iso_utc_ms_nz expected="20:38:05.023" />
+<@assertEquals actual=d?time?iso_utc_m_nz expected="20:38" />
+<@assertEquals actual=d?time?iso_utc_h_nz expected="20" />
+<@assertEquals actual=d?time?iso_local expected="22:38:05+02:00" />
+<@assertEquals actual=d?time?iso_local_ms expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?iso_local_m expected="22:38+02:00" />
+<@assertEquals actual=d?time?iso_local_h expected="22+02:00" />
+<@assertEquals actual=d?time?iso_local_nz expected="22:38:05" />
+<@assertEquals actual=d?time?iso_local_ms_nz expected="22:38:05.023" />
+<@assertEquals actual=d?time?iso_local_m_nz expected="22:38" />
+<@assertEquals actual=d?time?iso_local_h_nz expected="22" />
+
+<#assign dStrange = "600-01-01 23:59:59:123 +0000"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
+<@assertEquals actual=dStrange?iso_utc_ms expected="0600-01-03T23:59:59.123Z" />
+
+<#-- java.sql treatment -->
+<@assertEquals actual=sqlDate?iso_local expected="2010-05-15" />
+<@assertEquals actual=sqlDate?iso_local_nz expected="2010-05-15" />
+<@assertEquals actual=sqlTime?iso_local_nz expected="22:38:05" />
+<@assertEquals actual=sqlTime?iso_utc_nz expected="20:38:05" />
+
+<#setting time_zone="GMT+03"> <#-- should not mater -->
+<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso_ms("UTC") expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?iso_m("UTC") expected="2010-05-15T20:38Z" />
+<@assertEquals actual=d?iso_h("UTC") expected="2010-05-15T20Z" />
+<@assertEquals actual=d?iso_nz("UTC") expected="2010-05-15T20:38:05" />
+<@assertEquals actual=d?iso_ms_nz("UTC") expected="2010-05-15T20:38:05.023" />
+<@assertEquals actual=d?iso_m_nz("UTC") expected="2010-05-15T20:38" />
+<@assertEquals actual=d?iso_h_nz("UTC") expected="2010-05-15T20" />
+<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso_ms("GMT+02") expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?iso_m("GMT+02") expected="2010-05-15T22:38+02:00" />
+<@assertEquals actual=d?iso_h("GMT+02") expected="2010-05-15T22+02:00" />
+<@assertEquals actual=d?iso_nz("GMT+02") expected="2010-05-15T22:38:05" />
+<@assertEquals actual=d?iso_ms_nz("GMT+02") expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?iso_m_nz("GMT+02") expected="2010-05-15T22:38" />
+<@assertEquals actual=d?iso_h_nz("GMT+02") expected="2010-05-15T22" />
+
+<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h_nz("GMT+02") expected="2010-05-15" />
+
+<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" />
+<@assertEquals actual=d?time?iso_ms("UTC") expected="20:38:05.023Z" />
+<@assertEquals actual=d?time?iso_m("UTC") expected="20:38Z" />
+<@assertEquals actual=d?time?iso_h("UTC") expected="20Z" />
+<@assertEquals actual=d?time?iso_nz("UTC") expected="20:38:05" />
+<@assertEquals actual=d?time?iso_ms_nz("UTC") expected="20:38:05.023" />
+<@assertEquals actual=d?time?iso_m_nz("UTC") expected="20:38" />
+<@assertEquals actual=d?time?iso_h_nz("UTC") expected="20" />
+<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" />
+<@assertEquals actual=d?time?iso_ms("GMT+02") expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?iso_m("GMT+02") expected="22:38+02:00" />
+<@assertEquals actual=d?time?iso_h("GMT+02") expected="22+02:00" />
+<@assertEquals actual=d?time?iso_nz("GMT+02") expected="22:38:05" />
+<@assertEquals actual=d?time?iso_ms_nz("GMT+02") expected="22:38:05.023" />
+<@assertEquals actual=d?time?iso_m_nz("GMT+02") expected="22:38" />
+<@assertEquals actual=d?time?iso_h_nz("GMT+02") expected="22" />
+
+<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso(adaptedToStringScalar) expected="2010-05-15T22:38:05+02:00" />
+
+<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.001Z" />
+<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.01Z" />
+<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.1Z" />
+<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00Z" />
+
+<#setting time_zone="GMT+02">
+<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
+<@assertEquals actual=d?iso_local expected="2010-05-15" />
+<@assertEquals actual=d?iso_utc expected="2010-05-14" />
+
+<#setting time_zone="GMT+02:30">
+<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
+<@assertEquals actual=d?iso_local expected="2010-05-15T00:00:00+02:30" />
+
+<#setting time_zone="America/New_York">
+<@assertEquals actual="2010-05-09 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-05-09T16:00:00-04:00" />
+<@assertEquals actual="2010-01-01 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-01-01T15:00:00-05:00" />
+
+<@assertFails>${d?iso("no such zone")}</@>
+
+<#setting time_zone="GMT+02">
+<@assertEquals actual=sqlTime?iso_local expected="22:38:05" />
+<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" />


[19/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.


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

Branch: refs/heads/3
Commit: 4b75ea930f8b4894298c19e60915950ce4443995
Parents: bb9acc9
Author: ddekany <dd...@apache.org>
Authored: Tue May 16 11:21:14 2017 +0200
Committer: ddekany <dd...@apache.org>
Committed: Tue May 16 18:08:45 2017 +0200

----------------------------------------------------------------------
 build.gradle                                    |    2 +-
 freemarker-core-test/build.gradle               |    7 +
 .../apache/freemarker/core/ListErrorsTest.java  |    2 +-
 .../core/NewBiObjectWrapperRestrictionTest.java |    4 +-
 .../templatesuite/CoreTemplateTestSuite.java    |  282 +++++
 .../templatesuite/models/AllTemplateModels.java |  128 ++
 .../templatesuite/models/BeanTestClass.java     |   93 ++
 .../templatesuite/models/BeanTestInterface.java |   25 +
 .../models/BeanTestSuperclass.java              |   30 +
 .../models/BooleanAndScalarModel.java           |   40 +
 .../models/BooleanAndStringTemplateModel.java   |   38 +
 .../core/templatesuite/models/BooleanHash1.java |   58 +
 .../core/templatesuite/models/BooleanHash2.java |   50 +
 .../core/templatesuite/models/BooleanList1.java |   62 +
 .../core/templatesuite/models/BooleanList2.java |   53 +
 .../models/BooleanVsStringMethods.java          |   40 +
 .../templatesuite/models/EnumTestClass.java     |   34 +
 .../templatesuite/models/ExceptionModel.java    |   39 +
 .../models/HashAndScalarModel.java              |   84 ++
 .../templatesuite/models/JavaObjectInfo.java    |   35 +
 .../core/templatesuite/models/Listables.java    |  185 +++
 .../core/templatesuite/models/MultiModel1.java  |  116 ++
 .../core/templatesuite/models/MultiModel2.java  |   63 +
 .../core/templatesuite/models/MultiModel3.java  |   69 ++
 .../core/templatesuite/models/MultiModel4.java  |   77 ++
 .../core/templatesuite/models/MultiModel5.java  |   81 ++
 .../core/templatesuite/models/NewTestModel.java |   52 +
 .../templatesuite/models/NewTestModel2.java     |   52 +
 .../models/NumberAndStringModel.java            |   47 +
 .../models/OverloadedConstructor.java           |   46 +
 .../templatesuite/models/OverloadedMethods.java |  191 +++
 .../models/OverloadedMethods2.java              | 1110 ++++++++++++++++++
 .../SimpleMapAndCollectionObjectWrapper.java    |   60 +
 .../templatesuite/models/SimpleTestMethod.java  |   49 +
 .../core/templatesuite/models/TestBean.java     |   17 +
 .../core/templatesuite/models/TestBoolean.java  |   16 +
 .../core/templatesuite/models/TestMethod.java   |   12 +
 .../core/templatesuite/models/TestNode.java     |   32 +
 .../models/TransformHashWrapper.java            |   79 ++
 .../models/TransformMethodWrapper1.java         |   49 +
 .../models/TransformMethodWrapper2.java         |   64 +
 .../templatesuite/models/TransformModel1.java   |  175 +++
 .../templatesuite/models/VarArgTestModel.java   |   63 +
 .../test/templatesuite/TemplateTestCase.java    |  515 --------
 .../test/templatesuite/TemplateTestSuite.java   |  298 -----
 .../templatesuite/models/AllTemplateModels.java |  128 --
 .../templatesuite/models/BeanTestClass.java     |   93 --
 .../templatesuite/models/BeanTestInterface.java |   25 -
 .../models/BeanTestSuperclass.java              |   30 -
 .../models/BooleanAndScalarModel.java           |   40 -
 .../models/BooleanAndStringTemplateModel.java   |   38 -
 .../test/templatesuite/models/BooleanHash1.java |   58 -
 .../test/templatesuite/models/BooleanHash2.java |   50 -
 .../test/templatesuite/models/BooleanList1.java |   62 -
 .../test/templatesuite/models/BooleanList2.java |   53 -
 .../models/BooleanVsStringMethods.java          |   40 -
 .../templatesuite/models/EnumTestClass.java     |   34 -
 .../templatesuite/models/ExceptionModel.java    |   39 -
 .../models/HashAndScalarModel.java              |   84 --
 .../templatesuite/models/JavaObjectInfo.java    |   35 -
 .../test/templatesuite/models/Listables.java    |  185 ---
 .../test/templatesuite/models/MultiModel1.java  |  116 --
 .../test/templatesuite/models/MultiModel2.java  |   63 -
 .../test/templatesuite/models/MultiModel3.java  |   69 --
 .../test/templatesuite/models/MultiModel4.java  |   77 --
 .../test/templatesuite/models/MultiModel5.java  |   81 --
 .../test/templatesuite/models/NewTestModel.java |   52 -
 .../templatesuite/models/NewTestModel2.java     |   52 -
 .../models/NumberAndStringModel.java            |   47 -
 .../models/OverloadedConstructor.java           |   46 -
 .../templatesuite/models/OverloadedMethods.java |  191 ---
 .../models/OverloadedMethods2.java              | 1110 ------------------
 .../SimpleMapAndCollectionObjectWrapper.java    |   60 -
 .../templatesuite/models/SimpleTestMethod.java  |   49 -
 .../models/TransformHashWrapper.java            |   79 --
 .../models/TransformMethodWrapper1.java         |   49 -
 .../models/TransformMethodWrapper2.java         |   64 -
 .../templatesuite/models/TransformModel1.java   |  175 ---
 .../templatesuite/models/VarArgTestModel.java   |   63 -
 .../freemarker/test/templatesuite/package.html  |   42 -
 .../core/templatesuite/expected/arithmetic.txt  |   46 +
 .../expected/boolean-formatting.txt             |   31 +
 .../core/templatesuite/expected/boolean.txt     |  102 ++
 .../expected/charset-in-header.txt              |   26 +
 .../core/templatesuite/expected/comment.txt     |   34 +
 .../core/templatesuite/expected/comparisons.txt |   93 ++
 .../core/templatesuite/expected/compress.txt    |   40 +
 .../templatesuite/expected/dateformat-java.txt  |   55 +
 .../expected/default-object-wrapper.txt         |   55 +
 .../templatesuite/expected/default-xmlns.txt    |   25 +
 .../core/templatesuite/expected/default.txt     |   26 +
 .../expected/encoding-builtins.txt              |   44 +
 .../core/templatesuite/expected/escapes.txt     |   49 +
 .../core/templatesuite/expected/exception.txt   |   43 +
 .../core/templatesuite/expected/exception2.txt  |   47 +
 .../core/templatesuite/expected/exception3.txt  |   21 +
 .../core/templatesuite/expected/exthash.txt     |   76 ++
 .../core/templatesuite/expected/hashconcat.txt  |  138 +++
 .../core/templatesuite/expected/hashliteral.txt |   74 ++
 .../core/templatesuite/expected/helloworld.txt  |   31 +
 .../expected/identifier-escaping.txt            |   57 +
 .../expected/identifier-non-ascii.txt           |   19 +
 .../core/templatesuite/expected/if.txt          |  104 ++
 .../core/templatesuite/expected/import.txt      |   40 +
 .../core/templatesuite/expected/include.txt     |   67 ++
 .../core/templatesuite/expected/include2.txt    |   28 +
 .../core/templatesuite/expected/interpret.txt   |   23 +
 .../core/templatesuite/expected/iterators.txt   |   84 ++
 .../templatesuite/expected/lastcharacter.txt    |   31 +
 .../core/templatesuite/expected/list-bis.txt    |   51 +
 .../core/templatesuite/expected/list.txt        |   51 +
 .../core/templatesuite/expected/list2.txt       |  211 ++++
 .../core/templatesuite/expected/list3.txt       |   57 +
 .../core/templatesuite/expected/listhash.txt    |  157 +++
 .../templatesuite/expected/listhashliteral.txt  |   36 +
 .../core/templatesuite/expected/listliteral.txt |   75 ++
 .../templatesuite/expected/localization.txt     |   32 +
 .../core/templatesuite/expected/logging.txt     |   27 +
 .../templatesuite/expected/loopvariable.txt     |   54 +
 .../templatesuite/expected/macros-return.txt    |   23 +
 .../core/templatesuite/expected/macros.txt      |   67 ++
 .../core/templatesuite/expected/macros2.txt     |   22 +
 .../core/templatesuite/expected/multimodels.txt |   93 ++
 .../core/templatesuite/expected/nested.txt      |   25 +
 .../expected/new-allowsnothing.txt              |   19 +
 .../expected/new-defaultresolver.txt            |   19 +
 .../core/templatesuite/expected/new-optin.txt   |   32 +
 .../core/templatesuite/expected/newlines1.txt   |   29 +
 .../core/templatesuite/expected/newlines2.txt   |   30 +
 .../core/templatesuite/expected/noparse.txt     |   54 +
 .../templatesuite/expected/number-format.txt    |   33 +
 .../templatesuite/expected/number-literal.txt   |   79 ++
 .../templatesuite/expected/number-to-date.txt   |   31 +
 .../templatesuite/expected/numerical-cast.txt   |  462 ++++++++
 .../templatesuite/expected/output-encoding1.txt |   27 +
 .../templatesuite/expected/output-encoding2.txt |  Bin 0 -> 1972 bytes
 .../templatesuite/expected/output-encoding3.txt |   26 +
 .../core/templatesuite/expected/precedence.txt  |   48 +
 .../core/templatesuite/expected/recover.txt     |   26 +
 .../core/templatesuite/expected/root.txt        |   44 +
 .../expected/sequence-builtins.txt              |  404 +++++++
 .../core/templatesuite/expected/specialvars.txt |   25 +
 .../string-builtins-regexps-matches.txt         |   99 ++
 .../expected/string-builtins-regexps.txt        |  112 ++
 .../templatesuite/expected/string-builtins1.txt |  112 ++
 .../templatesuite/expected/string-builtins2.txt |  135 +++
 .../templatesuite/expected/stringbimethods.txt  |   29 +
 .../templatesuite/expected/stringliteral.txt    |  Bin 0 -> 1550 bytes
 .../core/templatesuite/expected/switch.txt      |   80 ++
 .../core/templatesuite/expected/transforms.txt  |   68 ++
 .../templatesuite/expected/type-builtins.txt    |   33 +
 .../core/templatesuite/expected/var-layers.txt  |   37 +
 .../core/templatesuite/expected/varargs.txt     |   44 +
 .../core/templatesuite/expected/variables.txt   |   62 +
 .../templatesuite/expected/whitespace-trim.txt  |   60 +
 .../templatesuite/expected/wstrip-in-header.txt |   23 +
 .../core/templatesuite/expected/wstripping.txt  |   39 +
 .../templatesuite/expected/xml-fragment.txt     |   25 +
 .../expected/xml-ns_prefix-scope.txt            |   29 +
 .../core/templatesuite/expected/xml.txt         |   65 +
 .../core/templatesuite/expected/xmlns1.txt      |   63 +
 .../core/templatesuite/expected/xmlns3.txt      |   47 +
 .../core/templatesuite/expected/xmlns4.txt      |   47 +
 .../core/templatesuite/expected/xmlns5.txt      |   26 +
 .../models/BeansTestResources.properties        |   19 +
 .../core/templatesuite/models/defaultxmlns1.xml |   24 +
 .../models/xml-ns_prefix-scope.xml              |   26 +
 .../core/templatesuite/models/xml.xml           |   31 +
 .../core/templatesuite/models/xmlfragment.xml   |   19 +
 .../core/templatesuite/models/xmlns.xml         |   32 +
 .../core/templatesuite/models/xmlns2.xml        |   32 +
 .../core/templatesuite/models/xmlns3.xml        |   32 +
 .../templatesuite/templates/api-builtins.ftl    |   40 +
 .../core/templatesuite/templates/arithmetic.ftl |   50 +
 .../templatesuite/templates/assignments.ftl     |  108 ++
 .../templates/boolean-formatting.ftl            |   82 ++
 .../core/templatesuite/templates/boolean.ftl    |  142 +++
 .../templates/charset-in-header.ftl             |   27 +
 .../templates/charset-in-header_inc1.ftl        |   20 +
 .../templates/charset-in-header_inc2.ftl        |   19 +
 .../core/templatesuite/templates/comment.ftl    |   50 +
 .../templatesuite/templates/comparisons.ftl     |  218 ++++
 .../core/templatesuite/templates/compress.ftl   |   59 +
 .../templates/date-type-builtins.ftl            |   47 +
 .../templates/dateformat-iso-bi.ftl             |  163 +++
 .../templates/dateformat-iso-like.ftl           |  155 +++
 .../templatesuite/templates/dateformat-java.ftl |   71 ++
 .../templatesuite/templates/dateparsing.ftl     |   84 ++
 .../templates/default-object-wrapper.ftl        |   59 +
 .../templatesuite/templates/default-xmlns.ftl   |   28 +
 .../core/templatesuite/templates/default.ftl    |   34 +
 .../templates/encoding-builtins.ftl             |   52 +
 .../core/templatesuite/templates/escapes.ftl    |   79 ++
 .../core/templatesuite/templates/exception.ftl  |   31 +
 .../core/templatesuite/templates/exception2.ftl |   31 +
 .../core/templatesuite/templates/exception3.ftl |   31 +
 .../templates/existence-operators.ftl           |  141 +++
 .../core/templatesuite/templates/hashconcat.ftl |   60 +
 .../templatesuite/templates/hashliteral.ftl     |  100 ++
 .../core/templatesuite/templates/helloworld.ftl |   30 +
 .../templates/identifier-escaping.ftl           |   81 ++
 .../templates/identifier-non-ascii.ftl          |   21 +
 .../core/templatesuite/templates/if.ftl         |  109 ++
 .../core/templatesuite/templates/import.ftl     |   45 +
 .../core/templatesuite/templates/import_lib.ftl |   31 +
 .../core/templatesuite/templates/include.ftl    |   47 +
 .../templates/include2-included.ftl             |   19 +
 .../core/templatesuite/templates/include2.ftl   |   32 +
 .../core/templatesuite/templates/included.ftl   |   30 +
 .../core/templatesuite/templates/interpret.ftl  |   25 +
 .../core/templatesuite/templates/iterators.ftl  |   71 ++
 .../templatesuite/templates/lastcharacter.ftl   |   31 +
 .../core/templatesuite/templates/list-bis.ftl   |   48 +
 .../core/templatesuite/templates/list.ftl       |   44 +
 .../core/templatesuite/templates/list2.ftl      |   90 ++
 .../core/templatesuite/templates/list3.ftl      |   70 ++
 .../core/templatesuite/templates/listhash.ftl   |   70 ++
 .../templatesuite/templates/listhashliteral.ftl |   35 +
 .../templatesuite/templates/listliteral.ftl     |   84 ++
 .../templatesuite/templates/localization.ftl    |   32 +
 .../templatesuite/templates/localization_en.ftl |   32 +
 .../templates/localization_en_AU.ftl            |   32 +
 .../core/templatesuite/templates/logging.ftl    |   42 +
 .../templatesuite/templates/loopvariable.ftl    |   49 +
 .../templatesuite/templates/macros-return.ftl   |   34 +
 .../core/templatesuite/templates/macros.ftl     |  101 ++
 .../core/templatesuite/templates/macros2.ftl    |   35 +
 .../templatesuite/templates/multimodels.ftl     |   84 ++
 .../core/templatesuite/templates/nested.ftl     |   29 +
 .../templatesuite/templates/nestedinclude.ftl   |   21 +
 .../templates/new-defaultresolver.ftl           |   23 +
 .../core/templatesuite/templates/new-optin.ftl  |   30 +
 .../core/templatesuite/templates/newlines1.ftl  |   29 +
 .../core/templatesuite/templates/newlines2.ftl  |   33 +
 .../core/templatesuite/templates/noparse.ftl    |   62 +
 .../templatesuite/templates/number-format.ftl   |   42 +
 .../templatesuite/templates/number-literal.ftl  |  133 +++
 .../templates/number-math-builtins.ftl          |   78 ++
 .../templatesuite/templates/number-to-date.ftl  |   35 +
 .../templatesuite/templates/numerical-cast.ftl  |   82 ++
 .../templates/output-encoding1.ftl              |   30 +
 .../templates/output-encoding2.ftl              |   28 +
 .../templates/output-encoding3.ftl              |   28 +
 .../templates/overloaded-methods.ftl            |  411 +++++++
 .../core/templatesuite/templates/precedence.ftl |   61 +
 .../templatesuite/templates/range-common.ftl    |  314 +++++
 .../core/templatesuite/templates/range.ftl      |   50 +
 .../core/templatesuite/templates/recover.ftl    |   47 +
 .../core/templatesuite/templates/root.ftl       |   47 +
 .../templates/sequence-builtins.ftl             |  360 ++++++
 .../core/templatesuite/templates/setting.ftl    |   53 +
 .../templates/simplehash-char-key.ftl           |   44 +
 .../templatesuite/templates/specialvars.ftl     |   38 +
 .../templates/string-builtin-coercion.ftl       |   34 +
 .../string-builtins-regexps-matches.ftl         |  118 ++
 .../templates/string-builtins-regexps.ftl       |  136 +++
 .../templates/string-builtins1.ftl              |  129 ++
 .../templates/string-builtins2.ftl              |  135 +++
 .../templates/string-builtins3.ftl              |  225 ++++
 .../templatesuite/templates/stringbimethods.ftl |   36 +
 .../templatesuite/templates/stringliteral.ftl   |   69 ++
 .../templates/subdir/include-subdir.ftl         |   27 +
 .../templates/subdir/include-subdir2.ftl        |   19 +
 .../templates/subdir/new-optin-2.ftl            |   24 +
 .../templates/subdir/new-optin.ftl              |   26 +
 .../templates/subdir/subsub/new-optin.ftl       |   24 +
 .../templatesuite/templates/switch-builtin.ftl  |   54 +
 .../core/templatesuite/templates/switch.ftl     |  139 +++
 .../templatesuite/templates/then-builtin.ftl    |   53 +
 .../core/templatesuite/templates/transforms.ftl |  100 ++
 .../templatesuite/templates/type-builtins.ftl   |   44 +
 .../core/templatesuite/templates/undefined.ftl  |   19 +
 .../core/templatesuite/templates/url.ftl        |   24 +
 .../core/templatesuite/templates/var-layers.ftl |   39 +
 .../core/templatesuite/templates/varargs.ftl    |   45 +
 .../core/templatesuite/templates/variables.ftl  |   70 ++
 .../templatesuite/templates/varlayers_lib.ftl   |   28 +
 .../templatesuite/templates/whitespace-trim.ftl |  102 ++
 .../templates/wsstripinheader_inc.ftl           |   22 +
 .../templates/wstrip-in-header.ftl              |   26 +
 .../templatesuite/templates/xml-fragment.ftl    |   26 +
 .../templates/xml-ns_prefix-scope-lib.ftl       |   23 +
 .../templates/xml-ns_prefix-scope-main.ftl      |   36 +
 .../core/templatesuite/templates/xml.ftl        |   47 +
 .../core/templatesuite/templates/xmlns1.ftl     |   53 +
 .../core/templatesuite/templates/xmlns3.ftl     |   70 ++
 .../core/templatesuite/templates/xmlns4.ftl     |   70 ++
 .../core/templatesuite/templates/xmlns5.ftl     |   28 +
 .../freemarker/core/templatesuite/testcases.xml |  211 ++++
 .../test/templatesuite/expected/arithmetic.txt  |   46 -
 .../expected/boolean-formatting.txt             |   31 -
 .../test/templatesuite/expected/boolean.txt     |  102 --
 .../expected/charset-in-header.txt              |   26 -
 .../test/templatesuite/expected/comment.txt     |   34 -
 .../test/templatesuite/expected/comparisons.txt |   93 --
 .../test/templatesuite/expected/compress.txt    |   40 -
 .../templatesuite/expected/dateformat-java.txt  |   55 -
 .../expected/default-object-wrapper.txt         |   55 -
 .../templatesuite/expected/default-xmlns.txt    |   25 -
 .../test/templatesuite/expected/default.txt     |   26 -
 .../expected/encoding-builtins.txt              |   44 -
 .../test/templatesuite/expected/escapes.txt     |   49 -
 .../test/templatesuite/expected/exception.txt   |   43 -
 .../test/templatesuite/expected/exception2.txt  |   47 -
 .../test/templatesuite/expected/exception3.txt  |   21 -
 .../test/templatesuite/expected/exthash.txt     |   76 --
 .../test/templatesuite/expected/hashconcat.txt  |  138 ---
 .../test/templatesuite/expected/hashliteral.txt |   74 --
 .../test/templatesuite/expected/helloworld.txt  |   31 -
 .../expected/identifier-escaping.txt            |   57 -
 .../expected/identifier-non-ascii.txt           |   19 -
 .../test/templatesuite/expected/if.txt          |  104 --
 .../test/templatesuite/expected/import.txt      |   40 -
 .../test/templatesuite/expected/include.txt     |   67 --
 .../test/templatesuite/expected/include2.txt    |   28 -
 .../test/templatesuite/expected/interpret.txt   |   23 -
 .../test/templatesuite/expected/iterators.txt   |   84 --
 .../templatesuite/expected/lastcharacter.txt    |   31 -
 .../test/templatesuite/expected/list-bis.txt    |   51 -
 .../test/templatesuite/expected/list.txt        |   51 -
 .../test/templatesuite/expected/list2.txt       |  211 ----
 .../test/templatesuite/expected/list3.txt       |   57 -
 .../test/templatesuite/expected/listhash.txt    |  157 ---
 .../templatesuite/expected/listhashliteral.txt  |   36 -
 .../test/templatesuite/expected/listliteral.txt |   75 --
 .../templatesuite/expected/localization.txt     |   32 -
 .../test/templatesuite/expected/logging.txt     |   27 -
 .../templatesuite/expected/loopvariable.txt     |   54 -
 .../templatesuite/expected/macros-return.txt    |   23 -
 .../test/templatesuite/expected/macros.txt      |   67 --
 .../test/templatesuite/expected/macros2.txt     |   22 -
 .../test/templatesuite/expected/multimodels.txt |   93 --
 .../test/templatesuite/expected/nested.txt      |   25 -
 .../expected/new-allowsnothing.txt              |   19 -
 .../expected/new-defaultresolver.txt            |   19 -
 .../test/templatesuite/expected/new-optin.txt   |   32 -
 .../test/templatesuite/expected/newlines1.txt   |   29 -
 .../test/templatesuite/expected/newlines2.txt   |   30 -
 .../test/templatesuite/expected/noparse.txt     |   54 -
 .../templatesuite/expected/number-format.txt    |   33 -
 .../templatesuite/expected/number-literal.txt   |   79 --
 .../templatesuite/expected/number-to-date.txt   |   31 -
 .../templatesuite/expected/numerical-cast.txt   |  462 --------
 .../templatesuite/expected/output-encoding1.txt |   27 -
 .../templatesuite/expected/output-encoding2.txt |  Bin 1972 -> 0 bytes
 .../templatesuite/expected/output-encoding3.txt |   26 -
 .../test/templatesuite/expected/precedence.txt  |   48 -
 .../test/templatesuite/expected/recover.txt     |   26 -
 .../test/templatesuite/expected/root.txt        |   44 -
 .../expected/sequence-builtins.txt              |  404 -------
 .../test/templatesuite/expected/specialvars.txt |   25 -
 .../string-builtins-regexps-matches.txt         |   99 --
 .../expected/string-builtins-regexps.txt        |  112 --
 .../templatesuite/expected/string-builtins1.txt |  112 --
 .../templatesuite/expected/string-builtins2.txt |  135 ---
 .../templatesuite/expected/stringbimethods.txt  |   29 -
 .../templatesuite/expected/stringliteral.txt    |  Bin 1550 -> 0 bytes
 .../test/templatesuite/expected/switch.txt      |   80 --
 .../test/templatesuite/expected/transforms.txt  |   68 --
 .../templatesuite/expected/type-builtins.txt    |   33 -
 .../test/templatesuite/expected/var-layers.txt  |   37 -
 .../test/templatesuite/expected/varargs.txt     |   44 -
 .../test/templatesuite/expected/variables.txt   |   62 -
 .../templatesuite/expected/whitespace-trim.txt  |   60 -
 .../templatesuite/expected/wstrip-in-header.txt |   23 -
 .../test/templatesuite/expected/wstripping.txt  |   39 -
 .../templatesuite/expected/xml-fragment.txt     |   25 -
 .../expected/xml-ns_prefix-scope.txt            |   29 -
 .../test/templatesuite/expected/xml.txt         |   65 -
 .../test/templatesuite/expected/xmlns1.txt      |   63 -
 .../test/templatesuite/expected/xmlns3.txt      |   47 -
 .../test/templatesuite/expected/xmlns4.txt      |   47 -
 .../test/templatesuite/expected/xmlns5.txt      |   26 -
 .../models/BeansTestResources.properties        |   19 -
 .../test/templatesuite/models/defaultxmlns1.xml |   24 -
 .../models/xml-ns_prefix-scope.xml              |   26 -
 .../test/templatesuite/models/xml.xml           |   31 -
 .../test/templatesuite/models/xmlfragment.xml   |   19 -
 .../test/templatesuite/models/xmlns.xml         |   32 -
 .../test/templatesuite/models/xmlns2.xml        |   32 -
 .../test/templatesuite/models/xmlns3.xml        |   32 -
 .../templatesuite/templates/api-builtins.ftl    |   40 -
 .../test/templatesuite/templates/arithmetic.ftl |   50 -
 .../templatesuite/templates/assignments.ftl     |  108 --
 .../templates/boolean-formatting.ftl            |   82 --
 .../test/templatesuite/templates/boolean.ftl    |  142 ---
 .../templates/charset-in-header.ftl             |   27 -
 .../templates/charset-in-header_inc1.ftl        |   20 -
 .../templates/charset-in-header_inc2.ftl        |   19 -
 .../test/templatesuite/templates/comment.ftl    |   50 -
 .../templatesuite/templates/comparisons.ftl     |  218 ----
 .../test/templatesuite/templates/compress.ftl   |   59 -
 .../templates/date-type-builtins.ftl            |   47 -
 .../templates/dateformat-iso-bi.ftl             |  163 ---
 .../templates/dateformat-iso-like.ftl           |  155 ---
 .../templatesuite/templates/dateformat-java.ftl |   71 --
 .../templatesuite/templates/dateparsing.ftl     |   84 --
 .../templates/default-object-wrapper.ftl        |   59 -
 .../templatesuite/templates/default-xmlns.ftl   |   28 -
 .../test/templatesuite/templates/default.ftl    |   34 -
 .../templates/encoding-builtins.ftl             |   52 -
 .../test/templatesuite/templates/escapes.ftl    |   79 --
 .../test/templatesuite/templates/exception.ftl  |   31 -
 .../test/templatesuite/templates/exception2.ftl |   31 -
 .../test/templatesuite/templates/exception3.ftl |   31 -
 .../templates/existence-operators.ftl           |  141 ---
 .../test/templatesuite/templates/hashconcat.ftl |   60 -
 .../templatesuite/templates/hashliteral.ftl     |  100 --
 .../test/templatesuite/templates/helloworld.ftl |   30 -
 .../templates/identifier-escaping.ftl           |   81 --
 .../templates/identifier-non-ascii.ftl          |   21 -
 .../test/templatesuite/templates/if.ftl         |  109 --
 .../test/templatesuite/templates/import.ftl     |   45 -
 .../test/templatesuite/templates/import_lib.ftl |   31 -
 .../test/templatesuite/templates/include.ftl    |   47 -
 .../templates/include2-included.ftl             |   19 -
 .../test/templatesuite/templates/include2.ftl   |   32 -
 .../test/templatesuite/templates/included.ftl   |   30 -
 .../test/templatesuite/templates/interpret.ftl  |   25 -
 .../test/templatesuite/templates/iterators.ftl  |   71 --
 .../templatesuite/templates/lastcharacter.ftl   |   31 -
 .../test/templatesuite/templates/list-bis.ftl   |   48 -
 .../test/templatesuite/templates/list.ftl       |   44 -
 .../test/templatesuite/templates/list2.ftl      |   90 --
 .../test/templatesuite/templates/list3.ftl      |   70 --
 .../test/templatesuite/templates/listhash.ftl   |   70 --
 .../templatesuite/templates/listhashliteral.ftl |   35 -
 .../templatesuite/templates/listliteral.ftl     |   84 --
 .../templatesuite/templates/localization.ftl    |   32 -
 .../templatesuite/templates/localization_en.ftl |   32 -
 .../templates/localization_en_AU.ftl            |   32 -
 .../test/templatesuite/templates/logging.ftl    |   42 -
 .../templatesuite/templates/loopvariable.ftl    |   49 -
 .../templatesuite/templates/macros-return.ftl   |   34 -
 .../test/templatesuite/templates/macros.ftl     |  101 --
 .../test/templatesuite/templates/macros2.ftl    |   35 -
 .../templatesuite/templates/multimodels.ftl     |   84 --
 .../test/templatesuite/templates/nested.ftl     |   29 -
 .../templatesuite/templates/nestedinclude.ftl   |   21 -
 .../templates/new-defaultresolver.ftl           |   23 -
 .../test/templatesuite/templates/new-optin.ftl  |   30 -
 .../test/templatesuite/templates/newlines1.ftl  |   29 -
 .../test/templatesuite/templates/newlines2.ftl  |   33 -
 .../test/templatesuite/templates/noparse.ftl    |   62 -
 .../templatesuite/templates/number-format.ftl   |   42 -
 .../templatesuite/templates/number-literal.ftl  |  133 ---
 .../templates/number-math-builtins.ftl          |   78 --
 .../templatesuite/templates/number-to-date.ftl  |   35 -
 .../templatesuite/templates/numerical-cast.ftl  |   82 --
 .../templates/output-encoding1.ftl              |   30 -
 .../templates/output-encoding2.ftl              |   28 -
 .../templates/output-encoding3.ftl              |   28 -
 .../templates/overloaded-methods.ftl            |  411 -------
 .../test/templatesuite/templates/precedence.ftl |   61 -
 .../templatesuite/templates/range-common.ftl    |  314 -----
 .../test/templatesuite/templates/range.ftl      |   50 -
 .../test/templatesuite/templates/recover.ftl    |   47 -
 .../test/templatesuite/templates/root.ftl       |   47 -
 .../templates/sequence-builtins.ftl             |  360 ------
 .../test/templatesuite/templates/setting.ftl    |   53 -
 .../templates/simplehash-char-key.ftl           |   44 -
 .../templatesuite/templates/specialvars.ftl     |   38 -
 .../templates/string-builtin-coercion.ftl       |   34 -
 .../string-builtins-regexps-matches.ftl         |  118 --
 .../templates/string-builtins-regexps.ftl       |  136 ---
 .../templates/string-builtins1.ftl              |  129 --
 .../templates/string-builtins2.ftl              |  135 ---
 .../templates/string-builtins3.ftl              |  225 ----
 .../templatesuite/templates/stringbimethods.ftl |   36 -
 .../templatesuite/templates/stringliteral.ftl   |   69 --
 .../templates/subdir/include-subdir.ftl         |   27 -
 .../templates/subdir/include-subdir2.ftl        |   19 -
 .../templates/subdir/new-optin-2.ftl            |   24 -
 .../templates/subdir/new-optin.ftl              |   26 -
 .../templates/subdir/subsub/new-optin.ftl       |   24 -
 .../templatesuite/templates/switch-builtin.ftl  |   54 -
 .../test/templatesuite/templates/switch.ftl     |  139 ---
 .../templatesuite/templates/then-builtin.ftl    |   53 -
 .../test/templatesuite/templates/transforms.ftl |  100 --
 .../templatesuite/templates/type-builtins.ftl   |   44 -
 .../test/templatesuite/templates/undefined.ftl  |   19 -
 .../test/templatesuite/templates/url.ftl        |   24 -
 .../test/templatesuite/templates/var-layers.ftl |   39 -
 .../test/templatesuite/templates/varargs.ftl    |   45 -
 .../test/templatesuite/templates/variables.ftl  |   70 --
 .../templatesuite/templates/varlayers_lib.ftl   |   28 -
 .../templatesuite/templates/whitespace-trim.ftl |  102 --
 .../templates/wsstripinheader_inc.ftl           |   22 -
 .../templates/wstrip-in-header.ftl              |   26 -
 .../templatesuite/templates/xml-fragment.ftl    |   26 -
 .../templates/xml-ns_prefix-scope-lib.ftl       |   23 -
 .../templates/xml-ns_prefix-scope-main.ftl      |   36 -
 .../test/templatesuite/templates/xml.ftl        |   47 -
 .../test/templatesuite/templates/xmlns1.ftl     |   53 -
 .../test/templatesuite/templates/xmlns3.ftl     |   70 --
 .../test/templatesuite/templates/xmlns4.ftl     |   70 --
 .../test/templatesuite/templates/xmlns5.ftl     |   28 -
 .../freemarker/test/templatesuite/testcases.xml |  211 ----
 freemarker-core/build.gradle                    |    8 -
 .../freemarker/test/TemplateTestCase.java       |  194 +++
 .../freemarker/test/TemplateTestSuite.java      |  332 ++++++
 501 files changed, 17535 insertions(+), 17506 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index d9d7f7f..33fe1bf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -276,4 +276,4 @@ subprojects {
         }
     }
 
-} // end subprojects
\ No newline at end of file
+} // end subprojects

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/build.gradle
----------------------------------------------------------------------
diff --git a/freemarker-core-test/build.gradle b/freemarker-core-test/build.gradle
index 411f6ea..1edfe8f 100644
--- a/freemarker-core-test/build.gradle
+++ b/freemarker-core-test/build.gradle
@@ -5,6 +5,13 @@ through freemarker-test-utils, they had to be moved into a separate project."""
 dependencies {
     compile project(":freemarker-core")
     compile project(":freemarker-test-utils")
+
+    testRuntime "jaxen:jaxen:1.0-FCS"
+    testRuntime "saxpath:saxpath:1.0-FCS"
+    testRuntime("xalan:xalan:2.7.0") {
+        // xml-apis is part of Java SE since version 1.4:
+        exclude group: "xml-apis", module: "xml-apis"
+    }
 }
 
 // We have nothing to put into the jar, as we have test classes only

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/ListErrorsTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/ListErrorsTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/ListErrorsTest.java
index 05bac4f..67d8f59 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/ListErrorsTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/ListErrorsTest.java
@@ -23,7 +23,7 @@ import java.io.IOException;
 
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.test.TemplateTest;
-import org.apache.freemarker.test.templatesuite.models.Listables;
+import org.apache.freemarker.core.templatesuite.models.Listables;
 import org.junit.Test;
 
 import com.google.common.collect.ImmutableMap;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/NewBiObjectWrapperRestrictionTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/NewBiObjectWrapperRestrictionTest.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/NewBiObjectWrapperRestrictionTest.java
index 506101d..a90e28b 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/NewBiObjectWrapperRestrictionTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/NewBiObjectWrapperRestrictionTest.java
@@ -50,14 +50,14 @@ public class NewBiObjectWrapperRestrictionTest extends TemplateTest {
     @Test
     public void testPositive() throws IOException, TemplateException {
         assertOutput(
-                "${'org.apache.freemarker.test.templatesuite.models.NewTestModel'?new()}",
+                "${'org.apache.freemarker.core.templatesuite.models.NewTestModel'?new()}",
                 "default constructor");
     }
 
     @Test
     public void testNegative() {
         assertErrorContains(
-                "${'org.apache.freemarker.test.templatesuite.models.NewTestModel'?new('s')}",
+                "${'org.apache.freemarker.core.templatesuite.models.NewTestModel'?new('s')}",
                 "only supports 0 argument");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/CoreTemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/CoreTemplateTestSuite.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/CoreTemplateTestSuite.java
new file mode 100644
index 0000000..b49c213
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/CoreTemplateTestSuite.java
@@ -0,0 +1,282 @@
+package org.apache.freemarker.core.templatesuite;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.TimeZone;
+import java.util.TreeSet;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.freemarker.core.ASTPrinter;
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.Template;
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateDateModel;
+import org.apache.freemarker.core.model.impl.DefaultNonListCollectionAdapter;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.ResourceBundleModel;
+import org.apache.freemarker.core.model.impl.SimpleCollection;
+import org.apache.freemarker.core.model.impl.SimpleDate;
+import org.apache.freemarker.core.model.impl.SimpleNumber;
+import org.apache.freemarker.core.templatesuite.models.BooleanAndStringTemplateModel;
+import org.apache.freemarker.core.templatesuite.models.BooleanHash1;
+import org.apache.freemarker.core.templatesuite.models.BooleanHash2;
+import org.apache.freemarker.core.templatesuite.models.BooleanList1;
+import org.apache.freemarker.core.templatesuite.models.BooleanList2;
+import org.apache.freemarker.core.templatesuite.models.BooleanVsStringMethods;
+import org.apache.freemarker.core.templatesuite.models.JavaObjectInfo;
+import org.apache.freemarker.core.templatesuite.models.Listables;
+import org.apache.freemarker.core.templatesuite.models.MultiModel1;
+import org.apache.freemarker.core.templatesuite.models.OverloadedMethods2;
+import org.apache.freemarker.core.templatesuite.models.TestBean;
+import org.apache.freemarker.core.templatesuite.models.TestBoolean;
+import org.apache.freemarker.core.templatesuite.models.TestMethod;
+import org.apache.freemarker.core.templatesuite.models.TestNode;
+import org.apache.freemarker.core.templatesuite.models.VarArgTestModel;
+import org.apache.freemarker.dom.NodeModel;
+import org.apache.freemarker.test.TemplateTestSuite;
+import org.apache.freemarker.test.XMLLoader;
+import org.xml.sax.InputSource;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+
+import junit.framework.TestSuite;
+
+public class CoreTemplateTestSuite extends TemplateTestSuite {
+
+    private final DefaultObjectWrapper dow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
+
+    /**
+     * Required for the suite to be detected and run by build tools and IDE-s.
+     */
+    public static TestSuite suite() {
+        return new CoreTemplateTestSuite();
+    }
+
+    @Override
+    protected void setUpTestCase(String simpleTestName, Map<String, Object> dataModel,
+            Configuration.ExtendableBuilder<?> confB) throws Exception {
+        dataModel.put("message", "Hello, world!");
+        dataModel.put("javaObjectInfo", JavaObjectInfo.INSTANCE);
+
+        if (simpleTestName.startsWith("api-builtin")) {
+            dataModel.put("map", ImmutableMap.of(1, "a", 2, "b", 3, "c"));
+            dataModel.put("list", ImmutableList.of(1, 2, 3));
+            dataModel.put("set", ImmutableSet.of("a", "b", "c"));
+            dataModel.put("s", "test");
+        } else if (simpleTestName.equals("default-object-wrapper")) {
+            dataModel.put("array", new String[] { "array-0", "array-1"});
+            dataModel.put("list", Arrays.asList("list-0", "list-1", "list-2"));
+            Map<Object, Object> tmap = new HashMap<>();
+            tmap.put("key", "value");
+            Object objKey = new Object();
+            tmap.put(objKey, "objValue");
+            dataModel.put("map", tmap);
+            dataModel.put("objKey", objKey);
+            dataModel.put("obj", new org.apache.freemarker.core.templatesuite.models.BeanTestClass());
+            dataModel.put("resourceBundle",
+                    new ResourceBundleModel(ResourceBundle.getBundle(
+                            "org.apache.freemarker.core.templatesuite.models.BeansTestResources"), dow));
+            dataModel.put("date", new GregorianCalendar(1974, 10, 14).getTime());
+            dataModel.put("statics", dow.getStaticModels());
+            dataModel.put("enums", dow.getEnumModels());
+        } else if (simpleTestName.equals("boolean")) {
+            dataModel.put( "boolean1", TemplateBooleanModel.FALSE);
+            dataModel.put( "boolean2", TemplateBooleanModel.TRUE);
+            dataModel.put( "boolean3", TemplateBooleanModel.TRUE);
+            dataModel.put( "boolean4", TemplateBooleanModel.TRUE);
+            dataModel.put( "boolean5", TemplateBooleanModel.FALSE);
+
+            dataModel.put( "list1", new BooleanList1(dow) );
+            dataModel.put( "list2", new BooleanList2(dow) );
+
+            dataModel.put( "hash1", new BooleanHash1() );
+            dataModel.put( "hash2", new BooleanHash2() );
+        } else if (simpleTestName.startsWith("dateformat")) {
+            GregorianCalendar cal = new GregorianCalendar(2002, 10, 15, 14, 54, 13);
+            cal.setTimeZone(TimeZone.getTimeZone("GMT"));
+            dataModel.put("date", new SimpleDate(cal.getTime(), TemplateDateModel.DATETIME));
+            dataModel.put("unknownDate", new SimpleDate(cal.getTime(), TemplateDateModel.UNKNOWN));
+            dataModel.put("javaGMT02", TimeZone.getTimeZone("GMT+02"));
+            dataModel.put("javaUTC", TimeZone.getTimeZone("UTC"));
+            dataModel.put("adaptedToStringScalar", new Object() {
+                @Override
+                public String toString() {
+                    return "GMT+02";
+                }
+            });
+            dataModel.put("sqlDate", new java.sql.Date(1273955885023L));
+            dataModel.put("sqlTime", new java.sql.Time(74285023L));
+        } else if (simpleTestName.startsWith("list-") || simpleTestName.startsWith("list[")
+                || simpleTestName.startsWith("list2[") || simpleTestName.startsWith("list3[")
+                || simpleTestName.equals("listhash")) {
+            dataModel.put("listables", new Listables());
+        } else if (simpleTestName.startsWith("number-format")) {
+            dataModel.put("int", new SimpleNumber(Integer.valueOf(1)));
+            dataModel.put("double", new SimpleNumber(Double.valueOf(1.0)));
+            dataModel.put("double2", new SimpleNumber(Double.valueOf(1 + 1e-15)));
+            dataModel.put("double3", new SimpleNumber(Double.valueOf(1e-16)));
+            dataModel.put("double4", new SimpleNumber(Double.valueOf(-1e-16)));
+            dataModel.put("bigDecimal", new SimpleNumber(java.math.BigDecimal.valueOf(1)));
+            dataModel.put("bigDecimal2", new SimpleNumber(java.math.BigDecimal.valueOf(1, 16)));
+        } else if (simpleTestName.equals("simplehash-char-key")) {
+            HashMap<String, String> mStringC = new HashMap<>();
+            mStringC.put("c", "string");
+            dataModel.put("mStringC", mStringC);
+
+            HashMap<String, String> mStringCNull = new HashMap<>();
+            mStringCNull.put("c", null);
+            dataModel.put("mStringCNull", mStringCNull);
+
+            HashMap<Character, String> mCharC = new HashMap<>();
+            mCharC.put(Character.valueOf('c'), "char");
+            dataModel.put("mCharC", mCharC);
+
+            HashMap<String, String> mCharCNull = new HashMap<>();
+            mCharCNull.put("c", null);
+            dataModel.put("mCharCNull", mCharCNull);
+
+            HashMap<Object, String> mMixed = new HashMap<>();
+            mMixed.put(Character.valueOf('c'), "char");
+            mMixed.put("s", "string");
+            mMixed.put("s2", "string2");
+            mMixed.put("s2n", null);
+            dataModel.put("mMixed", mMixed);
+        } else if (simpleTestName.equals("default-xmlns")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/defaultxmlns1.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.equals("multimodels")) {
+            dataModel.put("test", "selftest");
+            dataModel.put("self", "self");
+            dataModel.put("zero", Integer.valueOf(0));
+            dataModel.put("data", new MultiModel1());
+        } else if (simpleTestName.equals("stringbimethods")) {
+            dataModel.put("multi", new TestBoolean());
+        } else if (simpleTestName.startsWith("type-builtins")) {
+            dataModel.put("testmethod", new TestMethod());
+            dataModel.put("testnode", new TestNode());
+            dataModel.put("testcollection", new SimpleCollection(new ArrayList<>(), dow));
+            dataModel.put("testcollectionEx", DefaultNonListCollectionAdapter.adapt(new HashSet<>(), dow));
+            dataModel.put("bean", new TestBean());
+        } else if (simpleTestName.equals("date-type-builtins")) {
+            GregorianCalendar cal = new GregorianCalendar(2003, 4 - 1, 5, 6, 7, 8);
+            cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+            Date d = cal.getTime();
+            dataModel.put("unknown", d);
+            dataModel.put("timeOnly", new java.sql.Time(d.getTime()));
+            dataModel.put("dateOnly", new java.sql.Date(d.getTime()));
+            dataModel.put("dateTime", new java.sql.Timestamp(d.getTime()));
+        } else if (simpleTestName.equals("var-layers")) {
+            dataModel.put("x", Integer.valueOf(4));
+            dataModel.put("z", Integer.valueOf(4));
+            confB.setSharedVariable("y", Integer.valueOf(7));
+        } else if (simpleTestName.equals("xml-fragment")) {
+            DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
+            f.setNamespaceAware(true);
+            DocumentBuilder db = f.newDocumentBuilder();
+            org.w3c.dom.Document doc = db.parse(new InputSource(getClass().getResourceAsStream("models/xmlfragment.xml")));
+            NodeModel.simplify(doc);
+            dataModel.put("node", NodeModel.wrap(doc.getDocumentElement().getFirstChild().getFirstChild()));
+        } else if (simpleTestName.equals("xmlns1")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.equals("xmlns2")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns2.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.equals("xmlns3") || simpleTestName.equals("xmlns4")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns3.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.equals("xmlns5")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/defaultxmlns1.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.equals("xml-ns_prefix-scope")) {
+            InputSource is = new InputSource(getClass().getResourceAsStream("models/xml-ns_prefix-scope.xml"));
+            NodeModel nm = XMLLoader.toModel(is);
+            dataModel.put("doc", nm);
+        } else if (simpleTestName.startsWith("sequence-builtins")) {
+            Set<String> abcSet = new TreeSet<>();
+            abcSet.add("a");
+            abcSet.add("b");
+            abcSet.add("c");
+            dataModel.put("abcSet", abcSet);
+            dataModel.put("abcSetNonSeq", DefaultNonListCollectionAdapter.adapt(abcSet, dow));
+
+            List<String> listWithNull = new ArrayList<>();
+            listWithNull.add("a");
+            listWithNull.add(null);
+            listWithNull.add("c");
+            dataModel.put("listWithNull", listWithNull);
+
+            List<String> listWithNullsOnly = new ArrayList<>();
+            listWithNull.add(null);
+            listWithNull.add(null);
+            listWithNull.add(null);
+            dataModel.put("listWithNullsOnly", listWithNullsOnly);
+
+            dataModel.put("abcCollection", new SimpleCollection(abcSet, dow));
+
+            Set<String> set = new HashSet<>();
+            set.add("a");
+            set.add("b");
+            set.add("c");
+            dataModel.put("set", set);
+        } else if (simpleTestName.equals("number-to-date")) {
+            dataModel.put("bigInteger", new BigInteger("1305575275540"));
+            dataModel.put("bigDecimal", new BigDecimal("1305575275539.5"));
+        } else if (simpleTestName.equals("varargs")) {
+            dataModel.put("m", new VarArgTestModel());
+        } else if (simpleTestName.startsWith("boolean-formatting")) {
+            dataModel.put("booleanAndString", new BooleanAndStringTemplateModel());
+            dataModel.put("booleanVsStringMethods", new BooleanVsStringMethods());
+        } else if (simpleTestName.startsWith("number-math-builtins")) {
+            dataModel.put("fNan", Float.valueOf(Float.NaN));
+            dataModel.put("dNan", Double.valueOf(Double.NaN));
+            dataModel.put("fNinf", Float.valueOf(Float.NEGATIVE_INFINITY));
+            dataModel.put("dPinf", Double.valueOf(Double.POSITIVE_INFINITY));
+
+            dataModel.put("fn", Float.valueOf(-0.05f));
+            dataModel.put("dn", Double.valueOf(-0.05));
+            dataModel.put("ineg", Integer.valueOf(-5));
+            dataModel.put("ln", Long.valueOf(-5));
+            dataModel.put("sn", Short.valueOf((short) -5));
+            dataModel.put("bn", Byte.valueOf((byte) -5));
+            dataModel.put("bin", BigInteger.valueOf(5));
+            dataModel.put("bdn", BigDecimal.valueOf(-0.05));
+
+            dataModel.put("fp", Float.valueOf(0.05f));
+            dataModel.put("dp", Double.valueOf(0.05));
+            dataModel.put("ip", Integer.valueOf(5));
+            dataModel.put("lp", Long.valueOf(5));
+            dataModel.put("sp", Short.valueOf((short) 5));
+            dataModel.put("bp", Byte.valueOf((byte) 5));
+            dataModel.put("bip", BigInteger.valueOf(5));
+            dataModel.put("bdp", BigDecimal.valueOf(0.05));
+        } else if (simpleTestName.startsWith("overloaded-methods")) {
+            dataModel.put("obj", new OverloadedMethods2());
+        }
+    }
+
+    @Override
+    protected void validateTemplate(Template template) {
+        ASTPrinter.validateAST(template);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/AllTemplateModels.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/AllTemplateModels.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/AllTemplateModels.java
new file mode 100644
index 0000000..d656a6b
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/AllTemplateModels.java
@@ -0,0 +1,128 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.Date;
+
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateCollectionModel;
+import org.apache.freemarker.core.model.TemplateDateModel;
+import org.apache.freemarker.core.model.TemplateHashModelEx;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateModelIterator;
+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.model.impl.SimpleScalar;
+
+/**
+ * Implements all template models that are interesting when calling overloaded Java methods.
+ */
+public class AllTemplateModels implements
+        TemplateScalarModel, TemplateNumberModel, TemplateDateModel, TemplateBooleanModel,
+        TemplateHashModelEx, TemplateSequenceModel, TemplateCollectionModel {
+
+    public static final AllTemplateModels INSTANCE = new AllTemplateModels();
+    
+    private final TemplateModelIterator EMPTY_ITERATOR = new TemplateModelIterator() {
+
+        @Override
+        public TemplateModel next() throws TemplateModelException {
+            return null;
+        }
+
+        @Override
+        public boolean hasNext() throws TemplateModelException {
+            return false;
+        }
+        
+    };
+    
+    private final TemplateCollectionModel EMPTY_COLLECTION = new TemplateCollectionModel() {
+
+        @Override
+        public TemplateModelIterator iterator() throws TemplateModelException {
+            return EMPTY_ITERATOR;
+        }
+    };
+    
+    @Override
+    public TemplateModel get(String key) throws TemplateModelException {
+        return new SimpleScalar("value for key " + key);
+    }
+
+    @Override
+    public boolean isEmpty() throws TemplateModelException {
+        return true;
+    }
+
+    @Override
+    public TemplateModelIterator iterator() throws TemplateModelException {
+        return EMPTY_ITERATOR;
+    }
+
+    @Override
+    public TemplateModel get(int index) throws TemplateModelException {
+        return null;
+    }
+
+    @Override
+    public int size() throws TemplateModelException {
+        return 0;
+    }
+
+    @Override
+    public TemplateCollectionModel keys() throws TemplateModelException {
+        return EMPTY_COLLECTION;
+    }
+
+    @Override
+    public TemplateCollectionModel values() throws TemplateModelException {
+        return EMPTY_COLLECTION;
+    }
+
+    @Override
+    public boolean getAsBoolean() throws TemplateModelException {
+        return true;
+    }
+
+    @Override
+    public Date getAsDate() throws TemplateModelException {
+        return new Date(0);
+    }
+
+    @Override
+    public int getDateType() {
+        return TemplateDateModel.DATETIME;
+    }
+
+    @Override
+    @SuppressWarnings("boxing")
+    public Number getAsNumber() throws TemplateModelException {
+        return 1;
+    }
+
+    @Override
+    public String getAsString() throws TemplateModelException {
+        return "s";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestClass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestClass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestClass.java
new file mode 100644
index 0000000..88541ae
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestClass.java
@@ -0,0 +1,93 @@
+/*
+ * 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.templatesuite.models;
+
+/**
+ */
+public class BeanTestClass extends BeanTestSuperclass implements BeanTestInterface<Integer> {
+    public static final String STATIC_FINAL_FIELD = "static-final-field";
+    public static String STATIC_FIELD = "static-field";
+    
+	public String getFoo() {
+	    return "foo-value";
+	}
+	
+	public String getBar(int index) {
+	    return "bar-value-" + index;
+	}
+
+	public String[] getBar() {
+		return new String[] { "bar-value-0", "bar-value-1", "bar-value-2" };
+	}
+
+	public String overloaded(int i) {
+	    return "overloaded-int-" + i;
+	}
+	
+	public String overloaded(String s) {
+	    return "overloaded-String-" + s;
+	}
+	
+	public static String staticMethod() {
+	    return "static-method";
+	}
+	
+	public static String staticOverloaded(int i) {
+	    return "static-overloaded-int-" + i;
+	}
+
+	public static String staticOverloaded(String s) {
+	    return "static-overloaded-String-" + s;
+	}
+	
+	public PrivateInner getPrivateInner() {
+	    return new PrivateInner();
+	}
+
+        public PublicInner getPublicInner() {
+            return new PublicInner();
+        }
+	
+        public class PublicInner {
+            
+            public int getX() {
+                return 1;
+            }
+            
+            public String m() {
+                return "m";
+            }
+            
+        }
+        
+        @SuppressWarnings("unused")
+	private class PrivateInner {
+	    
+            public int getX() {
+	        return 2;
+	    }
+	    
+	    public String m() {
+	        return "M";
+	    }
+	    
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestInterface.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestInterface.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestInterface.java
new file mode 100644
index 0000000..291b0cd
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestInterface.java
@@ -0,0 +1,25 @@
+/*
+ * 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.templatesuite.models;
+
+public interface BeanTestInterface<T> {
+    T getSomething();
+    void setSomething(T s);
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestSuperclass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestSuperclass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestSuperclass.java
new file mode 100644
index 0000000..1a689ab
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BeanTestSuperclass.java
@@ -0,0 +1,30 @@
+/*
+ * 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.templatesuite.models;
+
+public class BeanTestSuperclass {
+    public Integer getSomething() {
+        return 42;
+    }
+    
+    public void setSomething(Integer x) {
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndScalarModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndScalarModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndScalarModel.java
new file mode 100644
index 0000000..12e5f3d
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndScalarModel.java
@@ -0,0 +1,40 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+public class BooleanAndScalarModel implements TemplateBooleanModel, TemplateScalarModel {
+
+    public static final BooleanAndScalarModel INSTANCE = new BooleanAndScalarModel();
+
+    @Override
+    public String getAsString() throws TemplateModelException {
+        return "s";
+    }
+
+    @Override
+    public boolean getAsBoolean() throws TemplateModelException {
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndStringTemplateModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndStringTemplateModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndStringTemplateModel.java
new file mode 100644
index 0000000..accf649
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanAndStringTemplateModel.java
@@ -0,0 +1,38 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+public class BooleanAndStringTemplateModel implements TemplateBooleanModel, TemplateScalarModel {
+
+    @Override
+    public String getAsString() throws TemplateModelException {
+        return "theStringValue";
+    }
+
+    @Override
+    public boolean getAsBoolean() throws TemplateModelException {
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash1.java
new file mode 100644
index 0000000..a143cbc
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash1.java
@@ -0,0 +1,58 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+
+/**
+ * Tests the impact that the isEmpty() has on template hash models.
+ */
+public class BooleanHash1 implements TemplateHashModel {
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        if ( key.equals( "temp" )) {
+            return new SimpleScalar( "Hello, world." );
+        } else if ( key.equals( "boolean" )) {
+            return TemplateBooleanModel.FALSE;
+        } else {
+            return new SimpleScalar( "Just another key..." );
+        }
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash2.java
new file mode 100644
index 0000000..070b3e2
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanHash2.java
@@ -0,0 +1,50 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+
+/**
+ * Tests the impact that the isEmpty() has on template hash models.
+ */
+public class BooleanHash2 implements TemplateHashModel {
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        return null;
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList1.java
new file mode 100644
index 0000000..5022f68
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList1.java
@@ -0,0 +1,62 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Model for testing the impact of isEmpty() on template list models. Every
+ * other method simply delegates to a SimpleList model.
+ */
+public class BooleanList1 implements TemplateSequenceModel {
+
+    private SimpleSequence cList;
+
+    /** Creates new BooleanList1 */
+    public BooleanList1(ObjectWrapper ow) {
+        cList = new SimpleSequence(ow);
+        cList.add( "false" );
+        cList.add( "0" );
+        cList.add(TemplateBooleanModel.FALSE);
+        cList.add(TemplateBooleanModel.TRUE);
+        cList.add(TemplateBooleanModel.TRUE);
+        cList.add(TemplateBooleanModel.TRUE);
+        cList.add(TemplateBooleanModel.FALSE);
+    }
+
+    /**
+     * @return the specified index in the list
+     */
+    @Override
+    public TemplateModel get(int i) throws TemplateModelException {
+        return cList.get(i);
+    }
+
+    @Override
+    public int size() {
+        return cList.size();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList2.java
new file mode 100644
index 0000000..2d7667e
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanList2.java
@@ -0,0 +1,53 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Model for testing list models. Every
+ * other method simply delegates to a SimpleList model.
+ */
+public class BooleanList2 implements TemplateSequenceModel {
+
+    private SimpleSequence cList;
+
+    /** Creates new BooleanList2 */
+    public BooleanList2(ObjectWrapper ow) {
+        cList = new SimpleSequence(ow);
+    }
+
+    /**
+     * @return the specified index in the list
+     */
+    @Override
+    public TemplateModel get(int i) throws TemplateModelException {
+        return cList.get(i);
+    }
+
+    @Override
+    public int size() {
+        return cList.size();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanVsStringMethods.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanVsStringMethods.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanVsStringMethods.java
new file mode 100644
index 0000000..45c0542
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/BooleanVsStringMethods.java
@@ -0,0 +1,40 @@
+/*
+ * 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.templatesuite.models;
+
+public class BooleanVsStringMethods {
+    
+    public String expectsString(String s) {
+        return s;
+    }
+
+    public boolean expectsBoolean(boolean b) {
+        return b;
+    }
+    
+    public String overloaded(String s) {
+        return "String " + s;
+    }
+    
+    public String overloaded(boolean s) {
+        return "boolean " + s;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/EnumTestClass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/EnumTestClass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/EnumTestClass.java
new file mode 100644
index 0000000..5ad85f5
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/EnumTestClass.java
@@ -0,0 +1,34 @@
+/*
+ * 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.templatesuite.models;
+
+/**
+ */
+public enum EnumTestClass
+{
+    ONE, 
+    TWO, 
+    THREE;
+    
+    @Override
+    public String toString() {
+        return name() + "x";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/ExceptionModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/ExceptionModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/ExceptionModel.java
new file mode 100644
index 0000000..940579a
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/ExceptionModel.java
@@ -0,0 +1,39 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+/**
+ * A template that always throws an exception whenever we call getAsString()
+ */
+public class ExceptionModel implements TemplateScalarModel {
+
+    /**
+     * Returns the scalar's value as a String.
+     *
+     * @return the String value of this scalar.
+     */
+    @Override
+    public String getAsString () throws TemplateModelException {
+        throw new TemplateModelException( "Throwing from ExceptionModel!" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/HashAndScalarModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/HashAndScalarModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/HashAndScalarModel.java
new file mode 100644
index 0000000..a5869a2
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/HashAndScalarModel.java
@@ -0,0 +1,84 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateCollectionModel;
+import org.apache.freemarker.core.model.TemplateHashModelEx;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateModelIterator;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+
+public class HashAndScalarModel implements TemplateHashModelEx, TemplateScalarModel {
+    
+    public static final HashAndScalarModel INSTANCE = new HashAndScalarModel();
+    
+    private final TemplateCollectionModel EMPTY_COLLECTION = new TemplateCollectionModel() {
+
+        @Override
+        public TemplateModelIterator iterator() throws TemplateModelException {
+            return new TemplateModelIterator() {
+
+                @Override
+                public TemplateModel next() throws TemplateModelException {
+                    return null;
+                }
+
+                @Override
+                public boolean hasNext() throws TemplateModelException {
+                    return false;
+                }
+                
+            };
+        }
+    };
+
+    @Override
+    public String getAsString() throws TemplateModelException {
+        return "scalarValue";
+    }
+
+    @Override
+    public TemplateModel get(String key) throws TemplateModelException {
+        return new SimpleScalar("mapValue for " + key);
+    }
+
+    @Override
+    public boolean isEmpty() throws TemplateModelException {
+        return true;
+    }
+
+    @Override
+    public int size() throws TemplateModelException {
+        return 0;
+    }
+
+    @Override
+    public TemplateCollectionModel keys() throws TemplateModelException {
+        return EMPTY_COLLECTION;
+    }
+
+    @Override
+    public TemplateCollectionModel values() throws TemplateModelException {
+        return EMPTY_COLLECTION;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/JavaObjectInfo.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/JavaObjectInfo.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/JavaObjectInfo.java
new file mode 100644
index 0000000..aa6d618
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/JavaObjectInfo.java
@@ -0,0 +1,35 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.util._StringUtil;
+
+public class JavaObjectInfo {
+    
+    public static final Object INSTANCE = new JavaObjectInfo();
+
+    private JavaObjectInfo() { }
+    
+    public String info(Object o) {
+        if (o == null) return "null";
+        return o.getClass().getName() + " " + _StringUtil.jQuote(o.toString());
+    }
+
+}


[02/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps.ftl
deleted file mode 100644
index 81c0b8f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-regexps.ftl
+++ /dev/null
@@ -1,136 +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.
--->
-${"test"?matches('test')?string} == true
-${"test"?matches('test', '')?string} == true
-
-${"TEST"?matches('test')?string} == false
-${"TEST"?matches('test', 'i')?string} == true
-
-${"test\nfoo"?matches('.*^foo')?string} == false
-${"test\nfoo"?matches(r'.*\n^foo', 'm')?string} == true
-
-${"test\nfoo"?matches('test.foo')?string} == false
-${"test\nfoo"?matches('test.foo', 's')?string} == true
-
-${"test\nFoo"?matches('.*foo', 's')?string} == false
-${"test\nFoo"?matches('.*foo', 'i')?string} == false
-${"test\nFoo"?matches('.*foo', 'im')?string} == false
-${"test\nFoo"?matches('.*foo', 'si')?string} == true
-${"test\nFoo"?matches('.*foo', 'is')?string} == true
-${"test\nFoo"?matches('.*foo', 'mis')?string} == true
-
-${"test\nFoo"?matches('.*\n^foo', 'm')?string} == false
-${"test\nFoo"?matches('.*\n^foo', 'i')?string} == false
-${"test\nFoo"?matches('.*\n^foo', 'im')?string} == true
-${"test\nFoo"?matches('.*\n^foo', 'mi')?string} == true
-${"test\nFoo"?matches('.*^foo', 'ism')?string} == true
-${"test\nFoo"?matches('.*^foo', 'smi')?string} == true
-<#setting boolean_format="True,False">
-<@assert test=false?matches('[eslaF]+') />
-<@assert test='False'?matches('[eslaF]+') />
-
-<#assign s = "Code without test coverage\nis considered to be BROKEN">
-
-Lower 'c'-words:
-<#list s?matches('c[a-z]*') as m>
-- ${m}
-</#list>
-
-Any 'c'-words:
-<#list s?matches('c[a-z]*', 'i') as m>
-- ${m}
-</#list>  
-
-Lower line-last words:
-<#list s?matches('[a-z]+$', 'm') as m>
-- ${m}
-</#list>  
-
-Any line-last words:
-<#list s?matches('[a-z]+$', 'mi') as m>
-- ${m}
-</#list>
-
-Any last words:
-<#list s?matches('[a-z]+$', 'i') as m>
-- ${m}
-</#list>
-
-c-word with follower:
-<#list s?matches('(c[a-z]*+).([a-z]++)', 'is') as m>
-- "${m?j_string}"
-  Groups: <#list m?groups as g>"${g?j_string}"<#if g_has_next>, </#if></#list>
-</#list>
-
-c-word with follower in the same line:
-<#list s?matches('c[a-z]*+.[a-z]++', 'i') as m>
-- ${m}
-</#list>
-
-Lower c-word with follower in the same line:
-<#list s?matches('c[a-z]*+.[a-z]++', '') as m>
-- ${m}
-</#list>
-
-<#attempt>
-  Ignored but logged in 2.3: ${s?matches('broken', 'I')?string} == False
-<#recover>
-  Fails in 2.4
-</#attempt>
-<#attempt>
-  Ignored but logged in 2.3: ${s?matches('broken', 'f')?string} == False
-<#recover>
-  Fails in 2.4
-</#attempt>
-
-${"foobar"?replace("foo", "FOO")} == FOObar
-${"Foobar"?replace("foo", "FOO", "")} == Foobar
-${"Foobar"?replace("foo", "FOO", "i")} == FOObar
-${"FoobarfOO"?replace("foo", "FOO", "i")} == FOObarFOO
-${"FoobarfOO"?replace("foo", "FOO", "if")} == FOObarfOO
-${"FoobarfOO"?replace("foo", "FOO", "fi")} == FOObarfOO
-${"Foobar"?replace("foo", "FOO", "r")} == Foobar
-${"Foobar"?replace("foo", "FOO", "ri")} == FOObar
-${"FoobarfOO"?replace("foo", "FOO", "ri")} == FOObarFOO
-${"FoobarfOO"?replace("foo", "FOO", "rif")} == FOObarfOO
-${"FoobarfOO"?replace("foo", "FOO", "fri")} == FOObarfOO
-${"foobar"?replace("fo+", "FOO")} == foobar
-${"foobar"?replace("fo+", "FOO", "")} == foobar
-${"foobar"?replace("fo+", "FOO", "r")} == FOObar
-${"foobarfOo"?replace("fo+", "FOO", "ri")} == FOObarFOO
-${"foobarfOo"?replace("fo+", "FOO", "rif")} == FOObarfOo
-${false?replace('a', 'A')} == FAlse
-${false?replace('[abc]', 'A', 'r')} == FAlse
-
-<#attempt>
-  Ignored but logged in 2.3: ${"foobar"?replace("foo", "FOO", "c")}
-<#recover>
-  Fails in 2.4
-</#attempt>
-
-<#macro dumpList xs>[<#list xs as x>${x}<#if x_has_next>, </#if></#list>]</#macro>
-<@dumpList "fooXbarxbaaz"?split("X") /> == [foo, barxbaaz]
-<@dumpList "fooXbarxbaaz"?split("X", "") /> == [foo, barxbaaz]
-<@dumpList "fooXbarxbaaz"?split("X", "i") /> == [foo, bar, baaz]
-<@dumpList "fooXbarxbaaz"?split("X", "r") /> == [foo, barxbaaz]
-<@dumpList "fooXbarxbaaz"?split("X", "ri") /> == [foo, bar, baaz]
-<@dumpList "fooXXbarxxbaaz"?split("X+", "i") /> == [fooXXbarxxbaaz]
-<@dumpList "fooXXbarxxbaaz"?split("X+", "ri") /> == [foo, bar, baaz]
-<@dumpList false?split("[ae]", "r") /> == [F, ls]
-<@dumpList false?split("e") /> == [Fals, ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
deleted file mode 100644
index 0e18520..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
+++ /dev/null
@@ -1,129 +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.
--->
-FreeMarker: Encoding string built-in tests
-
-<#assign x = r'  dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  '>
-  
-cap_first:  ${x?cap_first}
-uncap_first:${x?uncap_first}
-uncap_first:${"Blah"?uncap_first}
-capitalize: ${x?capitalize}
-html:       ${x?html}
-length:     ${x?length}
-lower_case: ${x?lower_case}
-rtf:        ${x?rtf}
-trim:       ${x?trim}
-trim2:      ${"foo bar"?trim}
-trim3:      ${" foo bar"?trim}
-trim4:      ${"foo bar "?trim}
-upper_case: ${x?upper_case}
-xml:        ${x?xml}
-xhtml:      ${"\"Blah's is > 1 & < 2\""?xhtml}
-<@assertEquals actual="'"?html expected="&#39;" />
-<@assertEquals actual="'"?xhtml expected="&#39;" />
-<@assertEquals actual="'"?xml expected="&apos;" />
-<#-- ?substring: -->
-<@assertEquals actual="ab"?substring(0) expected="ab" />
-<@assertEquals actual="ab"?substring(1) expected="b" />
-<@assertEquals actual="ab"?substring(2) expected="" />
-<@assertFails message="at least 0">${"ab"?substring(-1)}</@><#t>
-<@assertFails message="greater than the length of the string">${"ab"?substring(3)}</@><#t>
-<@assertEquals actual="ab"?substring(0, 0) expected="" />
-<@assertEquals actual="ab"?substring(0, 1) expected="a" />
-<@assertEquals actual="ab"?substring(0, 2) expected="ab" />
-<@assertFails message="at least 0">${"ab"?substring(0, -1)}</@><#t>
-<@assertFails message="greater than the length of the string">${"ab"?substring(0, 3)}</@><#t>
-<@assertEquals actual="ab"?substring(1, 1) expected="" />
-<@assertEquals actual="ab"?substring(1, 2) expected="b" />
-<@assertFails message="at least 0">${"ab"?substring(1, -1)}</@><#t>
-<@assertFails message="greater than the length of the string">${"ab"?substring(1, 3)}</@><#t>
-<@assertFails message="shouldn't be greater than the end index">${"ab"?substring(1, 0)}</@><#t>
-
-word_list:
-<#global words = x?word_list>
-<#list words as w>- ${w}
-</#list>
-
-<#global canufeelitbabe = x?interpret>
-interpret: <@canufeelitbabe></@>
-<#setting locale="es_ES">number: ${"-123.45"?number + 1.1}
-${"1.5e3"?number?c}
-${"0005"?number?c}
-${"+0"?number?c}
-${"-0"?number?c}
-${"NaN"?number?is_nan?c}
-${("INF"?number?is_infinite && "INF"?number > 0)?c}
-${("-INF"?number?is_infinite && "-INF"?number < 0)?c}
-${("Infinity"?number?is_infinite && "Infinity"?number > 0)?c}
-${("-Infinity"?number?is_infinite && "-Infinity"?number < 0)?c}
-
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new()}
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new(1)}
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("xxx")}
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("xxx", "yyy")}
-
-<#assign x = "In the beginning, God created the Heavens and The Earth.">
-
-${x?replace("the", "The Sacred, Holy", "i")} <#-- case insensitive replacement -->
-${x?replace("the", "the very", "f")} <#-- replace only the first one -->
-${x?replace("", "|")} <#-- replace empry string -->
-${x?replace("", "|", "f")} <#-- replace first empty string -->
-
-${x?replace("the H[a-z]+", "the sky", "r")} <#-- regexp replacement -->
-
-<#if x?matches(".*Heav..s.*")>matches<#else>Really?</#if>
-
-<#list x?matches("(the) ([a-z]+)", "i") as match>
-  ${match}
-  ${match?groups[1]} sacred ${match?groups[2]}
-</#list>  
-
-<#assign matches = x?matches("In the ([a-z]+), God created (.*)")>
-${matches?groups[0]}
-${matches?groups[1]}
-${matches?groups[2]}
-
-<#assign x="foo, bar;baz,     foobar">
-<#list x?split("[,;] ?", "r") as word>
-   ${word}
-</#list>
-
-
-<#assign a = "foo", b="bar", c="(a+b)?upper_case">
-${c?eval}
-
-[${"a"?j_string}] = [a]
-[${"a\\'x'\nb"?j_string}] = [a\\'x'\nb]
-[${"\x1\x1A\x20"?j_string}] = [\u0001\u001a ]
-
-[${"a"?js_string}] = [a]
-[${"a\\'x'\nb"?js_string}] = [a\\\'x\'\nb]
-[${"\x1\x1A\x20"?js_string}] = [\x01\x1A ]
-[${"<![CDATA["?js_string}] = [\x3C![CDATA[]
-[${"]]>"?js_string}] = []]\>]
-
-[${"a"?json_string}] = [a]
-[${"a\\'x'\nb"?json_string}] = [a\\'x'\nb]
-[${"\x1\x1A\x20"?json_string}] = [\u0001\u001A ]
-[${"\n\r\t\f\b\""?json_string}] = [\n\r\t\f\b\"]
-[${"/"?json_string}] = [\/]
-[${"a/b"?json_string}] = [a/b]
-[${"</script>"?json_string}] = [<\/script>]
-[${"<![CDATA["?json_string}] = [\u003C![CDATA[]
-[${"]]>"?json_string}] = []]\u003E]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins2.ftl
deleted file mode 100644
index c9294fa..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins2.ftl
+++ /dev/null
@@ -1,135 +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.
--->
---
-<#assign s = "abbcdbb">
-${s?index_of("bb")} = 1
-${s?index_of("bb", 2)} = 5
-${s?index_of("")} = 0
---
-${s?last_index_of("bb")} = 5
-${s?last_index_of("bb", 4)} = 1
-${s?last_index_of("")} = ${s?length}
---
-${s?starts_with("abb")?string} = true
-${s?starts_with("bb")?string} = false
-${s?starts_with("")?string} = true
---
-${s?ends_with("dbb")?string} = true
-${s?ends_with("cbb")?string} = false
-${s?ends_with("")?string} = true
---
-${s?contains("abb")?string} = true
-${s?contains("bcd")?string} = true
-${s?contains("dbb")?string} = true
-${s?contains("bbx")?string} = false
-${s?contains("")?string} = true
---
-[${s?chop_linebreak}] = [abbcdbb]
-[${"qwe\n"?chop_linebreak}] = [qwe]
-[${"qwe\r"?chop_linebreak}] = [qwe]
-[${"qwe\r\n"?chop_linebreak}] = [qwe]
-[${"qwe\r\n\r\n"?chop_linebreak}] = [qwe
-]
-[${"qwe\n\n"?chop_linebreak}] = [qwe
-]
---
-[${s?replace("A", "-")}] = [abbcdbb]
-[${s?replace("c", "-")}] = [abb-dbb]
-[${s?replace("bb", "-=*")}] = [a-=*cd-=*]
---
-<#assign ls = s?split("b")>
-<#list ls as i>[${i}]</#list> == [a][][cd][][]
-<#list "--die--maggots--!"?split("--") as i>[${i}]</#list> == [][die][maggots][!]
-<#list "Die maggots!"?split("--") as i>[${i}]</#list> == [Die maggots!]
---
-[${""?left_pad(5)}]
-[${"a"?left_pad(5)}]
-[${"ab"?left_pad(5)}]
-[${"abc"?left_pad(5)}]
-[${"abcd"?left_pad(5)}]
-[${"abcde"?left_pad(5)}]
-[${"abcdef"?left_pad(5)}]
-[${"abcdefg"?left_pad(5)}]
-[${"abcdefgh"?left_pad(5)}]
-[${""?left_pad(5, "-")}]
-[${"a"?left_pad(5, "-")}]
-[${"ab"?left_pad(5, "-")}]
-[${"abc"?left_pad(5, "-")}]
-[${"abcd"?left_pad(5, "-")}]
-[${"abcde"?left_pad(5, "-")}]
-[${"abcdef"?left_pad(5, "-")}]
-[${"abcdefg"?left_pad(5, "-")}]
-[${"abcdefgh"?left_pad(5, "-")}]
-[${""?left_pad(8, ".oO")}]
-[${"a"?left_pad(8, ".oO")}]
-[${"ab"?left_pad(8, ".oO")}]
-[${"abc"?left_pad(8, ".oO")}]
-[${"abcd"?left_pad(8, ".oO")}]
-[${"abcde"?left_pad(8, ".oO")}]
-[${"abcdef"?left_pad(8, ".oO")}]
-[${"abcdefg"?left_pad(8, ".oO")}]
-[${"abcdefgh"?left_pad(8, ".oO")}]
-[${"abcdefghi"?left_pad(8, ".oO")}]
-[${"abcdefghij"?left_pad(8, ".oO")}]
-[${""?left_pad(0, r"/\_")}]
-[${""?left_pad(1, r"/\_")}]
-[${""?left_pad(2, r"/\_")}]
-[${""?left_pad(3, r"/\_")}]
-[${""?left_pad(4, r"/\_")}]
-[${""?left_pad(5, r"/\_")}]
-[${""?left_pad(6, r"/\_")}]
-[${""?left_pad(7, r"/\_")}]
---
-[${""?right_pad(5)}]
-[${"a"?right_pad(5)}]
-[${"ab"?right_pad(5)}]
-[${"abc"?right_pad(5)}]
-[${"abcd"?right_pad(5)}]
-[${"abcde"?right_pad(5)}]
-[${"abcdef"?right_pad(5)}]
-[${"abcdefg"?right_pad(5)}]
-[${"abcdefgh"?right_pad(5)}]
-[${""?right_pad(5, "-")}]
-[${"a"?right_pad(5, "-")}]
-[${"ab"?right_pad(5, "-")}]
-[${"abc"?right_pad(5, "-")}]
-[${"abcd"?right_pad(5, "-")}]
-[${"abcde"?right_pad(5, "-")}]
-[${"abcdef"?right_pad(5, "-")}]
-[${"abcdefg"?right_pad(5, "-")}]
-[${"abcdefgh"?right_pad(5, "-")}]
-[${""?right_pad(8, ".oO")}]
-[${"a"?right_pad(8, ".oO")}]
-[${"ab"?right_pad(8, ".oO")}]
-[${"abc"?right_pad(8, ".oO")}]
-[${"abcd"?right_pad(8, ".oO")}]
-[${"abcde"?right_pad(8, ".oO")}]
-[${"abcdef"?right_pad(8, ".oO")}]
-[${"abcdefg"?right_pad(8, ".oO")}]
-[${"abcdefgh"?right_pad(8, ".oO")}]
-[${"abcdefghi"?right_pad(8, ".oO")}]
-[${"abcdefghij"?right_pad(8, ".oO")}]
-[${""?right_pad(0, r"/\_")}]
-[${""?right_pad(1, r"/\_")}]
-[${""?right_pad(2, r"/\_")}]
-[${""?right_pad(3, r"/\_")}]
-[${""?right_pad(4, r"/\_")}]
-[${""?right_pad(5, r"/\_")}]
-[${""?right_pad(6, r"/\_")}]
-[${""?right_pad(7, r"/\_")}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins3.ftl
deleted file mode 100644
index 77389fa..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins3.ftl
+++ /dev/null
@@ -1,225 +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.
--->
-<@assertEquals expected='foo' actual='foo'?keep_before('x') />
-<@assertEquals expected='f' actual='foo'?keep_before('o') />
-<@assertEquals expected='' actual='foo'?keep_before('f') />
-<@assertEquals expected='fo' actual='foobar'?keep_before('ob') />
-<@assertEquals expected='foob' actual='foobar'?keep_before('ar') />
-<@assertEquals expected='' actual='foobar'?keep_before('foobar') />
-<@assertEquals expected='' actual='foobar'?keep_before('') />
-<@assertEquals expected='' actual='foobar'?keep_before('', 'r') />
-<@assertEquals expected='FOO' actual='FOO'?keep_before('o') />
-<@assertEquals expected='F' actual='FOO'?keep_before('o', 'i') />
-<@assertEquals expected='fo' actual='fo.o'?keep_before('.') />
-<@assertEquals expected='' actual='fo.o'?keep_before('.', 'r') />
-<@assertEquals expected='FOOb' actual='FOObaar'?keep_before(r'([a-z])\1', 'r') />
-<@assertEquals expected='F' actual='FOObaar'?keep_before(r'([a-z])\1', 'ri') />
-<@assertEquals expected='foo' actual="foo : bar"?keep_before(r"\s*:\s*", "r") />
-<@assertEquals expected='foo' actual="foo:bar"?keep_before(r"\s*:\s*", "r") />
-<@assertFails message='"m" flag'>
-    ${'x'?keep_before('x', 'm')}
-</...@assertFails>
-<@assertFails message='3'>
-    ${'x'?keep_before('x', 'i', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?keep_before()}
-</...@assertFails>
-
-<@assertEquals expected='' actual=''?keep_before_last('f') />
-<@assertEquals expected='ff' actual='fff'?keep_before_last('f') />
-<@assertEquals expected='' actual='foo'?keep_before_last('f') />
-<@assertEquals expected='' actual='f'?keep_before_last('f') />
-<@assertEquals expected='a.b' actual='a.b.txt'?keep_before_last('.') />
-<@assertEquals expected='ab' actual='ab'?keep_before_last('.') />
-<@assertEquals expected='a' actual='ab'?keep_before_last('.', 'r') />
-<@assertEquals expected='ab' actual='ab'?keep_before_last(r'\.', 'r') />
-<@assertEquals expected='af' actual='afFf'?keep_before_last('F') />
-<@assertEquals expected='afF' actual='afFf'?keep_before_last('F', 'i') />
-<@assertEquals expected='1a2' actual='1a2b3'?keep_before_last('[ab]', 'r') />
-<@assertEquals expected='aa' actual='aaabb'?keep_before_last('[ab]{3}', 'r') />
-<@assertEquals expected='aaabbx' actual='aaabbxbabe'?keep_before_last('[ab]{3}', 'r') />
-<@assertEquals expected='xxxaa' actual='xxxaaayyy'?keep_before_last('a+', 'r') />
-<@assertEquals expected='foobar' actual='foobar'?keep_before_last('') />
-<@assertEquals expected='foobar' actual='foobar'?keep_before_last('', 'r') />
-<@assertFails message='"m" flag'>
-    ${'x'?keep_before_last('x', 'm')}
-</...@assertFails>
-<@assertFails message='3'>
-    ${'x'?keep_before_last('x', 'i', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?keep_before_last()}
-</...@assertFails>
-
-<@assertEquals expected='' actual='foo'?keep_after('x') />
-<@assertEquals expected='o' actual='foo'?keep_after('o') />
-<@assertEquals expected='oo' actual='foo'?keep_after('f') />
-<@assertEquals expected='ar' actual='foobar'?keep_after('ob') />
-<@assertEquals expected='' actual='foobar'?keep_after('ar') />
-<@assertEquals expected='' actual='foobar'?keep_after('foobar') />
-<@assertEquals expected='foobar' actual='foobar'?keep_after('') />
-<@assertEquals expected='foobar' actual='foobar'?keep_after('', 'r') />
-<@assertEquals expected='' actual='FOO'?keep_after('o') />
-<@assertEquals expected='O' actual='FOO'?keep_after('o', 'i') />
-<@assertEquals expected='o' actual='fo.o'?keep_after('.') />
-<@assertEquals expected='o.o' actual='fo.o'?keep_after('.', 'r') />
-<@assertEquals expected='r' actual='FOObaar'?keep_after(r'([a-z])\1', 'r') />
-<@assertEquals expected='baar' actual='FOObaar'?keep_after(r'([a-z])\1', 'ri') />
-<@assertEquals expected='bar' actual="foo : bar"?keep_after(r"\s*:\s*", "r") />
-<@assertEquals expected='bar' actual="foo:bar"?keep_after(r"\s*:\s*", "r") />
-<@assertFails message='"m" flag'>
-    ${'x'?keep_after('x', 'm')}
-</...@assertFails>
-<@assertFails message='3'>
-    ${'x'?keep_after('x', 'i', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?keep_after()}
-</...@assertFails>
-
-<@assertEquals expected='' actual=''?keep_after_last('f') />
-<@assertEquals expected='' actual='fff'?keep_after_last('f') />
-<@assertEquals expected='' actual='oof'?keep_after_last('f') />
-<@assertEquals expected='' actual='f'?keep_after_last('f') />
-<@assertEquals expected='txt' actual='a.b.txt'?keep_after_last('.') />
-<@assertEquals expected='' actual='ab'?keep_after_last('.') />
-<@assertEquals expected='' actual='ab'?keep_after_last('.', 'r') />
-<@assertEquals expected='' actual='ab'?keep_after_last(r'\.', 'r') />
-<@assertEquals expected='fa' actual='fFfa'?keep_after_last('F') />
-<@assertEquals expected='a' actual='fFfa'?keep_after_last('F', 'i') />
-<@assertEquals expected='3' actual='1a2b3'?keep_after_last('[ab]', 'r') />
-<@assertEquals expected='' actual='aaabb'?keep_after_last('[ab]{3}', 'r') />
-<@assertEquals expected='x' actual='aaabbx'?keep_after_last('[ab]{3}', 'r') />
-<@assertEquals expected='e' actual='aaabbxbabe'?keep_after_last('[ab]{3}', 'r') />
-<@assertEquals expected='12345' actual='aaabb12345'?keep_after_last('[ab]{3}', 'r') />
-<@assertEquals expected='yyy' actual='xxxaaayyy'?keep_after_last('a+', 'r') />
-<@assertEquals expected='' actual='foobar'?keep_after_last('') />
-<@assertEquals expected='' actual='foobar'?keep_after_last('', 'r') />
-<@assertFails message='"m" flag'>
-    ${'x'?keep_after_last('x', 'm')}
-</...@assertFails>
-<@assertFails message='3'>
-    ${'x'?keep_after_last('x', 'i', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?keep_after_last()}
-</...@assertFails>
-
-<@assertEquals expected='foo' actual='foo'?remove_beginning('x') />
-<@assertEquals expected='foo' actual='foo'?remove_beginning('o') />
-<@assertEquals expected='foo' actual='foo'?remove_beginning('fooo') />
-<@assertEquals expected='oo' actual='foo'?remove_beginning('f') />
-<@assertEquals expected='o' actual='foo'?remove_beginning('fo') />
-<@assertEquals expected='' actual='foo'?remove_beginning('foo') />
-<@assertEquals expected='foo' actual='foo'?remove_beginning('') />
-<@assertFails message='2'>
-    ${'x'?remove_beginning('x', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?remove_beginning()}
-</...@assertFails>
-
-<@assertEquals expected='bar' actual='bar'?remove_ending('x') />
-<@assertEquals expected='bar' actual='bar'?remove_ending('a') />
-<@assertEquals expected='bar' actual='bar'?remove_ending('barr') />
-<@assertEquals expected='ba' actual='bar'?remove_ending('r') />
-<@assertEquals expected='b' actual='bar'?remove_ending('ar') />
-<@assertEquals expected='' actual='bar'?remove_ending('bar') />
-<@assertEquals expected='bar' actual='bar'?remove_ending('') />
-<@assertFails message='2'>
-    ${'x'?remove_ending('x', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?remove_ending()}
-</...@assertFails>
-
-<@assertEquals expected='xfoo' actual='foo'?ensure_starts_with('x') />
-<@assertEquals expected='foo' actual='foo'?ensure_starts_with('f') />
-<@assertEquals expected='foo' actual='foo'?ensure_starts_with('foo') />
-<@assertEquals expected='fooofoo' actual='foo'?ensure_starts_with('fooo') />
-<@assertEquals expected='foo' actual='foo'?ensure_starts_with('') />
-<@assertEquals expected='x' actual=''?ensure_starts_with('x') />
-<@assertEquals expected='' actual=''?ensure_starts_with('') />
-<@assertEquals expected='bacdef' actual="bacdef"?ensure_starts_with("[ab]{2}", "ab") />
-<@assertEquals expected='bacdef' actual="bacdef"?ensure_starts_with("^[ab]{2}", "ab") />
-<@assertEquals expected='abcacdef' actual="cacdef"?ensure_starts_with("[ab]{2}", "ab") />
-<@assertEquals expected='abcacdef' actual="cacdef"?ensure_starts_with("^[ab]{2}", "ab") />
-<@assertEquals expected='ab!cdef' actual="cdef"?ensure_starts_with("ab", "ab!") />
-<@assertEquals expected='ab!ABcdef' actual="ABcdef"?ensure_starts_with("ab", "ab!") />
-<@assertEquals expected='ABcdef' actual="ABcdef"?ensure_starts_with("ab", "ab!", 'i') />
-<@assertEquals expected='abABcdef' actual="ABcdef"?ensure_starts_with(".b", "ab", 'i') />
-<@assertEquals expected='ABcdef' actual="ABcdef"?ensure_starts_with(".b", "ab", 'ri') />
-<@assertEquals expected='http://example.com' actual="example.com"?ensure_starts_with("[a-z]+://", "http://") />
-<@assertEquals expected='http://example.com' actual="http://example.com"?ensure_starts_with("[a-z]+://", "http://") />
-<@assertEquals expected='https://example.com' actual="https://example.com"?ensure_starts_with("[a-z]+://", "http://") />
-<@assertEquals expected='http://HTTP://example.com' actual="HTTP://example.com"?ensure_starts_with("[a-z]+://", "http://") />
-<@assertEquals expected='HTTP://example.com' actual="HTTP://example.com"?ensure_starts_with("[a-z]+://", "http://", "ir") />
-<@assertFails message='4'>
-    ${'x'?ensure_starts_with('x', 'x', 'x', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?ensure_starts_with()}
-</...@assertFails>
-
-<@assertEquals expected='foox' actual='foo'?ensure_ends_with('x') />
-<@assertEquals expected='foo' actual='foo'?ensure_ends_with('o') />
-<@assertEquals expected='foo' actual='foo'?ensure_ends_with('foo') />
-<@assertEquals expected='foofooo' actual='foo'?ensure_ends_with('fooo') />
-<@assertEquals expected='foo' actual='foo'?ensure_ends_with('') />
-<@assertEquals expected='x' actual=''?ensure_ends_with('x') />
-<@assertEquals expected='' actual=''?ensure_ends_with('') />
-<@assertFails message='2'>
-    ${'x'?ensure_ends_with('x', 'x')}
-</...@assertFails>
-<@assertFails message='none'>
-    ${'x'?ensure_ends_with()}
-</...@assertFails>
-
-<@assertEquals expected='a' actual=1?lower_abc />
-<@assertEquals expected='b' actual=2?lower_abc />
-<@assertEquals expected='z' actual=26?lower_abc />
-<@assertEquals expected='aa' actual=27?lower_abc />
-<@assertEquals expected='ab' actual=28?lower_abc />
-<@assertEquals expected='cv' actual=100?lower_abc />
-<@assertFails messageRegexp='0|at least 1']>
-    ${0?lower_abc}
-</...@assertFails>
-<@assertFails messageRegexp='0|at least 1'>
-    ${-1?lower_abc}
-</...@assertFails>
-<@assertFails messageRegexp='1.00001|integer'>
-    ${1.00001?lower_abc}
-</...@assertFails>
-
-<@assertEquals expected='A' actual=1?upper_abc />
-<@assertEquals expected='B' actual=2?upper_abc />
-<@assertEquals expected='Z' actual=26?upper_abc />
-<@assertEquals expected='AA' actual=27?upper_abc />
-<@assertEquals expected='AB' actual=28?upper_abc />
-<@assertEquals expected='CV' actual=100?upper_abc />
-<@assertFails messageRegexp='0|at least 1']>
-    ${0?upper_abc}
-</...@assertFails>
-<@assertFails messageRegexp='0|at least 1'>
-    ${-1?upper_abc}
-</...@assertFails>
-<@assertFails messageRegexp='1.00001|integer'>
-    ${1.00001?upper_abc}
-</...@assertFails>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringbimethods.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringbimethods.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringbimethods.ftl
deleted file mode 100644
index 1d31c44..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringbimethods.ftl
+++ /dev/null
@@ -1,36 +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.
--->
-<#setting locale="en_US">
-<#assign x = 3>
-${x?string["0.00"]}
-${x?string("0.00")}
-${'01:02:03'?time.iso?string["iso ms nz"]}
-${'01:02:03'?time.iso?string("iso ms nz")}
----
-${multi}
-<#assign a = true>
-<#assign b = false>
-${a?string} ${b?string}
-${a?string("yes", "no")} ${b?string("yes", "no")}
-<#setting boolean_format="igen,nem"/>
-${a?string} ${b?string}
-<#setting number_format="0.0">
-${a?string(0, 1)} ${b?string(0, 1)}
-<#setting boolean_format="true,false"/>
-${a?string(0, 1)?is_string?string} ${b?string(0, 1)?is_string?string}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringliteral.ftl
deleted file mode 100644
index 436c632..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/stringliteral.ftl
+++ /dev/null
@@ -1,69 +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.
--->
-<html>
-<head>
-  <title>FreeMarker: String literal test</title>
-  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<#assign x = "Hello", y = "World">
-<#assign message = "${x}, ${y}!">
-
-${message}
-
-<p>
-[${""}] = []<br>
-[${"a"}] = [a]<br>
-[${"abcdef"}] = [abcdef]<br>
-[${"\""}] = ["]<br>
-[${"\"\"\""}] = ["""]<br>
-[${"a\""}] = [a"]<br>
-[${"\"a"}] = ["a]<br>
-[${"a\"b"}] = [a"b]<br>
-[${"a\nb"}] = [a
-b]<br>
-[${"'"}] = [']<br>
-[${"a'a"}] = [a'a]<br>
-[${"\"\'\n\r\f\b\t\l\a\g"}]<br>
-[${"\xA\x0A\x00A\x000A\x0000A"}]<br>
-[${"\x15Bz\x15b"}]<br>
-[${"\x010Cz\x010c"}]<br>
-
-<p>
-[${''}] = []<br>
-[${'a'}] = [a]<br>
-[${'abcdef'}] = [abcdef]<br>
-[${'"'}] = ["]<br>
-[${'"""'}] = ["""]<br>
-[${'a"'}] = [a"]<br>
-[${'"a'}] = ["a]<br>
-[${'a"b'}] = [a"b]<br>
-[${'a\nb'}] = [a
-b]<br>
-[${'\''}] = [']<br>
-[${'a\'a'}] = [a'a]<br>
-[${'\"\'\n\r\f\b\t\l\a\g'}]<br>
-[${'\xA\x0A\x00A\x000A\x0000A'}]<br>
-[${'\x15Bz\x15b'}]<br>
-[${'\x010Cz\x010c'}]<br>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir.ftl
deleted file mode 100644
index cd24873..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir.ftl
+++ /dev/null
@@ -1,27 +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.
--->
-<p>This is include-subdir.ftl</p>
-<p>Testing including from same directory</p>
-<#include "include-subdir2.ftl">
-<p>Testing including from relative parent</p>
-<#include "../included.ftl">
-<p>Testing including from loader root</p>
-<#include "/included.ftl">
-<p>Testing including through acquisition</p>
-<#include "*/subdir/include-subdir2.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir2.ftl
deleted file mode 100644
index 356fcb2..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/include-subdir2.ftl
+++ /dev/null
@@ -1,19 +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.
--->
-<p>This is include-subdir2.ftl</p>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin-2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin-2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin-2.ftl
deleted file mode 100644
index 687661b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin-2.ftl
+++ /dev/null
@@ -1,24 +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.
--->
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("works")}
-<#attempt>
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel2"?new("works")}
-<#recover>
-fails
-</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin.ftl
deleted file mode 100644
index 242d221..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/new-optin.ftl
+++ /dev/null
@@ -1,26 +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.
--->
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("works")}
-<#attempt>
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel2"?new("works")}
-<#recover>
-fails
-</#attempt>
-
-<#include "new-optin-2.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/subsub/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/subsub/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/subsub/new-optin.ftl
deleted file mode 100644
index 687661b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/subdir/subsub/new-optin.ftl
+++ /dev/null
@@ -1,24 +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.
--->
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("works")}
-<#attempt>
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel2"?new("works")}
-<#recover>
-fails
-</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch-builtin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch-builtin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch-builtin.ftl
deleted file mode 100644
index 7441733..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch-builtin.ftl
+++ /dev/null
@@ -1,54 +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.
--->
-<@assertEquals expected="A" actual="a"?switch("a", "A") />
-<@assertFails message="didn't match">${"b"?switch("a", "A")}</@>
-<@assertEquals expected="D" actual="b"?switch("a", "A", "D") />
-<@assertEquals expected="B" actual="b"?switch("a", "A", "b", "B") />
-<@assertFails message="didn't match">${"c"?switch("a", "A", "b", "B")}</@>
-<@assertEquals expected="D" actual="c"?switch("a", "A", "b", "B", "D") />
-
-<#assign out = "">
-<#assign fInvocationCnt = 0>
-<#list 0..5 as x>
-  <#assign out += x?switch(1, f("one"), 2, f("two"), 3, f("three"), f("default")) + ";">
-</#list>
-<@assertEquals expected="default;one;two;three;default;default;" actual=out />
-<@assertEquals expected=6 actual=fInvocationCnt />
-
-<#assign out = "">
-<#list 0..5 as x>
-  <#assign out += true?switch(x <= 1, "low", x == 2 || x == 3, "medium", x >= 3, "high") + ";">
-</#list>
-<@assertEquals expected="low;low;medium;medium;high;high;" actual=out />
-
-<#function f x>
-  <#assign fInvocationCnt++>
-  <#return x>
-</#function>
-
-<@assertFails message="noSuchVar1">${1?switch(noSuchVar1, noSuchVar2)}</@>
-<@assertFails message="noSuchVar2">${1?switch(1, noSuchVar2)}</@>
-<@assertFails message="noSuchVar3">${noSuchVar3?switch(1, 1)}</@>
-
-<@assertEquals expected="one" actual=1?switch(1, "one", "2", "two") />
-<@assertFails messageRegexp="Can't compare.+number.+string">${2?switch(1, "one", "2", "two")}</@>
-<@assertFails messageRegexp="Can't compare.+number.+string">${2?switch(1, "one", "2", "two", "default")}</@>
-
-<#assign out><#escape x as x?switch(2 * x, "zero", 1, "one", x, x?string("0.0"))>${0} ${1} ${2}</#escape></#assign>
-<@assertEquals expected="zero one 2.0" actual=out />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch.ftl
deleted file mode 100644
index 6bbab3c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/switch.ftl
+++ /dev/null
@@ -1,139 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Switch-Case Test</title>
-</head>
-<body>
-
-<p>Here we iterate over a list of animals.</p>
-<#assign animalList = [ "aardvark", "kiwi", "gecko", "cat", "dog", "elephant",
-    "squirrel", "zebra" ]>
-<#assign favoriteAnimal = "kiwi">
-
-<#list animalList as animal>
-<p>Animal is: ${animal}.<br />
-<#switch animal>
-    <#case "zebra">
-        This is the HTML for a large stripey animal.
-    <#case "elephant">
-    <#case "rhinocerous">
-        This is the HTML for large animals.
-        <#break>
-    <#case "squirrel">
-    <#case "gecko">
-        This is the HTML for small animals.
-        <#break>
-    <#case favoriteAnimal>
-        This is the HTML for the user's favorite animal.
-        <#break>
-    <#default>
-        This is the HTML for other animals.
-        <#break>
-</#switch>
-</p>
-</#list>
-
-<#-- Nesting and no-match -->
-<#list [ 1, 2, 3 ] as x>
-  <#switch x>
-    <#case 1>
-      1
-      <#switch x*2>
-        <#case 1>
-          i1
-          <#break>
-        <#case 2>
-          i2
-          <#break>
-        <#case 3>
-          i3
-          <#break>
-        <#case 4>
-          i4
-          <#break>
-        <#case 6>
-          i6
-          <#break>
-      </#switch>
-      <#break>     
-    <#case 2>
-      2
-      <#switch x*2>
-        <#case 1>
-          i1
-          <#break>
-        <#case 2>
-          i2
-          <#break>
-        <#case 3>
-          i3
-          <#break>
-        <#case 4>
-          i4
-          <#-- falls through -->
-        <#case 5>
-          ft
-          <#-- falls through -->
-      </#switch>
-      ft
-      <#-- falls through -->     
-    <#case 3>
-      3
-      <#switch x*2>
-        <#case 1>
-          i1
-          <#break>
-        <#case 2>
-          i2
-          <#break>
-        <#case 3>
-          i3
-          <#break>
-        <#case 4>
-          i4
-          <#break>
-        <#case 6>
-          i6
-          <#break>
-      </#switch>
-      <#break>     
-  </#switch>
-</#list>
-
-<#-- No match -->
-[<#switch 213>
-  <#case 1>sadas
-</#switch>]
-
-<#-- Fall-through -->
-<#list [ 0, 1, 2, 3, 4 ] as x>
-  "<#switch x><#case 1>1<#case 2>2<#case 3>3<#case 4>4</#switch>"
-</#list>
-
-<#-- Legacy parser bug: #default might not be the last, but it doesn't fall through if called directly -->
-<#list [1, 2, 3, 4, 5] as x>
-  "<#switch x><#case 1>1<#case 2>2<#default>default<#case 4>4<#case 5>5</#switch>"
-</#list>
-
-<#-- two #default-s are parsing error -->
-<@assertFails message="can only have one default"><@"<#switch 1><#case 1><#default><#default></#switch>"?interpret /></@>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/then-builtin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/then-builtin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/then-builtin.ftl
deleted file mode 100644
index de809e1..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/then-builtin.ftl
+++ /dev/null
@@ -1,53 +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.
--->
-<#assign f1InvocationCnt = 0>
-<#assign f2InvocationCnt = 0>
-
-<@assertEquals expected="f1 1" actual=true?then(f1(), f2()) />
-<@assertEquals expected="f2 1" actual=false?then(f1(), f2()) />
-<@assertEquals expected="f1 2" actual=true?then(f1(), f2()) />
-<@assertEquals expected="f2 2" actual=false?then(f1(), f2()) />
-<@assertEquals expected=2 actual=f1InvocationCnt />
-<@assertEquals expected=2 actual=f2InvocationCnt />
-
-<#function f1>
-  <#assign f1InvocationCnt++>
-  <#return "f1 " + f1InvocationCnt>
-</#function>
-
-<#function f2>
-  <#assign f2InvocationCnt++>
-  <#return "f2 " + f2InvocationCnt>
-</#function>
-
-<#assign x = 1>
-<@assertEquals expected='Y' actual=(x < 2 * x)?then(-x < x, false)?then('Y', 'N') />
-
-<@assertEquals expected=1 actual=true?then(x, noSuchVar) />
-<@assertEquals expected=1 actual=false?then(noSuchVar, x) />
-
-<@assertFails message="noSuchVar1">${true?then(noSuchVar1, noSuchVar2)}</@>
-<@assertFails message="noSuchVar2">${false?then(noSuchVar1, noSuchVar2)}</@>
-<@assertFails message="noSuchVar3">${noSuchVar3?then(noSuchVar1, noSuchVar2)}</@>
-
-<#assign out><#escape x as x?then(1, 0)>${false} ${true}</#escape></#assign>
-<@assertEquals expected="0 1" actual=out />
-
-<#assign out><#escape x as (x < 0)?then(-x * 3, x * 2)>${-1} ${1}</#escape></#assign>
-<@assertEquals expected="3 2" actual=out />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/transforms.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/transforms.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/transforms.ftl
deleted file mode 100644
index 9e5613a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/transforms.ftl
+++ /dev/null
@@ -1,100 +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.
--->
-<#assign htmlEscape = "org.apache.freemarker.core.util.HtmlEscape"?new(),
-         utility = "org.apache.freemarker.test.templatesuite.models.TransformHashWrapper"?new()>
-<html>
-<head>
-<title>FreeMarker: Transformation Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<@htmlEscape>
-<p>${message}</p>
-</...@htmlEscape>
-
-<P>Now try the Utility package:</p>
-<p>${utility}</p>
-
-<@utility.htmlEscape>
-<p>${utility}</p>
-</@>
-
-<p>Now some nested transforms:</p>
-<@utility.compress>
-<p    >This tests the compress transformation</p >
-</@>
-<@utility.compress>
-<@utility.htmlEscape>
-<p    >This tests the compress transformation</p >
-</@>
-</...@utility.compress>
-<#assign html_transform = "org.apache.freemarker.core.util.HtmlEscape"?new() />
-<@html_transform><#--Using the transform via an instantiation -->
-<@utility.compress>
-<p    >This tests the compress transformation</p >
-</@>
-</@>
-
-<p>Now try method and transform interactions:</p>
-<@utility.escape("xml")>
-<p>This isn't a valid XML string.</p>
-</@>
-<@utility.escape("html")>
-<p>This isn't a valid HTML string.</p>
-</@>
-
-<p>A more advanced interaction involves getting a TemplateMethodModel
-to initialise a TemplateTransformModel, as follow:</p>
-
-<@utility.special("This is a comment")>
-Comment: *
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-</@>
-
-<@utility.special("This is a second comment", "quote")>
-Comment: *
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-</@>
-<@utility.special("This is a third comment", "ampersand", "quote")>
-Comment: *
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-</@>
-<@utility.special("tag", utility)>
-Comment: *
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-</@>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/type-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/type-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/type-builtins.ftl
deleted file mode 100644
index cb0f576..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/type-builtins.ftl
+++ /dev/null
@@ -1,44 +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.
--->
-<#setting boolean_format="1,0">
-StNuBoMeTaMaHaHxSeCoCxEnInDiNo
-<#list [
-  "a", 1, false,
-  testmethod, testmacro, html_escape,
-  {"a":1}, [1], testcollection, testcollectionEx,
-  testnode,
-  bean, bean.m, bean.mOverloaded
-] as x>
-  ${x?is_string} <#t>
-  ${x?is_number} <#t>
-  ${x?is_boolean} <#t>
-  ${x?is_method} <#t>
-  ${x?is_macro} <#t>
-  ${x?is_transform} <#t>
-  ${x?is_hash} <#t>
-  ${x?is_hash_ex} <#t>
-  ${x?is_sequence} <#t>
-  ${x?is_collection} <#t>
-  ${x?is_collection_ex} <#t>
-  ${x?is_enumerable} <#t>
-  ${x?is_indexable} <#t>
-  ${x?is_directive} <#t>
-  ${x?is_node}<#lt>
-</#list>
-<#macro testmacro></#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/undefined.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/undefined.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/undefined.ftl
deleted file mode 100644
index 2ca96ac..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/undefined.ftl
+++ /dev/null
@@ -1,19 +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.
--->
-${undefined_variable}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/url.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/url.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/url.ftl
deleted file mode 100644
index 814de80..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/url.ftl
+++ /dev/null
@@ -1,24 +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.
--->
-<#setting url_escaping_charset="utf-8">
-<#assign s = 'a/báb?c/x;y=1' />
-<@assertEquals expected='a%2Fb%E1b%3Fc%2Fx%3By%3D1' actual=s?url('ISO-8859-1') />
-<@assertEquals expected='a%2Fb%C3%A1b%3Fc%2Fx%3By%3D1' actual=s?url />
-<@assertEquals expected='a/b%E1b%3Fc/x%3By%3D1' actual=s?url_path('ISO-8859-1') />
-<@assertEquals expected='a/b%C3%A1b%3Fc/x%3By%3D1' actual=s?url_path />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/var-layers.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/var-layers.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/var-layers.ftl
deleted file mode 100644
index 25333de..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/var-layers.ftl
+++ /dev/null
@@ -1,39 +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.
--->
-<#import "varlayers_lib.ftl" as lib>
-<@foo 1/>
-${x} = ${.data_model.x} = ${.globals.x}
-<#assign x = 5>
-${x} = ${.main.x} = ${.namespace.x}
-<#global x = 6>
-${.globals.x} but ${.data_model.x} = 4
-${y} = ${.globals.y} = ${.data_model.y?default("ERROR")}
-Invisiblity test 1.: <#if .main.y?exists || .namespace.y?exists>failed<#else>passed</#if>
-Invisiblity test 2.: <#if .main.z?exists || .namespace.z?exists>failed<#else>passed</#if>
-Invisiblity test 3.: <#global q = 1><#if .main.q?exists || .namespace.q?exists || .data_model.q?exists>failed<#else>passed</#if>
---
-<@lib.foo/>
---
-<#macro foo x>
-  ${x} = ${.locals.x}
-  <#local x = 2>
-  ${x} = ${.locals.x}
-  <#local y = 3>
-  ${y} = ${.locals.y}
-</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varargs.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varargs.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varargs.ftl
deleted file mode 100644
index 5e79aa7..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varargs.ftl
+++ /dev/null
@@ -1,45 +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.
--->
-<#setting number_format="#">
-
-${m.bar()} == 0
-${m.bar([])} == 0
-${m.bar(11)} == 11
-${m.bar(null, 11)} == 11
-${m.bar(11, 22)} == 1122
-${m.bar(11.6, 22.4)} == 1122
-${m.bar(11, 22, 33)} == 112233
-${m.bar([11, 22, 33])} == 112233
-
-${m.bar2(11, [22, 33, 44])} == -22334411
-${m.bar2(11, 22, 33)} == -223311
-${m.bar2(11, 22)} == -2211
-${m.bar2(11)} == -11
-
-${m.overloaded()} == 0
-${m.overloaded(11)} == -11
-${m.overloaded(11, 22)} == 1122
-${m.overloaded(11, 22, 33)} == -112233
-${m.overloaded(11, 22, 33, 44)} == -11223344
-${m.overloaded([11, 22, 33, 44, 55])} == -1122334455
-
-${m.overloaded(11, 22)} == 1122
-${m.overloaded([11, 22])} == -1122
-
-${m.noVarArgs("string", true, 123, 1000000?number_to_date)} == string, true, 123, 1000000

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/variables.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/variables.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/variables.ftl
deleted file mode 100644
index b927381..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/variables.ftl
+++ /dev/null
@@ -1,70 +0,0 @@
-[#ftl]
-[#--
-  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.
---]
-<html>
-<head>
-<title>FreeMarker: Variable Test</title>
-</head>
-<body>
-[#assign list = ["one", "two", "three", "four", "five"]]
-[#assign hash = {"output" : "My message.", "key" : list}]
-[#assign hash2 = {"value" : hash}]
-[#assign items = {"mykey" : "key", "_test", "out"}]
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now get into variable nesting:</p>
-
-<p>${hash.output}</p>
-<p>${hash["output"]}</p>
-<p>${hash. output}</p>
-<p>${hash .output}</p>
-<p>${hash 
-    .output}</p>
-<p>${hash 
-    . output}</p>
-<p>${hash ["output"]}</p>
-<p>${hash
-    [ "output" ]}</p>
-
-<p>More deep nesting...</p>
-
-<p>${hash2.value.output}</p>
-<p>${hash2.value.key[0]}</p>
-<p>${hash2["value"]["key"][0]}</p>
-
-
-<p>Nesting inside nesting...</p>
-
-<p>${hash2.value[ items.mykey ][ 1 ]}</p>
-<p>${hash2.value[ items[ "mykey" ]][ 1 ]}</p>
-<p>${hash2.value[ items[ "my" + items.mykey ]][ 1 ]}</p>
-<p>${hash2.value[ items[ "my" + items["mykey"] ]][ 1 ]}</p>
-
-<p>Test underscores...</p>
-
-<p>${items[ "_test" ]}</p>
-<p>${items._test}</p>
-
-${"God save the queen."?word_list[1]?upper_case}
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varlayers_lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varlayers_lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varlayers_lib.ftl
deleted file mode 100644
index 9a1a471..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/varlayers_lib.ftl
+++ /dev/null
@@ -1,28 +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.
--->
-<#assign x1 = .data_model.x>
-<#assign x2 = x>
-<#assign z2 = z>
-<#macro foo>
-<@.main.foo 1/>
-  ${z} = ${z2} = ${x1} = ${.data_model.x}
-  5
-  ${x} == ${.globals.x}
-  ${y} == ${.globals.y} == ${.data_model.y?default("ERROR")}
-</#macro>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/whitespace-trim.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/whitespace-trim.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/whitespace-trim.ftl
deleted file mode 100644
index 9c10dd9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/whitespace-trim.ftl
+++ /dev/null
@@ -1,102 +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.
--->
-  LB<#lt>
-  LB<#lt>
-	LB<#lt>
-LB<#lt>
-  IB
-  IC1<#rt>
-  IC2<#rt>
-C1<#rt>
-C2<#rt>
-  ICS <#rt>
-CS1 <#rt>
-  CS2 <#t>
-  C3<#t>
-  C1<#t>
-C2
-B
-B
-  C1<#t>
-CB
-C1
-  C2<#t>
-  ICB
-  IC<#rt>
-  ICB
-  IC<#rt>
-  CB<#lt>
---
-<#macro x t>${t}</#macro>
-  ${""}<@x t="LB"/><#lt>
-  <@x t="LB"/><#lt>${""}
-	<@x t="LB"/><#lt>${""}
-<@x t="LB"/><#lt>${""}
-  <@x t="IB"/>${""}
-${""}  <@x t="IC1"/><#rt>
-  <@x t="IC2"/><#rt>${""}
-${""}<@x t="C1"/><#rt>
-<@x t="C2"/><#rt>${""}
-  <@x t="ICS"/> <#rt>${""}
-<@x t="CS1"/> <#rt>${""}
-  <@x t="CS2"/> <#t>${""}
-  <@x t="C3"/><#t>
-  <@x t="C1"/><#t>
-<@x t="C2"/>${""}
-<#nt><@x t="B"/>
-<@x t="B"/><#nt>
-  <@x t="C1"/><#t>
-<@x t="CB"/>${""}
-<@x t="C1"/>${""}
-  <@x t="C2"/><#t>${""}
-  <@x t="ICB"/>${""}
-  ${""}<@x t="IC"/><#rt>
-  <@x t="ICB"/>${""}
-${""}  <@x t="IC"/><#rt>
-  <@x t="CB"/>${""}<#lt>
---
-   <#lt>  IB
-  IC1<#rt>
-  <#assign x = 1> <#-- just a comment -->
-  C2<#t>
-  <#assign x = 1>
-  IB
-1<#t>
-  <#assign x = 1>
-2
----
-<#t>1
-  <#t> 2
-  <#lt>3
-  4
-  <#rt>5
-  6
----
-a
-  <#assign x = 1><#t>
-b<#t>  
-c
----
-  <#if true>
-    <#t>foo
-  </#if>
----
-  <#if true><#-- just a comment -->
-    foo<#t>
-  </#if>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wsstripinheader_inc.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wsstripinheader_inc.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wsstripinheader_inc.ftl
deleted file mode 100644
index 03cbfbe..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wsstripinheader_inc.ftl
+++ /dev/null
@@ -1,22 +0,0 @@
-<#ftl strip_whitespace="yes">
-<#--
-  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.
--->
-a
-<#assign x = 1>
-b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wstrip-in-header.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wstrip-in-header.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wstrip-in-header.ftl
deleted file mode 100644
index 0dce83c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/wstrip-in-header.ftl
+++ /dev/null
@@ -1,26 +0,0 @@
-
-  
-
-  <#ftl strip_whitespace="no">
-<#--
-  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.
--->
-a
-<#assign x = 1>
-b
-<#include "wsstripinheader_inc.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-fragment.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-fragment.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-fragment.ftl
deleted file mode 100644
index 226215b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-fragment.ftl
+++ /dev/null
@@ -1,26 +0,0 @@
-<#ftl ns_prefixes = {"n" : "http://x"}>
-<#--
-  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.
--->
-${node?node_name} = b
-${node?root?node_name} = @document
-${node['/']?node_name} = @document
-
-${node['n:c']} = C<>&"']]>
-
-${node?root.@@markup}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
deleted file mode 100644
index 0f0bde2..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
+++ /dev/null
@@ -1,23 +0,0 @@
-<#ftl ns_prefixes={ "n": "http://freemarker.org/test/bar", "D": "http://freemarker.org/test/namespace-test" }>
-<#--
-  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.
--->
-<#global libResult>//n:e: ${doc['//n:e']}, ${doc.root['n:e']}</#global>
-<#macro m>
-//n:e: ${doc['//n:e']}, ${doc.root['n:e']}
-</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-main.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-main.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-main.ftl
deleted file mode 100644
index 5b7ce24..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml-ns_prefix-scope-main.ftl
+++ /dev/null
@@ -1,36 +0,0 @@
-<#ftl ns_prefixes={
-    "D": "http://freemarker.org/test/namespace-test",
-    "n": "http://freemarker.org/test/foo",
-    "bar": "http://freemarker.org/test/bar"
-}>
-<#--
-  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.
--->
-//e: ${doc['//D:e']}, ${doc.root.e}
-//n:e: ${doc['//n:e']}, ${doc.root['n:e']}
-//bar:e: ${doc['//bar:e']}, ${doc.root['bar:e']}
-
-Included:
-<#include "xml-ns_prefix-scope-lib.ftl">
-${libResult}
-<@m />
-
-Imported:
-<#import "xml-ns_prefix-scope-lib.ftl" as lib>
-${libResult}
-<@lib.m />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml.ftl
deleted file mode 100644
index b85fc03..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xml.ftl
+++ /dev/null
@@ -1,47 +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.
--->
-<#-- test processing instructions -->
-<#global PIs = doc._content._ftype("p")>
-<#list PIs as pi>
-  ${pi}
-  ${pi["@target"]._text}
-  ${pi["@data"]._text}
-</#list>
-${PIs?size}
-<#global firstPi = PIs[0]>
-${firstPi._type}
-${firstPi["@customKey"]}
-${doc._registerNamespace("ns", "http://www.foo.com/ns1/")}
-${doc._descendant["ns:e11"]}
-${doc._descendant["ns:e12"]}
-<#global docRoot = doc["ns:root"]>
-${docRoot["ns:e1"]}
-${doc("//ns:e11")}
-${docRoot["ns:e1"]["@a1"]._name}
-${docRoot["ns:e1"]["@a2"]._text}
-${docRoot._children._parent._name}
-${docRoot._children._parent._unique._name}
-<#list doc._descendant as d>
-  ${d._name}
-</#list>
-<#list doc._descendant._ancestorOrSelf as d>
-  ${d._name}
-</#list>
-${docRoot["ns:e2"]["ns:e12"]._text}
-${docRoot["ns:e2"]["ns:e12"]._plaintext}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns1.ftl
deleted file mode 100644
index 8aa893e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns1.ftl
+++ /dev/null
@@ -1,53 +0,0 @@
-<#ftl ns_prefixes = {"D" : "http://example.com/eBook"}>
-<#--
-  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.
--->
-
-${doc.@@markup}
-
-<#recurse doc >
-
-<#macro book>
-  <html>
-    <head>
-      <title><#recurse .node.title></title>
-    </head>
-    <body>
-      <h1><#recurse .node.title></h1>
-      <#recurse>
-    </body>
-  </html>
-</#macro>
-
-<#macro chapter>
-  <h2><#recurse .node.title></h2>
-  <#recurse>
-</#macro>
-
-<#macro para>
-  <p><#recurse>
-</#macro>
-
-<#macro title>
-  <#--
-    We have handled this element imperatively,
-    so we do nothing here.
-  -->
-</#macro>
-
-<#macro @text>${.node?html}</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns3.ftl
deleted file mode 100644
index c84ec69..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/xmlns3.ftl
+++ /dev/null
@@ -1,70 +0,0 @@
-<#ftl ns_prefixes = {"x" : "http://x", "y" : "http://y"}>
-<#--
-  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.
--->
-<#recurse doc >
-
-<#macro book>
-  <html>
-    <head>
-      <title><#recurse .node["x:title"]></title>
-    </head>
-    <body>
-      <h1><#recurse .node["x:title"]></h1>
-      <#recurse>
-    </body>
-  </html>
-</#macro>
-
-<#macro chapter>
-  <h2><#recurse .node["y:title"]></h2>
-  <#recurse>
-</#macro>
-
-<#macro "x:chapter">
-  <h2><#recurse .node["y:title"]></h2>
-  <#recurse>
-</#macro>
-
-<#macro para>
-  <p><#recurse>
-</#macro>
-
-<#macro "x:para">
-  <p><#recurse>
-</#macro>
-
-<#macro "y:para">
-  <p><#recurse>
-</#macro>
-
-<#macro "x:title">
-  <#--
-    We have handled this element imperatively,
-    so we do nothing here.
-  -->
-</#macro>
-
-<#macro "y:title">
-  <#--
-    We have handled this element imperatively,
-    so we do nothing here.
-  -->
-</#macro>
-
-<#macro @text>${.node?html}</#macro>
\ No newline at end of file



[04/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listliteral.ftl
deleted file mode 100644
index d48578c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listliteral.ftl
+++ /dev/null
@@ -1,84 +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.
--->
-<html>
-<head>
-<title>FreeMarker: List Literal Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now perform a list assignment:</p>
-
-<#assign hash = {"temp", "Temporary"}>
-<#assign mymessage = "hello">
-<#assign test = [ "test1", "test23", "test45", message, mymessage]>
-
-The list contains #{test?size} items.
-
-<#list test as item>
-<p>${item}</p>
-</#list>
-
-<p>Now update the assignment and repeat:</p>
-
-<#assign mymessage = "world">
-
-<#list test as item>
-<p>${item}</p>
-</#list>
-
-<p>Now reassign the list and repeat:</p>
-
-<#assign test = [ hash.temp, "test1", "test23", "test45", mymessage, "hash", hash["temp"]]>
-<#assign test = [ "foo", "bar" ] + test>
-
-<#list test[1..4] as item>
-<p>${item}</p>
-</#list>
-
-<p>Silly, but necessary tests, for one and zero element lists:</p>
-
-<#assign test = [ "Hello, world" ]>
-
-<#list test as item>
-<p>${item}</p>
-</#list>
-
-<p>Zero item test:</p>
-
-<#assign test = []>
-
-<#list test as item>
-<p>${item}</p>
-</#list>
-
-<p>Dumb test for number literals -- these weren't working as expected:</p>
-
-<#assign test = [] + [1, 2,3, 5, 7]>
-
-<#list test as item>
-<p>${item}</p>
-<#if item == 5><#break></#if>
-</#list>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization.ftl
deleted file mode 100644
index cf46fbf..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization.ftl
+++ /dev/null
@@ -1,32 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Localization Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Hello, in the default language.</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en.ftl
deleted file mode 100644
index f8292bc..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en.ftl
+++ /dev/null
@@ -1,32 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Localization Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Hello, in the English language.</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en_AU.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en_AU.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en_AU.ftl
deleted file mode 100644
index 938f681..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/localization_en_AU.ftl
+++ /dev/null
@@ -1,32 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Localization Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>G'day, mate!</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/logging.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/logging.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/logging.ftl
deleted file mode 100644
index c44d6b8..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/logging.ftl
+++ /dev/null
@@ -1,42 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Logging Test</title>
-</head>
-<body>
-
-A simple test follows:
-
-${message.test[ "me" ]}
-
-<if message>
-	<p>Message exists!
-	<transform message.sdf>
-		...and even generates output!
-	</transform>
-	</p>
-</if>
-
-<compress>
-Try this for size.
-</compress>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/loopvariable.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/loopvariable.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/loopvariable.ftl
deleted file mode 100644
index bc77b82..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/loopvariable.ftl
+++ /dev/null
@@ -1,49 +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.
--->
-<#setting locale="en_US">
----
-<#macro myLoop from to>
-  <#list from..to as x>
-  - <#nested x></#list>*
-</#macro>
-<#list 2..1 as i>
-  ${i}
-  <@myLoop from=1 to=3; i>
-    L1 ${i}
-    <@myLoop from=1 to=2; i>
-      L2 ${i}: <#list 1..3 as i>${i}; </#list>
-    </@>
-  </@>
-</#list>
----
-<#macro repeat count>
-  <#list 1..count as x>
-    <#nested x, x/2, x==count>
-  </#list>
-</#macro>
-<#macro test2>
-<#local c = 123>
-<@repeat count=4 ; c, halfc, last>
-  <#local c = .locals.c + 0.1>
-  ${c} ${halfc}<#if last> Last!</#if>
-</...@repeat>
-${c}
-</#macro>
-<@test2/>
----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros-return.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros-return.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros-return.ftl
deleted file mode 100644
index 220fa2a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros-return.ftl
+++ /dev/null
@@ -1,34 +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.
--->
-<#macro m>m{<#return>}</#macro>
-<@m/>
-
-<#macro m><#if true>m{<#return>}</#if></#macro>
-<@m/>
-
-<#macro m><#if true>m{<#return></#if>}</#macro>
-<@m/>
-
-<#macro b>b{<#nested>}</#macro>
-<#macro m><@b><#return></@></#macro>
-<@m/>
-
-<#macro b>b{<#nested>}</#macro>
-<#macro m>m:<@b><#return></@></#macro>
-<@m/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros.ftl
deleted file mode 100644
index 9d8f456..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros.ftl
+++ /dev/null
@@ -1,101 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Function Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now perform function tests:</p>
-
-<#assign urls = {"home" : "/home.html", "about" : "/about.html"}>
-<#assign images = {"home" : "/images/home.png", "about" : "/image/about-us.jpeg"}>
-<#assign preferences = {"showImages" : true}>
-<#assign "español" = français><#macro français(url, image, alt)>
-    <#local var = "Kilroy">
-    <a href="${url}">
-    <#if preferences.showImages>
-        <img src="${image}" border="0" alt="${alt}">
-    <#else>
-        ${alt}
-    </#if>
-    </a>
-    ${var} was here.
-</#macro>
-
-<p>Function is defined, now let's call it:</p>
-
-   <@español urls.home images.home "Home" /><#t>
-
-<p>Again, but with different parameters:</p>
-
-<@français 
-   url=urls.about 
-   image=images.about 
-   alt="About Us"
-/>
-
-<#if var?exists>
-   Something is wrong here.
-<#else>
-   Good.
-</#if>
-
-<p>A recursive function call:</p>
-
-<#macro recurse(dummy, a=3)>
-    <#if (a > 0)>
-        <@recurse dummy  a - 1 />
-    </#if>
-    ${a}
-</#macro>
-
-<@recurse urls />
-
-<p>Test "catch-all" macro parameter:</p>
-
-<#macro "catch-all" foo bar...>
-foo=${foo} baz=[<#list bar?keys?sort as key>${key}=${bar[key]}<#if key_has_next>, </#if></#list>]
-</#macro>
-<#assign catchall = .namespace["catch-all"]>
-
-<@catchall foo="a"/>
-<@catchall foo="a" bar="b"/>
-<@catchall foo="a" bar="b" baz="c"/>
-
-<#macro fmt pattern args...>
-  <#list args as arg>
-    <#local pattern = pattern?replace("{" + arg_index + "}", arg)>
-  </#list>
-  ${pattern}<#lt>
-</#macro>
-
-<#macro m a=1 b=2>
-</#macro>
-<@assertFails message='"c"'><@m c=3 /></@>
-<@assertFails message='3'><@m 9 8 7 /></@>
-
-<@fmt "Hello {0}! Today is {1}.", "World", "Monday" />
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros2.ftl
deleted file mode 100644
index 55ceefd..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/macros2.ftl
+++ /dev/null
@@ -1,35 +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.
--->
-<#macro m1 a b=a>
-${a} ${b}
-</#macro>
-<@m1 a="1"/>
-<#macro m2 a=b b="">
-${a} ${b}
-</#macro>
-<@m2 b="2"/>
-<#macro m3 d b=c[a] a=d c={"3":"4"}>
-${b}
-</#macro>
-<@m3 d="3"/>
-<#attempt>
-<@m3 d="4"/>
-<#recover>
-m3 with d="4" Failed!
-</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/multimodels.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/multimodels.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/multimodels.ftl
deleted file mode 100644
index f356386..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/multimodels.ftl
+++ /dev/null
@@ -1,84 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Test of Multiple Model implementations</title>
-</head>
-<body>
-
-<p>Let's begin with a simple model:</p>
-<p>${message}</p>
-
-<p>Cool, now get into the first model. This implements a scalar, list, and
-hash as a single class. Let's try some tests...</p>
-
-<p>${data}</p>
-
-<p>Now as a list...</p>
-
-<#list data as item>${item}<br />
-</#list>
-
-<p>Index into a list...</p>
-<p>${data[ 1 ]}</p>
-<p>List size is: ${data.size}</p>
-<p>List size is: ${data["size"]}</p>
-
-<p>Now, again, as a hash. First using dot notation, then using [] notation:</p>
-
-<p>${data.selftest}</p>
-<p>${data["selftest"]}</p>
-
-<p>Now for the tricky stuff... use a model to index into another model...</p>
-<p>${test}</p>
-<p>${data[ test ]}</p>
-<p>${self}</p>
-<p>${data[ self + "test" ]}</p>
-
-<p>Same thing, this time a List index...</p>
-<p>${zero}</p>
-<p>${data[ zero ]}</p>
-<p>${data[ zero + 1 ]}</p>
-
-<p>Now, do the same recursively...</p>
-<p>${data}</p>
-<p>${data.model2}</p>
-<p>${data.model2( "test" )}</p>
-<p>${data.model2( data, data.selftest, message )}</p>
-
-<p>Does this really not work?</p>
-<p>${data[ 10 ]}</p>
-<p>${data[ 10 ].selftest}</p>
-<p>${data[ 10 ].message}</p>
-
-<p>(Again, with Hashes)</p>
-<p>${data.nesting1.nested}</p>
-<p>${data.nesting1.nested.selftest}</p>
-
-<p>${data["nesting1"].nested}</p>
-<p>${data["nesting1"].nested["selftest"]}</p>
-<p>${data["nesting1"]["nested"]["selftest"]}</p>
-
-<p>As I suspected! (Manual on Expressions needs updating.)</p>
-
-<p>Second test on list size</p>
-<p>${data.one.size}</p>
-<p>${data.one["size"]}</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nested.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nested.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nested.ftl
deleted file mode 100644
index 46f4492..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nested.ftl
+++ /dev/null
@@ -1,29 +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.
--->
-<#macro repeat count>
-  <#local y = "test">
-  <#list 1..count as x>
-    ${y} ${count}/${x}: <#nested x, "asdf"> <#-- the second body parameter is not used below -->
-  </#list>
-</#macro>
-<@repeat count=3>${y?default("undefined")} ${x?default("undefined")} ${count?default("undefined")}</...@repeat>
-<#global x = "X">
-<#global y = "Y">
-<#global count = "Count">
-<@repeat count=3 ; param1>${y?default("undefined")} ${x?default("undefined")} ${count?default("undefined")} ${param1}</...@repeat>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nestedinclude.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nestedinclude.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nestedinclude.ftl
deleted file mode 100644
index c6e7b11..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/nestedinclude.ftl
+++ /dev/null
@@ -1,21 +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.
--->
-<#assign nestedMessage = "I'm here, mon!">
-${.main.bar}
-<#-- ${.root.message} -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-defaultresolver.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-defaultresolver.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-defaultresolver.ftl
deleted file mode 100644
index 9efcd88..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-defaultresolver.ftl
+++ /dev/null
@@ -1,23 +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.
--->
-<#attempt>
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("works")}
-<#recover>
-fails
-</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-optin.ftl
deleted file mode 100644
index 7545b58..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/new-optin.ftl
+++ /dev/null
@@ -1,30 +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.
--->
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel"?new("works")}
-<#attempt>
-${"org.apache.freemarker.test.templatesuite.models.NewTestModel2"?new("works")}
-<#recover>
-fails
-</#attempt>
-
-<#include "subdir/new-optin.ftl">
-
-<#include "subdir/new-optin-2.ftl">
-
-<#include "subdir/subsub/new-optin.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines1.ftl
deleted file mode 100644
index 18f4b32..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines1.ftl
+++ /dev/null
@@ -1,29 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Newlines Test</title>
-</head>
-<body>
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines2.ftl
deleted file mode 100644
index ac8337c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/newlines2.ftl
+++ /dev/null
@@ -1,33 +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.
--->
-<#assign message="Hello, world!\n">
-<#assign normalizeNewlines = "org.apache.freemarker.core.util.NormalizeNewlines"?new()>
-<@normalizeNewlines>
-<html>
-<head>
-<title>FreeMarker: Newlines the Second Test</title>
-</head>
-<body>
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-</body>
-</html>
-</...@normalizeNewlines>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/noparse.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/noparse.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/noparse.ftl
deleted file mode 100644
index f7f1be3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/noparse.ftl
+++ /dev/null
@@ -1,62 +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.
--->
-<html>
-<head>
-<title>FreeMarker: NoParse Test</title>
-</head>
-<body>
-<#noparse>
-
-A simple test follows:
-
-${message}
-
-A more rigorous test, showing that we're not faking it:
-
-${message@#$%&}
-
-</#noparse>
-<#if message?exists>
-	<p>Message exists!
-	<#noparse>
-		...and even generates output!
-		<#if message>
-			Nested statements are ok, too.
-		</#if>
-	</#noparse>
-	</p>
-</#if>
-
-Here's another edge case, this time, trying to output a &lt;noparse&gt;
-inside another &lt;noparse&gt;
-
-<#noparse>
-
-This is what the noparse instruction looks like:
-
-<#nop</#noparse><#noparse>arse>This part of the template wont be parsed by the 
-FreeMarker parser. Instead, it will be treated as verbatim text information,
-and output as such.</#nop</#noparse><#noparse>arse>
-
-The rest of the template appears here.
-</#noparse>
-
-Simple.
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
deleted file mode 100644
index d060a44..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
+++ /dev/null
@@ -1,42 +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.
--->
-<#setting number_format = ",##0.##">
-<#setting locale = "fr_FR">
-${1}
-${1?c}
-${1234567.886}
-${1234567.886?c}
-<#setting number_format = "0.00">
-${1}
-${1?c}
-${1234567.886}
-${1234567.886?c}
-${int?c}
-${double?c}
-${double2?c}
-${double3?c}
-${double4?c}
-${bigDecimal?c}
-${bigDecimal2?c}
-<@assertEquals expected="INF" actual="INF"?number?c />
-<@assertEquals expected="INF" actual="INF"?number?c />
-<@assertEquals expected="-INF" actual="-INF"?number?c />
-<@assertEquals expected="-INF" actual="-INF"?number?float?c />
-<@assertEquals expected="NaN" actual="NaN"?number?float?c />
-<@assertEquals expected="NaN" actual="NaN"?number?float?c />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-literal.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-literal.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-literal.ftl
deleted file mode 100644
index 6342afe..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-literal.ftl
+++ /dev/null
@@ -1,133 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Number Literal Test</title>
-</head>
-<body>
-<#assign hash = {"1" : "one", 
-                 "12" : "twelve", 
-                "2one" : "two-one", 
-                "one2" : "one-two"}
-         list = ["zero", 
-                 "one", 
-                 "two", 
-                 "three", 
-                 "four", 
-                 "five", 
-                 "six", 
-                 "seven", 
-                 "eight", 
-                 "nine", 
-                 "ten",
-                 "eleven",
-                 "twelve"],
-          foo = "bar",
-          one = "one",
-          "1" = "one",
-          "12" = "twelve",
-          "2one" = "two-one",
-          "one2" = "one-two",
-          call = "org.apache.freemarker.test.templatesuite.models.SimpleTestMethod"?new()
->
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now perform a number assignment:</p>
-
-#{1.300000?double}
-
-<#assign mynumber = 1.8, USA="en_US" />
-<#assign myfloat = mynumber?float />
-
-My number is: ${mynumber}
-<#setting locale="en_US">
-My float is: #{myfloat ; m6}
-The int part is: ${myfloat?int}
-
-<#assign mymessage = mynumber?string>
-
-${mymessage + 3}
-
-<p>Now use numbers in assignment</p>
-
-<#assign mymessage = 1 + 5>
-${mymessage}
-
-<#assign mymessage = mymessage + 2>
-#{mymessage}
-
-<p>Try numbers in tests</p>
-
-<#if (mymessage == 152)>
-MyMessage is 152
-<#else>
-MyMessage is not 152, its: ${mymessage}.
-</#if >
-
-<if (mymessage > 5)>
-   MyMessage is greater than five.
-</if
-
-<#switch mymessage>
-	<#case 1>
-		MyMessage is one
-		<#break>
-
-	<#case 15>
-		MyMessage is fifteen
-		<#break>
-	
-	<#case 152>
-		MyMessage is one-five-two
-		<#break>
-	
-	<#default>
-		MyMessage is: ${mymessage}.
-		<#break>
-	
-</#switch>
-
-<p>Now for numbers in dynamic keys:</p>
-
-<#assign one = 1>
-<#assign two = 2>
-
-${list[ 1 ]}
-${list[ 1 + 2 ]}
-
-<p>Numbers in hashes:</p>
-
-${hash[ 1 + "2" ]}
-${hash[ "1" + 2 ]}
-${hash[ "1" + two ]}
-
-
-<p>Numbers in method calls:</p>
-
-${call( 1 )}
-${call( one )}
-${call( one + "2" )}
-${call( one + 2 )}
-${call( 1 + 2 )}
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-math-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-math-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-math-builtins.ftl
deleted file mode 100644
index 6dab082..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-math-builtins.ftl
+++ /dev/null
@@ -1,78 +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.
--->
-<@assertEquals actual=0?abs expected=0 />
-<@assertEquals actual=3?abs expected=3 />
-<@assertEquals actual=(-3)?abs expected=3 />
-<@assertEquals actual=3.5?abs expected=3.5 />
-<@assertEquals actual=(-3.5)?abs expected=3.5 />
-
-<@assert test=fNan?abs?is_nan />
-<@assert test=dNan?abs?is_nan />
-<@assert test=fNinf?abs?is_infinite />
-<@assert test=dPinf?abs?is_infinite />
-<@assert test=fNinf lt 0 />
-<@assert test=dPinf gt 0 />
-<@assert test=fNinf?abs gt 0 />
-<@assert test=dPinf?abs gt 0 />
-
-<@assertEquals actual=fn?abs expected=0.05 />
-<@assertEquals actual=dn?abs expected=0.05 />
-<@assertEquals actual=ineg?abs expected=5 />
-<@assertEquals actual=ln?abs expected=5 />
-<@assertEquals actual=sn?abs expected=5 />
-<@assertEquals actual=bn?abs expected=5 />
-<@assertEquals actual=bin?abs expected=5 />
-<@assertEquals actual=bdn?abs expected=0.05 />
-
-<@assertEquals actual=fp?abs expected=0.05 />
-<@assertEquals actual=dp?abs expected=0.05 />
-<@assertEquals actual=ip?abs expected=5 />
-<@assertEquals actual=lp?abs expected=5 />
-<@assertEquals actual=sp?abs expected=5 />
-<@assertEquals actual=bp?abs expected=5 />
-<@assertEquals actual=bip?abs expected=5 />
-<@assertEquals actual=bdp?abs expected=0.05 />
-
-<@assert test=!0?is_infinite />
-<@assert test=!fn?is_infinite />
-<@assert test=!dn?is_infinite />
-<@assert test=!ineg?is_infinite />
-<@assert test=!ln?is_infinite />
-<@assert test=!sn?is_infinite />
-<@assert test=!bn?is_infinite />
-<@assert test=!bin?is_infinite />
-<@assert test=!bdn?is_infinite />
-<@assert test=!fNan?is_infinite />
-<@assert test=!dNan?is_infinite />
-<@assert test=fNinf?is_infinite />
-<@assert test=dPinf?is_infinite />
-
-<@assert test=!0?is_nan />
-<@assert test=!fn?is_nan />
-<@assert test=!dn?is_nan />
-<@assert test=!ineg?is_nan />
-<@assert test=!ln?is_nan />
-<@assert test=!sn?is_nan />
-<@assert test=!bn?is_nan />
-<@assert test=!bin?is_nan />
-<@assert test=!bdn?is_nan />
-<@assert test=fNan?is_nan />
-<@assert test=dNan?is_nan />
-<@assert test=!fNinf?is_nan />
-<@assert test=!dPinf?is_nan />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-to-date.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-to-date.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-to-date.ftl
deleted file mode 100644
index 403e033..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-to-date.ftl
+++ /dev/null
@@ -1,35 +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.
--->
-${1305575275540?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
-${1305575275540?number_to_date?iso_utc} == 2011-05-16
-${1305575275540?number_to_time?iso_utc_ms} == 19:47:55.54Z
-
-${1305575275540?long?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
-${1305575275540?double?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
-${bigInteger?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
-${bigDecimal?number_to_datetime?iso_utc_ms} == 2011-05-16T19:47:55.54Z
-${1000?float?number_to_datetime?iso_utc} == 1970-01-01T00:00:01Z
-${1000?int?number_to_datetime?iso_utc} == 1970-01-01T00:00:01Z
-${0?byte?number_to_datetime?iso_utc} == 1970-01-01T00:00:00Z
-
-<#attempt>
-${9999991305575275540?number_to_datetime?iso_utc} <#-- doesn't fit into long -->
-<#recover>
-failed
-</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/numerical-cast.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/numerical-cast.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/numerical-cast.ftl
deleted file mode 100644
index 221b61b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/numerical-cast.ftl
+++ /dev/null
@@ -1,82 +0,0 @@
-<#ftl>
-<#--
-  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.
--->
-<#setting locale="en_US">
-<#setting number_format="0.#########">
-
-<#assign testlist= [ 0, 1, -1, 0.5, 1.5, -0.5,
-	 -1.5, 0.25, -0.25, 1.75, -1.75,
-	 1.01, -1.01, 0.01, -0.01,
-	 127, 128, -127, -128,
-	 32767, 32768, -32767, -32768,
-	 2147483647, 2147483648, -2147483647, -2147483648,
-	 4294967295, 4294967296, -4294967295, -4294967296,
-	 2147483647.1, 2147483648.1, -2147483647.1, -2147483648.1,
-	 4294967295.1, 4294967296.1, -4294967295.1, -4294967296.1
-	 2147483647.5, 2147483648.5, -2147483647.5, -2147483648.5,
-	 4294967295.5, 4294967296.5, -4294967295.5, -4294967296.5
-  ] />
-
-?int:
-<#list testlist as result>
-    ${result}?int=${result?int}
-</#list>
-
-?double
-<#list testlist as result>
-    ${result}?double=${result?double}
-</#list>
-
-?long
-<#list testlist as result>
-    ${result}?long=${result?long}
-</#list>
-
-?long from date
-    ${"2011-05-08 18:00:15 GMT"?date("yyyy-MM-dd HH:mm:ss z")?long} = 1304877615000
-
-?float
-<#list testlist as result>
-    ${result}?float=${result?float}
-</#list>
-
-?byte
-<#list testlist as result>
-    ${result}?byte=${result?byte}
-</#list>
-
-?short
-<#list testlist as result>
-    ${result}?short=${result?short}
-</#list>
-
-?floor
-<#list testlist as result>
-    ${result}?floor=${result?floor}
-</#list>
-
-?ceiling
-<#list testlist as result>
-    ${result}?ceiling=${result?ceiling}
-</#list>
-
-?round
-<#list testlist as result>
-    ${result}?round=${result?round}
-</#list>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding1.ftl
deleted file mode 100644
index da1128f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding1.ftl
+++ /dev/null
@@ -1,30 +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.
--->
-Output charset: ${.output_encoding?default("undefined")}
-URL escaping charset: ${.url_escaping_charset?default("undefined")}
-
-<#assign s="a/%b">
-<#setting url_escaping_charset="UTF-16">
-${s?url}
-${s?url}
-<#setting url_escaping_charset="ISO-8859-1">
-${s?url}
-${s?url}
-${s?url('UTF-16')}
-${s?url}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding2.ftl
deleted file mode 100644
index 3a4f24d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding2.ftl
+++ /dev/null
@@ -1,28 +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.
--->
-Output charset: ${.output_encoding?default("undefined")}
-URL escaping charset: ${.url_escaping_charset?default("undefined")}
-
-<#assign s="a/%b">
-UTF-16: ${s?url}
-ISO-8859-1: ${s?url('ISO-8859-1')}
-UTF-16: ${s?url}
-<#setting url_escaping_charset="ISO-8859-1">
-ISO-8859-1: ${s?url}
-ISO-8859-1: ${s?url}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding3.ftl
deleted file mode 100644
index 3a4f24d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/output-encoding3.ftl
+++ /dev/null
@@ -1,28 +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.
--->
-Output charset: ${.output_encoding?default("undefined")}
-URL escaping charset: ${.url_escaping_charset?default("undefined")}
-
-<#assign s="a/%b">
-UTF-16: ${s?url}
-ISO-8859-1: ${s?url('ISO-8859-1')}
-UTF-16: ${s?url}
-<#setting url_escaping_charset="ISO-8859-1">
-ISO-8859-1: ${s?url}
-ISO-8859-1: ${s?url}
\ No newline at end of file


[16/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
deleted file mode 100644
index c2d7c90..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
+++ /dev/null
@@ -1,185 +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.test.templatesuite.models;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateCollectionModel;
-import org.apache.freemarker.core.model.TemplateHashModelEx;
-import org.apache.freemarker.core.model.TemplateHashModelEx2;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.WrappingTemplateModel;
-import org.apache.freemarker.core.model.impl.DefaultMapAdapter;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleCollection;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-
-import com.google.common.collect.ImmutableMap;
-
-@SuppressWarnings("boxing")
-public class Listables {
-    
-    private static final List<Integer> LIST;
-    static {
-        List<Integer> list = new ArrayList<>();
-        list.add(11);
-        list.add(22);
-        list.add(33);
-        LIST = list;
-    }
-
-    private static final List<Integer> LINKED_LIST;
-    static {
-        List<Integer> list = new LinkedList<>();
-        list.add(11);
-        list.add(22);
-        list.add(33);
-        LINKED_LIST = list;
-    }
-
-    private static final List<Integer> EMPTY_LINKED_LIST = new LinkedList<>();
-
-    private static final Set<Integer> SET;
-    static {
-        Set<Integer> set = new TreeSet<>();
-        set.add(11);
-        set.add(22);
-        set.add(33);
-        SET = set;
-    }
-    
-    public List<Integer> getList() {
-        return LIST;
-    }
-    
-    public List<Integer> getLinkedList() {
-        return LINKED_LIST;
-    }
-    
-    public Set<Integer> getSet() {
-        return SET;
-    }
-
-    public Iterator<Integer> getIterator() {
-        return SET.iterator();
-    }
-
-    public List<Integer> getEmptyList() {
-        return Collections.emptyList();
-    }
-    
-    public List<Integer> getEmptyLinkedList() {
-        return Collections.emptyList();
-    }
-    
-    public Set<Integer> getEmptySet() {
-        return Collections.emptySet();
-    }
-
-    public Iterator<Integer> getEmptyIterator() {
-        return Collections.<Integer>emptySet().iterator();
-    }
-    
-    public List<TemplateHashModelEx2> getHashEx2s() throws TemplateModelException {
-        Map<Object, Object> map;
-        map = new LinkedHashMap<>();
-        map.put("k1", "v1");
-        map.put(2, "v2");
-        map.put("k3", "v3");
-        map.put(null, "v4");
-        map.put(true, "v5");
-        map.put(false, null);
-        
-        return getMapsWrappedAsEx2(map);
-    }
-
-    public List<? extends TemplateHashModelEx> getEmptyHashes() throws TemplateModelException {
-        List<TemplateHashModelEx> emptyMaps = new ArrayList<>();
-        emptyMaps.addAll(getMapsWrappedAsEx2(Collections.emptyMap()));
-        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build()
-                .wrap(Collections.emptyMap()));
-        return emptyMaps;
-    }
-    
-    /**
-     * Returns the map wrapped on various ways.
-     */
-    private List<TemplateHashModelEx2> getMapsWrappedAsEx2(Map<?, ?> map) throws TemplateModelException {
-        List<TemplateHashModelEx2> maps = new ArrayList<>();
-        
-        DefaultObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
-        maps.add(new SimpleHash(map, ow));
-        maps.add((DefaultMapAdapter) ow.wrap(map));
-
-        return maps;
-    }
-    
-    public TemplateHashModelEx getHashNonEx2() {
-        return new NonEx2MapAdapter(ImmutableMap.of("k1", 11, "k2", 22),
-                new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build());
-    }
-    
-    public static class NonEx2MapAdapter extends WrappingTemplateModel implements TemplateHashModelEx {
-
-        private final Map<?, ?> map;
-        
-        public NonEx2MapAdapter(Map<?, ?> map, ObjectWrapper wrapper) {
-            super(wrapper);
-            this.map = map;
-        }
-        
-        @Override
-        public TemplateModel get(String key) throws TemplateModelException {
-            return wrap(map.get(key));
-        }
-        
-        @Override
-        public boolean isEmpty() {
-            return map.isEmpty();
-        }
-        
-        @Override
-        public int size() {
-            return map.size();
-        }
-        
-        @Override
-        public TemplateCollectionModel keys() {
-            return new SimpleCollection(map.keySet(), getObjectWrapper());
-        }
-        
-        @Override
-        public TemplateCollectionModel values() {
-            return new SimpleCollection(map.values(), getObjectWrapper());
-        }
-        
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel1.java
deleted file mode 100644
index 66a0ffe..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel1.java
+++ /dev/null
@@ -1,116 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Testcase to see how FreeMarker deals with multiple Template models.
- */
-public class MultiModel1 implements TemplateHashModel,
-        TemplateSequenceModel, TemplateScalarModel {
-
-    private ObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
-
-    private TemplateModel m_cSubModel = new MultiModel2();
-    private TemplateModel m_cListHashModel1 = new MultiModel4(ow);
-    private TemplateModel m_cListHashModel2 = new MultiModel5(ow);
-    private TemplateSequenceModel m_cListModel = new SimpleSequence(ow);
-    private TemplateHashModel m_cHashModel = new SimpleHash(ow);
-
-    /** Creates new MultiModel1 */
-    public MultiModel1() {
-        for ( int i = 0; i < 10; i++ ) {
-            ((SimpleSequence) m_cListModel).add( "Model1 value: " + Integer.toString( i ));
-        }
-        ((SimpleSequence) m_cListModel).add( new MultiModel3() );
-        ((SimpleHash) m_cHashModel).put( "nested", new MultiModel3() );
-    }
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        if ( key.equals( "model2" )) {
-            return m_cSubModel;
-        } else if ( key.equals( "modellist" )) {
-            return m_cListModel;
-        } else if ( key.equals( "selftest" )) {
-            return new SimpleScalar( "Selftest of a hash from MultiModel1" );
-        } else if ( key.equals( "one" )) {
-            return m_cListHashModel1;
-        } else if ( key.equals( "two" )) {
-            return m_cListHashModel2;
-        } else if ( key.equals( "size" )) {
-            return new SimpleScalar( "Nasty!" );
-        } else if ( key.equals( "nesting1" )) {
-            return m_cHashModel;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return false;
-    }
-
-    /**
-     * @return the specified index in the list
-     */
-    @Override
-    public TemplateModel get(int i) throws TemplateModelException {
-        return m_cListModel.get( i );
-    }
-
-    /**
-     * Returns the scalar's value as a String.
-     *
-     * @return the String value of this scalar.
-     */
-    @Override
-    public String getAsString() {
-        return "MultiModel1 as a string!";
-    }
-
-    @Override
-    public int size() throws TemplateModelException {
-        return m_cListModel.size();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel2.java
deleted file mode 100644
index a7a75b5..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel2.java
+++ /dev/null
@@ -1,63 +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.test.templatesuite.models;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.freemarker.core.model.TemplateMethodModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-/**
- * Testcase to see how FreeMarker deals with multiple Template models.
- */
-public class MultiModel2 implements TemplateScalarModel, TemplateMethodModel {
-
-    /**
-     * Returns the scalar's value as a String.
-     *
-     * @return the String value of this scalar.
-     */
-    @Override
-    public String getAsString() {
-        return "Model2 is alive!";
-    }
-
-    /**
-     * Executes a method call.
-     *
-     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing the values
-     * of the arguments passed to the method.
-     * @return the <tt>TemplateModel</tt> produced by the method, or null.
-     */
-    @Override
-    public Object exec(List arguments) {
-        StringBuilder  aResults = new StringBuilder( "Arguments are:<br />" );
-        Iterator    iList = arguments.iterator();
-
-        while ( iList.hasNext() ) {
-            aResults.append( (String) iList.next() );
-            aResults.append( "<br />" );
-        }
-
-        return new SimpleScalar( aResults.toString() );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel3.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel3.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel3.java
deleted file mode 100644
index 4434afc..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel3.java
+++ /dev/null
@@ -1,69 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-/**
- * Testcase to see how FreeMarker deals with multiple Template models.
- */
-public class MultiModel3 implements TemplateScalarModel, TemplateHashModel {
-
-    /**
-     * Returns the scalar's value as a String.
-     *
-     * @return the String value of this scalar.
-     */
-    @Override
-    public String getAsString() {
-        return "Model3 is alive!";
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return false;
-    }
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        if ( key.equals( "selftest" )) {
-            return new SimpleScalar( "Selftest from MultiModel3!" );
-        } else if ( key.equals( "message" )) {
-            return new SimpleScalar( "Hello world from MultiModel3!" );
-        } else {
-            return null;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel4.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel4.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel4.java
deleted file mode 100644
index bdd11fc..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel4.java
+++ /dev/null
@@ -1,77 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Testcase to see how FreeMarker deals with multiple Template models.
- */
-public class MultiModel4 implements TemplateSequenceModel, TemplateHashModel {
-
-    private final SimpleSequence m_cList;
-
-    public MultiModel4(ObjectWrapper ow) {
-        this.m_cList = new SimpleSequence(ow);
-    }
-
-    /**
-     * @return the specified index in the list
-     */
-    @Override
-    public TemplateModel get(int i) throws TemplateModelException {
-        return m_cList.get( i );
-    }
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        if ( key.equals( "size" )) {
-            return new SimpleScalar( "Key size, not the listSize method." );
-        } else {
-            return null;
-        }
-    }
-
-
-    @Override
-    public int size() {
-        return m_cList.size();
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return size() == 0;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel5.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel5.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel5.java
deleted file mode 100644
index 01f7a3e..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/MultiModel5.java
+++ /dev/null
@@ -1,81 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Testcase to see how FreeMarker deals with multiple Template models.
- */
-public class MultiModel5 implements TemplateSequenceModel, TemplateHashModel {
-
-    private final SimpleSequence m_cList;
-
-    /** Creates new MultiModel5 */
-    public MultiModel5(ObjectWrapper ow) {
-        this.m_cList = new SimpleSequence(ow);
-        m_cList.add( new SimpleScalar( "Dummy to make list non-empty" ));
-    }
-
-    /**
-     * @return the specified index in the list
-     */
-    @Override
-    public TemplateModel get(int i) throws TemplateModelException {
-        return m_cList.get( i );
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return false;
-    }
-
-    @Override
-    public int size() {
-        return m_cList.size();
-    }
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        if ( key.equals( "empty" )) {
-            return new SimpleScalar( "Dummy hash value, for test purposes." );
-        } else {
-            return null;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel.java
deleted file mode 100644
index 9f51458..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel.java
+++ /dev/null
@@ -1,52 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-/**
- * Testcase to see how FreeMarker's ?new built-in deals with constructors.
- */
-public class NewTestModel
-implements
-    TemplateScalarModel {
-    private final String string;
-    
-    public NewTestModel() {
-        string = "default constructor";
-    }
-
-    public NewTestModel(String str) {
-        string = str;
-    }
-
-    public NewTestModel(long i) {
-        string = Long.toString(i);
-    }
-
-    public NewTestModel(Object o1, java.io.Serializable o2) {
-        string = o1 + ":" + o2;
-    }
-
-    @Override
-    public String getAsString() {
-        return string;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel2.java
deleted file mode 100644
index 420b4fa..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NewTestModel2.java
+++ /dev/null
@@ -1,52 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-/**
- * Testcase to see how FreeMarker's ?new built-in deals with constructors.
- */
-public class NewTestModel2
-implements
-    TemplateScalarModel {
-    private final String string;
-    
-    public NewTestModel2() {
-        string = "default constructor";
-    }
-
-    public NewTestModel2(String str) {
-        string = str;
-    }
-
-    public NewTestModel2(long i) {
-        string = Long.toString(i);
-    }
-
-    public NewTestModel2(Object o1, java.io.Serializable o2) {
-        string = o1 + ":" + o2;
-    }
-
-    @Override
-    public String getAsString() {
-        return string;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NumberAndStringModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NumberAndStringModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NumberAndStringModel.java
deleted file mode 100644
index 5c8e7db..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/NumberAndStringModel.java
+++ /dev/null
@@ -1,47 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-public class NumberAndStringModel implements TemplateNumberModel,
-		TemplateScalarModel {
-	
-	private final String s;
-	
-	public NumberAndStringModel(String s) {
-		super();
-		this.s = s;
-	}
-
-	@Override
-    public String getAsString() throws TemplateModelException {
-		return s;
-	}
-
-	@Override
-    @SuppressWarnings("boxing")
-    public Number getAsNumber() throws TemplateModelException {
-		return s.length();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedConstructor.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedConstructor.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedConstructor.java
deleted file mode 100644
index 6e09053..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedConstructor.java
+++ /dev/null
@@ -1,46 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-public class OverloadedConstructor implements TemplateScalarModel {
-    
-    String value;
-    
-    public OverloadedConstructor(int i) {
-        value = "int " + i;
-    }
-    
-    public OverloadedConstructor(String s) {
-        value = "String " + s;
-    }
-
-    public OverloadedConstructor(CharSequence s) {
-        value = "CharSequence " + s;
-    }
-    
-    @Override
-    public String getAsString() throws TemplateModelException {
-        return value;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods.java
deleted file mode 100644
index ebd505a..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods.java
+++ /dev/null
@@ -1,191 +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.test.templatesuite.models;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.freemarker.core.util.FTLUtil;
-
-/**
- * For testing overloaded method selection.
- */
-public class OverloadedMethods {
-
-	public String oneArg(Object a1) {
-		return methodCallToStr("oneArg<Object>", a1);
-	}
-
-	public String oneArg(String a1) {
-		return methodCallToStr("oneArg<String>", a1);
-	}
-
-	public String oneArg(Boolean a1) {
-		return methodCallToStr("oneArg<Boolean>", a1);
-	}
-
-	public String oneArg(boolean a1) {
-		return methodCallToStr("oneArg<boolean>", Boolean.valueOf(a1));
-	}
-	
-	public String oneArg(List a1) {
-		return methodCallToStr("oneArg<List>", a1);
-	}
-
-	public String oneArg(Map a1) {
-		return methodCallToStr("oneArg<Map>", a1);
-	}
-
-    public String oneArg2(Map a1) {
-        return methodCallToStr("oneArg2<Map>", a1);
-    }
-
-    public String oneArg2(List a1) {
-        return methodCallToStr("oneArg2<List>", a1);
-    }
-    
-    public String oneArg3(List a1, List a2) {
-        return methodCallToStr("oneArg3<List, List>", a1, a2);
-    }
-
-    public String oneArg3(List a1) {
-        return methodCallToStr("oneArg3<List>", a1);
-    }
-    
-    public String oneArg4(Integer a1) {
-        return methodCallToStr("oneArg4<Integer>", a1);
-    }
-
-    public String oneArg4(int a1) {
-        return methodCallToStr("oneArg4<int>", Integer.valueOf(a1));
-    }
-
-    public String notOverloaded(List a1) {
-        return methodCallToStr("notOverloaded<List>", a1);
-    }
-    
-	public String varargsIssue1(Map a1, List a2) {
-	    return methodCallToStr("varargsIssue1<Map, List>", a1, a2);
-	}
-
-    public String varargsIssue1(Object... a1) {
-        return methodCallToStr("varargsIssue1<Object...>", a1);
-    }
-
-    public String varargsIssue2(String a1, List a2) {
-        return methodCallToStr("varargsIssue2<String, List>", a1, a2);
-    }
-
-    public String varargsIssue2(String a1, Map a2) {
-        return methodCallToStr("varargsIssue2<String, Map>", a1, a2);
-    }
-
-    public String varargsIssue2(Object... a1) {
-        return methodCallToStr("varargsIssue2<Object...>", a1);
-    }
-    
-    public String numberIssue1(int a1) {
-        return methodCallToStr("numberIssue1<int>", a1);
-    }
-    
-    public String numberIssue1(float a1) {
-        return methodCallToStr("numberIssue1<float>", a1);
-    }
-    
-    public String numberIssue2(int a1) {
-        return methodCallToStr("numberIssue2<int>", a1);
-    }
-    
-    public String numberIssue2(BigDecimal a1) {
-        return methodCallToStr("numberIssue2<BigDecimal>", a1);
-    }
-
-    public String numberIssue3(int a1) {
-        return methodCallToStr("numberIssue3<int>", a1);
-    }
-    
-    public String numberIssue3(double a1) {
-        return methodCallToStr("numberIssue3<double>", a1);
-    }
-    
-	private String methodCallToStr(String methodName, Object... args) {
-		StringBuilder sb = new StringBuilder();
-		
-		sb.append(methodName);
-		sb.append('(');
-		boolean hadItems = false;
-		for (Object arg : args) {
-			if (hadItems) sb.append(", ");
-			sb.append(valueToStr(arg));
-			hadItems = true;
-		}
-		sb.append(')');
-		
-		return sb.toString();
-	}
-	
-	private String valueToStr(Object value) {
-		if (value == null) {
-		    return "null";
-		} else if (value instanceof Character) {
-			return "'" + FTLUtil.escapeStringLiteralPart(value.toString()) + "'";
-		} else if (value instanceof String) {
-			return "\"" + FTLUtil.escapeStringLiteralPart((String) value) + "\"";
-		} else if (value instanceof Map) {
-			StringBuilder sb = new StringBuilder(); 
-			sb.append("{");
-			boolean hadItems = false;
-			for (Map.Entry<?, ?> ent : ((Map<?, ?>) value).entrySet()) {
-				if (hadItems) sb.append(", ");
-				sb.append(valueToStr(ent.getKey()));
-				sb.append(": ");
-				sb.append(valueToStr(ent.getValue()));
-				hadItems = true;
-			}
-			sb.append("}");
-			return sb.toString();
-		} else if (value instanceof Collection || value.getClass().isArray()) {
-			StringBuilder sb = new StringBuilder();
-			
-	        if (value.getClass().isArray()) {
-	            value = Arrays.asList(value);
-                sb.append("array");
-	        } else if (value instanceof Set) {
-				sb.append("set");
-			}
-			sb.append("[");
-			boolean hadItems = false;
-			for (Object i : (Collection) value) {
-				if (hadItems) sb.append(", ");
-				sb.append(i);
-				hadItems = true;
-			}
-			sb.append("]");
-			return sb.toString();
-		} else {
-			return value.toString(); 
-		}
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods2.java
deleted file mode 100644
index 2c5a5df..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/OverloadedMethods2.java
+++ /dev/null
@@ -1,1110 +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.test.templatesuite.models;
-
-import java.io.File;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.freemarker.core.Environment;
-import org.apache.freemarker.core.model.AdapterTemplateModel;
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateModel;
-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;
-
-public class OverloadedMethods2 {
-
-    public String mVarargs(String... a1) {
-        StringBuilder sb = new StringBuilder();
-        for (String s : a1) {
-            sb.append(s);
-        }
-        return "mVarargs(String... a1 = " + sb + ")";
-    }
-    
-    public BigInteger bigInteger(BigDecimal n) {
-        return n.toBigInteger();
-    }
-
-    public RationalNumber rational(int a, int b) {
-        return new RationalNumber(a, b);
-    }
-    
-    public String mVarargs(File a1, String... a2) {
-        return "mVarargs(File a1, String... a2)";
-    }
-
-    public NumberAndStringModel getNnS(String s) {
-        return new NumberAndStringModel(s);
-    }
-    
-    public String mNull1(String a1) {
-        return "mNull1(String a1 = " + a1 + ")";
-    }
-
-    public String mNull1(int a1) {
-        return "mNull1(int a1 = " + a1 + ")";
-    }
-    
-    public String mNull2(String a1) {
-        return "mNull2(String a1 = " + a1 + ")";
-    }
-    
-    public String mNull2(Object a1) {
-        return "mNull2(Object a1 = " + a1 + ")";
-    }
-    
-    public String mSpecificity(Object a1, String a2) {
-        return "mSpecificity(Object a1, String a2)";
-    }
-    
-    public String mSpecificity(String a1, Object a2) {
-        return "mSpecificity(String a1, Object a2)";
-    }
-    
-    public String mChar(char a1) {
-        return "mChar(char a1 = " + a1 + ")";
-    }
-    
-    public String mChar(Character a1) {
-        return "mChar(Character a1 = " + a1 + ")";
-    }
-    
-    public String mBoolean(boolean a1) {
-        return "mBoolean(boolean a1 = " + a1 + ")";
-    }
-    
-    public String mBoolean(Boolean a1) {
-        return "mBoolean(Boolean a1 = " + a1 + ")";
-    }
-
-    public int mIntNonOverloaded(int a1) {
-        return a1;
-    }
-
-    public String mIntPrimVSBoxed(int a1) {
-        return "mIntPrimVSBoxed(int a1 = " + a1 + ")";
-    }
-    
-    public String mIntPrimVSBoxed(Integer a1) {
-        return "mIntPrimVSBoxed(Integer a1 = " + a1 + ")";
-    }
-
-    public String mNumPrimVSPrim(short a1) {
-        return "mNumPrimVSPrim(short a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimVSPrim(long a1) {
-        return "mNumPrimVSPrim(long a1 = " + a1 + ")";
-    }
-
-    public String mNumBoxedVSBoxed(Short a1) {
-        return "mNumBoxedVSBoxed(Short a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedVSBoxed(Long a1) {
-        return "mNumBoxedVSBoxed(Long a1 = " + a1 + ")";
-    }
-
-    public String mNumUnambigous(Short a1, boolean otherOverload) {
-        return "mmNumUnambigous won't be called";
-    }
-    
-    public String mNumUnambigous(Integer a1) {
-        return "mNumUnambigous(Integer a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(Byte a1) {
-        return "mNumBoxedAll(Byte a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(Short a1) {
-        return "mNumBoxedAll(Short a1 = " + a1 + ")";
-    }
-
-    public String mNumBoxedAll(Integer a1) {
-        return "mNumBoxedAll(Integer a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(Long a1) {
-        return "mNumBoxedAll(Long a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(Float a1) {
-        return "mNumBoxedAll(Float a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(Double a1) {
-        return "mNumBoxedAll(Double a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(BigInteger a1) {
-        return "mNumBoxedAll(BigInteger a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll(BigDecimal a1) {
-        return "mNumBoxedAll(BigDecimal a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(byte a1) {
-        return "mNumPrimAll(byte a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(short a1) {
-        return "mNumPrimAll(short a1 = " + a1 + ")";
-    }
-
-    public String mNumPrimAll(int a1) {
-        return "mNumPrimAll(int a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(long a1) {
-        return "mNumPrimAll(long a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(float a1) {
-        return "mNumPrimAll(float a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(double a1) {
-        return "mNumPrimAll(double a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(BigInteger a1) {
-        return "mNumPrimAll(BigInteger a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll(BigDecimal a1) {
-        return "mNumPrimAll(BigDecimal a1 = " + a1 + ")";
-    }
-
-    
-    public String mNumBoxedAll2nd(Short a1) {
-        return "mNumBoxedAll2nd(Short a1 = " + a1 + ")";
-    }
-
-    public String mNumBoxedAll2nd(Long a1) {
-        return "mNumBoxedAll2nd(Long a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedAll2nd(Double a1) {
-        return "mNumBoxedAll2nd(Double a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll2nd(short a1) {
-        return "mNumPrimAll2nd(short a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll2nd(long a1) {
-        return "mNumPrimAll2nd(long a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimAll2nd(double a1) {
-        return "mNumPrimAll2nd(double a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimFallbackToNumber(long a1) {
-        return "mNumPrimFallbackToNumber(long a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimFallbackToNumber(Number a1) {
-        return "mNumPrimFallbackToNumber(Number a1 = " + a1 + ")";
-    }
-    
-    public String mNumPrimFallbackToNumber(Object a1) {
-        return "mNumPrimFallbackToNumber(Object a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedFallbackToNumber(Long a1) {
-        return "mNumBoxedFallbackToNumber(Long a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedFallbackToNumber(Number a1) {
-        return "mNumBoxedFallbackToNumber(Number a1 = " + a1 + ")";
-    }
-    
-    public String mNumBoxedFallbackToNumber(Object a1) {
-        return "mNumBoxedFallbackToNumber(Object a1 = " + a1 + ")";
-    }
-
-    public String mDecimalLoss(int a1) {
-        return "mDecimalLoss(int a1 = " + a1 + ")";
-    }
-        
-    public String mDecimalLoss(double a1) {
-        return "mDecimalLoss(double a1 = " + a1 + ")";
-    }
-    
-    public String mNumConversionLoses1(byte i, Object o1, Object o2) {
-        return "byte " + i;
-    }
-    
-    public String mNumConversionLoses1(double i, Object o1, Object o2) {
-        return "double " + i;
-    }
-
-    public String mNumConversionLoses1(Number i, String o1, String o2) {
-        return "Number " + i + " " + i.getClass().getName();
-    }
-
-    public String mNumConversionLoses2(int i, Object o1, Object o2) {
-        return "int " + i;
-    }
-
-    public String mNumConversionLoses2(long i, Object o1, Object o2) {
-        return "long " + i;
-    }
-
-    public String mNumConversionLoses2(Number i, String o1, String o2) {
-        return "Number " + i + " " + i.getClass().getName();
-    }
-
-    public String mNumConversionLoses3(int i, Object o1, Object o2) {
-        return "int " + i;
-    }
-
-    public String mNumConversionLoses3(Serializable i, String o1, String o2) {
-        return "Serializable " + i + " " + i.getClass().getName();
-    }
-    
-    public String nIntAndLong(int i) {
-        return "nIntAndLong(int " + i + ")";
-    }
-    
-    public String nIntAndLong(long i) {
-        return "nIntAndLong(long " + i + ")";
-    }
-
-    public String nIntAndShort(int i) {
-        return "nIntAndShort(int " + i + ")";
-    }
-    
-    public String nIntAndShort(short i) {
-        return "nIntAndShort(short " + i + ")";
-    }
-
-    public String nLongAndShort(long i) {
-        return "nLongAndShort(long " + i + ")";
-    }
-    
-    public String nLongAndShort(short i) {
-        return "nLongAndShort(short " + i + ")";
-    }
-
-    public String varargs1(String s, int... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs1(String s, double... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", double... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs1(String s, Object... xs) {
-        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs1(Object s, Object... xs) {
-        return "varargs1(Object s = " + s + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs2(int... xs) {
-        return "varargs2(int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs2(double... xs) {
-        return "varargs2(double... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs3(String... xs) {
-        return "varargs3(String... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs3(Comparable... xs) {
-        return "varargs3(Comparable... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs3(Object... xs) {
-        return "varargs3(Object... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs4(Integer... xs) {
-        return "varargs4(Integer... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs4(int... xs) {
-        return "varargs4(int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-
-    public String varargs5(int... xs) {
-        return "varargs5(int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs5(int a1, int... xs) {
-        return "varargs5(int a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs5(int a1, int a2, int... xs) {
-        return "varargs5(int a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.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) + ")";
-    }
-
-    public String varargs6(String a1, int... xs) {
-        return "varargs6(String a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs6(Object a1, int a2, int... xs) {
-        return "varargs6(Object a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs7(int... xs) {
-        return "varargs7(int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String varargs7(short a1, int... xs) {
-        return "varargs7(short a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
-    }
-    
-    public String mNullAmbiguous(String s) {
-        return "mNullAmbiguous(String s = " + s + ")";
-    }
-
-    public String mNullAmbiguous(int i) {
-        return "mNullAmbiguous(int i = " + i + ")";
-    }
-
-    public String mNullAmbiguous(File f) {
-        return "mNullAmbiguous(File f = " + f + ")";
-    }
-    
-    public String mNullAmbiguous2(String s) {
-        return "mNullNonAmbiguous(String s = " + s + ")";
-    }
-
-    public String mNullAmbiguous2(File f) {
-        return "mNullAmbiguous(File f = " + f + ")";
-    }
-
-    public String mNullAmbiguous2(Object o) {
-        return "mNullAmbiguous(Object o = " + o + ")";
-    }
-
-    public String mNullNonAmbiguous(String s) {
-        return "mNullNonAmbiguous(String s = " + s + ")";
-    }
-
-    public String mNullNonAmbiguous(int i) {
-        return "mNullNonAmbiguous(int i = " + i + ")";
-    }
-    
-    public String mVarargsIgnoredTail(int i, double... ds) {
-        return "mVarargsIgnoredTail(int i = " + i + ", double... ds = " + TestUtil.arrayToString(ds) + ")";
-    }
-    
-    public String mVarargsIgnoredTail(int... is) {
-        return "mVarargsIgnoredTail(int... is = " + TestUtil.arrayToString(is) + ")";
-    }
-    
-    public String mLowRankWins(int x, int y, Object o) {
-        return "mLowRankWins(int x = " + x + ", int y = " + y + ", Object o = " + o + ")";
-    }
-
-    public String mLowRankWins(Integer x, Integer y, String s) {
-        return "mLowRankWins(Integer x = " + x + ", Integer y = " + y + ", String s = " + s + ")";
-    }
-    
-    public String mRareWrappings(File f, double d1, Double d2, double d3, boolean b) {
-        return "mRareWrappings(File f = " + f + ", double d1 = " + d1 + ", Double d2 = " + d2
-                + ", double d3 = " + d3 + ", b = " + b + ")";
-    }
-
-    public String mRareWrappings(Object o, double d1, Double d2, Double d3, boolean b) {
-        return "mRareWrappings(Object o = " + o + ", double d1 = " + d1 + ", Double d2 = " + d2
-                + ", double d3 = " + d3 + ", b = " + b + ")";
-    }
-
-    public String mRareWrappings(String s, double d1, Double d2, Double d3, boolean b) {
-        return "mRareWrappings(String s = " + s + ", double d1 = " + d1 + ", Double d2 = " + d2
-                + ", double d3 = " + d3 + ", b = " + b + ")";
-    }
-
-    public String mRareWrappings2(String s) {
-        return "mRareWrappings2(String s = " + s + ")";
-    }
-    
-    public String mRareWrappings2(byte b) {
-        return "mRareWrappings2(byte b = " + b + ")";
-    }
-    
-    public File getFile() {
-        return new File("file");
-    }
-
-    public String mSeqToArrayNonOverloaded(String[] items, String s) {
-        return "mSeqToArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
-    }
-    
-    public String mSeqToArrayGoodHint(String[] items, String s) {
-        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
-    }
-
-    public String mSeqToArrayGoodHint(String[] items, int i) {
-        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
-    }
-
-    public String mSeqToArrayGoodHint2(String[] items, String s) {
-        return "mSeqToArrayGoodHint2(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
-    }
-
-    public String mSeqToArrayGoodHint2(String item) {
-        return "mSeqToArrayGoodHint2(String " + item + ")";
-    }
-    
-    public String mSeqToArrayPoorHint(String[] items, String s) {
-        return "mSeqToArrayPoorHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
-    }
-
-    public String mSeqToArrayPoorHint(String item, int i) {
-        return "mSeqToArrayPoorHint(String " + item + ", int " + i + ")";
-    }
-
-    public String mSeqToArrayPoorHint2(String[] items) {
-        return "mSeqToArrayPoorHint2(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mSeqToArrayPoorHint2(String item) {
-        return "mSeqToArrayPoorHint2(String " + item + ")";
-    }
-    
-    public String mSeqToArrayPoorHint3(String[] items) {
-        return "mSeqToArrayPoorHint3(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mSeqToArrayPoorHint3(int[] items) {
-        return "mSeqToArrayPoorHint3(int[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVsListPreference(String[] items) {
-        return "mStringArrayVsListPreference(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVsListPreference(List items) {
-        return "mStringArrayVsListPreference(List " + TestUtil.listToString(items) + ")";
-    }
-
-    public String mStringArrayVsObjectArrayPreference(String[] items) {
-        return "mStringArrayVsObjectArrayPreference(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVsObjectArrayPreference(Object[] items) {
-        return "mStringArrayVsObjectArrayPreference(Object[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mIntArrayVsIntegerArrayPreference(int[] items) {
-        return "mIntArrayVsIntegerArrayPreference(int[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mIntArrayVsIntegerArrayPreference(Integer[] items) {
-        return "mIntArrayVsIntegerArrayPreference(Integer[] " + TestUtil.arrayToString(items) + ")";
-    }
-    
-    public String mIntArrayNonOverloaded(int[] items) {
-        return "mIntArrayNonOverloaded(int[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mIntegerArrayNonOverloaded(Integer[] items) {
-        return "mIntegerArrayNonOverloaded(Integer[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mIntegerListNonOverloaded(List<Integer> items) {
-        return "mIntegerListNonOverloaded(List<Integer> " + items + ")";
-    }
-
-    public String mStringListNonOverloaded(List<String> items) {
-        return "mStringListNonOverloaded(List<String> " + items + ")";
-    }
-
-    public String mStringArrayNonOverloaded(String[] items) {
-        return "mStringArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mObjectListNonOverloaded(List<Object> items) {
-        return "mObjectListNonOverloaded(List<Object> " + items + ")";
-    }
-
-    public String mObjectArrayNonOverloaded(Object[] items) {
-        return "mObjectArrayNonOverloaded(Object[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mIntegerArrayOverloaded(Integer[] items, int i) {
-        return "mIntegerArrayOverloaded(Integer[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
-    }
-
-    public String mIntegerArrayOverloaded(Object obj, boolean b) {
-        return "mIntegerArrayOverloaded(Object " + obj + ", boolean " + b + ")";
-    }
-
-    public String mStringArrayOverloaded(String[] items, int i) {
-        return "mStringArrayOverloaded(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
-    }
-
-    public String mStringArrayOverloaded(Object obj, boolean b) {
-        return "mStringArrayOverloaded(Object " + obj + ", boolean " + b + ")";
-    }
-
-    public String mCharArrayOverloaded(char[] items, int i) {
-        return "mCharArrayOverloaded(char[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
-    }
-
-    public String mCharArrayOverloaded(Character[] items, String s) {
-        return "mCharArrayOverloaded(Character[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
-    }
-    
-    public String mCharArrayOverloaded(Object obj, boolean b) {
-        return "mCharArrayOverloaded(Object " + obj + ", boolean " + b + ")";
-    }
-
-    public String mStringArrayArrayOverloaded(String[][] arrayArray, int i) {
-        return "mStringArrayArrayOverloaded(String[][] " + TestUtil.arrayToString(arrayArray) + ", int " + i + ")";
-    }
-    
-    public String mStringArrayArrayOverloaded(Object obj, boolean b) {
-        return "mStringArrayArrayOverloaded(Object " + obj + ", boolean " + b + ")";
-    }
-    
-    public String mIntArrayArrayOverloaded(int[][] xss) {
-        return "mIntArrayArrayOverloaded(" + TestUtil.arrayToString(xss) + ")";
-    }
-
-    public String mIntArrayArrayOverloaded(String s) {
-        return "mIntArrayArrayOverloaded(" + s + ")";
-    }
-    
-    public String mArrayOfListsOverloaded(List[] xss) {
-        return "mArrayOfListsOverloaded(" + TestUtil.arrayToString(xss) + ")";
-    }
-
-    public String mArrayOfListsOverloaded(String x) {
-        return "mArrayOfListsOverloaded(" + x + ")";
-    }
-    
-    public String mIntArrayArrayNonOverloaded(int[][] xss) {
-        return "mIntArrayArrayNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
-    }
-
-    public String mArrayOfListsNonOverloaded(List[] xss) {
-        return "mArrayOfListsNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
-    }
-    
-    public String mStringArrayVarargsNonOverloaded(String... items) {
-        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded(String... items) {
-        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded1(String... items) {
-        return "mStringArrayVarargsOverloaded1(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded1(List<String> items) {
-        return "mStringArrayVarargsOverloaded1(List " + TestUtil.listToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded2(String... items) {
-        return "mStringArrayVarargsOverloaded2(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded2(String item) {
-        return "mStringArrayVarargsOverloaded2(String " + item + ")";
-    }
-    
-    public String mStringArrayVarargsOverloaded3(String... items) {
-        return "mStringArrayVarargsOverloaded3(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded3(String item1, String item2) {
-        return "mStringArrayVarargsOverloaded3(String " + item1 + ", String " + item2 + ")";
-    }
-    
-    public String mStringArrayVarargsOverloaded4(String... items) {
-        return "mStringArrayVarargsOverloaded4(String[] " + TestUtil.arrayToString(items) + ")";
-    }
-
-    public String mStringArrayVarargsOverloaded4(List... items) {
-        return "mStringArrayVarargsOverloaded4(List[] " + TestUtil.arrayToString(items) + ")";
-    }
-    
-    public String mListOrString(List<String> items) {
-        return "mListOrString(List " + TestUtil.listToString(items) + ")";
-    }
-
-    public String mListOrString(String item) {
-        return "mListOrString(String " + item + ")";
-    }
-
-    public String mListListOrString(List<List<Object>> items) {
-        return "mListListOrString(List " + TestUtil.listToString(items) + ")";
-    }
-
-    public String mListListOrString(String item) {
-        return "mListListOrString(String " + item + ")";
-    }
-    
-    public String mMapOrBoolean(Map v) {
-        return "mMapOrBoolean(Map " + v + ")";
-    }
-
-    public String mMapOrBoolean(boolean v) {
-        return "mMapOrBoolean(boolean " + v + ")";
-    }
-
-    public String mMapOrBooleanVarargs(Map... v) {
-        return "mMapOrBooleanVarargs(Map... " + TestUtil.arrayToString(v) + ")";
-    }
-
-    public String mMapOrBooleanVarargs(boolean... v) {
-        return "mMapOrBooleanVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
-    }
-
-    public String mMapOrBooleanFixedAndVarargs(Map v) {
-        return "mMapOrBooleanFixedAndVarargs(Map " + v + ")";
-    }
-
-    public String mMapOrBooleanFixedAndVarargs(boolean v) {
-        return "mMapOrBooleanFixedAndVarargs(boolean " + v + ")";
-    }
-
-    public String mMapOrBooleanFixedAndVarargs(Map... v) {
-        return "mMapOrBooleanFixedAndVarargs(Map... " + TestUtil.arrayToString(v) + ")";
-    }
-
-    public String mMapOrBooleanFixedAndVarargs(boolean... v) {
-        return "mMapOrBooleanFixedAndVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mNumberOrArray(Number v) {
-        return "mNumberOrArray(Number " + v + ")";
-    }
-
-    public String mNumberOrArray(Object[] v) {
-        return "mNumberOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mIntOrArray(int v) {
-        return "mIntOrArray(int " + v + ")";
-    }
-
-    public String mIntOrArray(Object[] v) {
-        return "mIntOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-
-    public String mDateOrArray(Date v) {
-        return "mDateOrArray(Date " + v.getTime() + ")";
-    }
-
-    public String mDateOrArray(Object[] v) {
-        return "mDateOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mStringOrArray(String v) {
-        return "mStringOrArray(String " + v + ")";
-    }
-
-    public String mStringOrArray(Object[] v) {
-        return "mStringOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mBooleanOrArray(boolean v) {
-        return "mBooleanOrArray(boolean " + v + ")";
-    }
-
-    public String mBooleanOrArray(Object[] v) {
-        return "mBooleanOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mMapOrArray(Map v) {
-        return "mMapOrArray(Map " + v + ")";
-    }
-
-    public String mMapOrArray(Object[] v) {
-        return "mMapOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mListOrArray(List v) {
-        return "mListOrArray(List " + v + ")";
-    }
-
-    public String mListOrArray(Object[] v) {
-        return "mListOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mSetOrArray(Set v) {
-        return "mSetOrArray(Set " + v + ")";
-    }
-
-    public String mSetOrArray(Object[] v) {
-        return "mSetOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
-    }
-    
-    public String mCharNonOverloaded(char c) {
-        return "mCharNonOverloaded(char " + c + ")";
-    }
-
-    public String mCharacterNonOverloaded(Character c) {
-        return "mCharacterNonOverloaded(Character " + c + ")";
-    }
-    
-    public String mCharOrCharacterOverloaded(char c) {
-        return "mCharOrCharacterOverloaded(char " + c + ")";
-    }
-
-    public String mCharOrCharacterOverloaded(Character c) {
-        return "mCharOrCharacterOverloaded(Character " + c + ")";
-    }
-
-    public String mCharOrBooleanOverloaded(char c) {
-        return "mCharOrBooleanOverloaded(char " + c + ")";
-    }
-
-    public String mCharOrBooleanOverloaded(boolean b) {
-        return "mCharOrBooleanOverloaded(boolean " + b + ")";
-    }
-
-    public String mCharOrStringOverloaded(char c, boolean b) {
-        return "mCharOrStringOverloaded(char " + c + ", boolean " + b + ")";
-    }
-
-    public String mCharOrStringOverloaded(String s, int i) {
-        return "mCharOrStringOverloaded(String " + s + ", int " + i + ")";
-    }
-
-    public String mCharacterOrStringOverloaded(Character c, boolean b) {
-        return "mCharacterOrStringOverloaded(Character " + c + ", boolean " + b + ")";
-    }
-
-    public String mCharacterOrStringOverloaded(String s, int i) {
-        return "mCharacterOrStringOverloaded(String " + s + ", int " + i + ")";
-    }
-    
-    public String mCharOrStringOverloaded2(String s) {
-        return "mCharOrStringOverloaded2(String " + s + ")";
-    }
-
-    public String mCharOrStringOverloaded2(char c) {
-        return "mCharOrStringOverloaded2(char " + c + ")";
-    }
-    
-    public String mCharacterOrStringOverloaded2(String s) {
-        return "mCharacterOrStringOverloaded2(String " + s + ")";
-    }
-
-    public String mCharacterOrStringOverloaded2(Character c) {
-        return "mCharacterOrStringOverloaded2(Character " + c + ")";
-    }
-    
-
-    public String getJavaString() {
-        return "s";
-    }
-    
-    public List getJavaStringList() {
-        List list = new ArrayList();
-        list.add("a");
-        list.add("b");
-        return list;
-    }
-
-    public List getJavaString2List() {
-        List list = new ArrayList();
-        list.add("aa");
-        list.add("bb");
-        return list;
-    }
-
-    public List getJavaStringListList() {
-        List listList = new ArrayList();
-        {
-            List list = new ArrayList();
-            list.add("a");
-            list.add("b");
-            
-            listList.add(list);
-        }
-        {
-            List list = new ArrayList();
-            list.add("c");
-            
-            listList.add(list);
-        }
-        return listList;
-    }
-
-    public List getJavaStringSequenceList() throws TemplateModelException {
-        ObjectWrapper ow = Environment.getCurrentEnvironment().getObjectWrapper();
-        
-        List listList = new ArrayList();
-        {
-            List list = new ArrayList();
-            list.add("a");
-            list.add("b");
-            
-            listList.add(ow.wrap(list));
-        }
-        {
-            List list = new ArrayList();
-            list.add("c");
-            
-            listList.add(ow.wrap(list));
-        }
-        return listList;
-    }
-    
-    public List<int[]> getJavaListOfIntArrays() {
-        List list = new ArrayList();
-        list.add(new int[] {1, 2, 3});
-        list.add(new int[] {});
-        list.add(new int[] {4});
-        return list;
-    }
-    
-    @SuppressWarnings("boxing")
-    public List getJavaIntegerListList() {
-        List listList = new ArrayList();
-        {
-            List list = new ArrayList();
-            list.add(1);
-            list.add(2);
-            
-            listList.add(list);
-        }
-        {
-            List list = new ArrayList();
-            list.add(3);
-            
-            listList.add(list);
-        }
-        return listList;
-    }
-    
-    @SuppressWarnings("boxing")
-    public List<Integer> getJavaIntegerList() {
-        List<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(2);
-        return list;
-    }
-
-    @SuppressWarnings("boxing")
-    public List<Byte> getJavaByteList() {
-        List<Byte> list = new ArrayList<>();
-        list.add((byte) 1);
-        list.add((byte) 2);
-        return list;
-    }
-
-    @SuppressWarnings("boxing")
-    public List<Character> getJavaCharacterList() {
-        List<Character> list = new ArrayList<>();
-        list.add('c');
-        list.add('C');
-        return list;
-    }
-    
-    public String[] getJavaStringArray() {
-        return new String[] { "a", "b" };
-    }
-
-    public int[] getJavaIntArray() {
-        return new int[] { 11, 22 };
-    }
-
-    public Integer[] getJavaIntegerArray() {
-        return new Integer[] { Integer.valueOf(11), Integer.valueOf(22) };
-    }
-    
-    public String[] getJavaEmptyStringArray() {
-        return new String[] { };
-    }
-    
-    public String[][] getJavaStringArrayArray() {
-        return new String[][] { new String[] { "a", "b" }, new String[] { }, new String[] { "c" } };
-    }
-    
-    public Object[] getJavaObjectArray() {
-        return new Object[] { "a", "b" };
-    }
-    
-    public TemplateModel getHashAndScalarModel() {
-        return HashAndScalarModel.INSTANCE;
-    }
-
-    public TemplateModel getBooleanAndScalarModel() {
-        return BooleanAndScalarModel.INSTANCE;
-    }
-    
-    public TemplateModel getAllModels() {
-        return AllTemplateModels.INSTANCE;
-    }
-
-    public TemplateNumberModel getAdaptedNumber() {
-        return new MyAdapterNumberModel();
-    }
-
-    public TemplateNumberModel getWrapperNumber() {
-        return new MyWrapperNumberModel();
-    }
-
-    public TemplateBooleanModel getStringAdaptedToBoolean() {
-        return new MyStringAdaptedToBooleanModel();
-    }
-    
-    public TemplateBooleanModel getStringAdaptedToBoolean2() {
-        return new MyStringAdaptedToBooleanModel2();
-    }
-    
-    public TemplateBooleanModel getStringWrappedAsBoolean() {
-        return new MyStringWrapperAsBooleanModel();
-    }
-    
-    public TemplateBooleanModel getBooleanWrappedAsAnotherBoolean() {
-        return new MyBooleanWrapperAsAnotherBooleanModel(); 
-    }
-    
-    public String bugReport363(Map<String, ?> fields, List<?> listField) {
-        return "Executed: testMethod(Map fields, List listField) on input: fields=" + fields
-                + " and listField=" + listField;
-    }
-
-    public String bugReport363(Object... fields) {
-        return "Executed: testMethod(Object... fields) on input: fields=" + TestUtil.arrayToString(fields);
-    }
-    
-    private static class MyAdapterNumberModel implements TemplateNumberModel, AdapterTemplateModel {
-
-        @Override
-        public Object getAdaptedObject(Class hint) {
-            if (hint == double.class) {
-                return Double.valueOf(123.0001);
-            } else if (hint == Double.class) {
-                return Double.valueOf(123.0002);
-            } else {
-                return Long.valueOf(124L);
-            }
-        }
-
-        @Override
-        public Number getAsNumber() throws TemplateModelException {
-            return Integer.valueOf(122);
-        }
-        
-    }
-    
-    private static class MyWrapperNumberModel implements TemplateNumberModel, WrapperTemplateModel {
-
-        @Override
-        public Number getAsNumber() throws TemplateModelException {
-            return Integer.valueOf(122);
-        }
-
-        @Override
-        public Object getWrappedObject() {
-            return Double.valueOf(123.0001);
-        }
-        
-    }
-    
-    private static class MyStringWrapperAsBooleanModel implements TemplateBooleanModel, WrapperTemplateModel {
-
-        @Override
-        public Object getWrappedObject() {
-            return "yes";
-        }
-
-        @Override
-        public boolean getAsBoolean() throws TemplateModelException {
-            return true;
-        }
-        
-    }
-
-    private static class MyBooleanWrapperAsAnotherBooleanModel implements TemplateBooleanModel, WrapperTemplateModel {
-
-        @Override
-        public Object getWrappedObject() {
-            return Boolean.TRUE;
-        }
-
-        @Override
-        public boolean getAsBoolean() throws TemplateModelException {
-            return false;
-        }
-        
-    }
-    
-    private static class MyStringAdaptedToBooleanModel implements TemplateBooleanModel, AdapterTemplateModel {
-
-        @Override
-        public Object getAdaptedObject(Class hint) {
-            if (hint != Boolean.class && hint != boolean.class) {
-                return "yes";
-            } else {
-                return Boolean.TRUE;
-            }
-        }
-
-        @Override
-        public boolean getAsBoolean() throws TemplateModelException {
-            return false;
-        }
-        
-    }
-
-    private static class MyStringAdaptedToBooleanModel2 implements TemplateBooleanModel, AdapterTemplateModel {
-
-        @Override
-        public Object getAdaptedObject(Class hint) {
-            return "yes";
-        }
-
-        @Override
-        public boolean getAsBoolean() throws TemplateModelException {
-            return true;
-        }
-        
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
deleted file mode 100644
index bd445c6..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
+++ /dev/null
@@ -1,60 +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.test.templatesuite.models;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Forces using "simple" models for {@link Map}-s, {@link Collection}-s and arrays. This is mostly useful for template
- * test cases that wish to test with these models, but otherwise need to able to wrap beans and such. 
- */
-public class SimpleMapAndCollectionObjectWrapper extends DefaultObjectWrapper {
-
-    public SimpleMapAndCollectionObjectWrapper(Version incompatibleImprovements) {
-        super(new DefaultObjectWrapper.Builder(incompatibleImprovements), true);
-    }
-
-    @Override
-    public TemplateModel wrap(Object obj) throws TemplateModelException {
-        if (obj == null) {
-            return super.wrap(null);
-        }        
-        if (obj.getClass().isArray()) {
-            obj = Arrays.asList((Object[]) obj);
-        }
-        if (obj instanceof Collection) {
-            return new SimpleSequence((Collection<?>) obj, this);
-        }
-        if (obj instanceof Map) {
-            return new SimpleHash((Map<?, ?>) obj, this);
-        }
-        
-        return super.wrap(obj);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleTestMethod.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleTestMethod.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleTestMethod.java
deleted file mode 100644
index 85e27d7..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/SimpleTestMethod.java
+++ /dev/null
@@ -1,49 +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.test.templatesuite.models;
-
-import java.util.List;
-
-import org.apache.freemarker.core.model.TemplateMethodModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-/**
- * A simple method model used as a test bed.
- */
-public class SimpleTestMethod implements TemplateMethodModel {
-
-    /**
-     * Executes a method call.
-     *
-     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
-     * the values of the arguments passed to the method.
-     * @return the <tt>TemplateModel</tt> produced by the method, or null.
-     */
-    @Override
-    public Object exec(List arguments) {
-        if ( arguments.size() == 0 ) {
-            return new SimpleScalar( "Empty list provided" );
-        } else if ( arguments.size() > 1 ) {
-            return new SimpleScalar( "Argument size is: " + arguments.size() );
-        } else {
-            return new SimpleScalar( "Single argument value is: " + arguments.get(0) );
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformHashWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformHashWrapper.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformHashWrapper.java
deleted file mode 100644
index 4602b67..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformHashWrapper.java
+++ /dev/null
@@ -1,79 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-import org.apache.freemarker.core.util.HtmlEscape;
-import org.apache.freemarker.core.util.StandardCompress;
-
-/**
- * Part of the TestTransform testcase suite.
- */
-public class TransformHashWrapper implements TemplateHashModel,
-        TemplateScalarModel {
-
-    private ObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
-    private SimpleHash m_cHashModel = new SimpleHash(ow);
-
-    /** Creates new TransformHashWrapper */
-    public TransformHashWrapper() {
-        m_cHashModel.put( "htmlEscape", new HtmlEscape() );
-        m_cHashModel.put( "compress", new StandardCompress() );
-        m_cHashModel.put( "escape", new TransformMethodWrapper1() );
-        m_cHashModel.put( "special", new TransformMethodWrapper2() );
-    }
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) throws TemplateModelException {
-        return m_cHashModel.get( key );
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return false;
-    }
-
-    /**
-     * Returns the scalar's value as a String.
-     * @return the String value of this scalar.
-     */
-    @Override
-    public String getAsString() {
-        return "Utility transformations";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
deleted file mode 100644
index 8311134..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
+++ /dev/null
@@ -1,49 +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.test.templatesuite.models;
-
-import java.util.List;
-
-import org.apache.freemarker.core.model.TemplateMethodModel;
-import org.apache.freemarker.core.util.HtmlEscape;
-import org.apache.freemarker.core.util.XmlEscape;
-
-/**
- * Simple test of the interaction between MethodModels and TransformModels.
- */
-public class TransformMethodWrapper1 implements TemplateMethodModel {
-
-    /**
-     * Executes a method call.
-     *
-     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
-     * the values of the arguments passed to the method.
-     * @return the <tt>TemplateModel</tt> produced by the method, or null.
-     */
-    @Override
-    public Object exec(List arguments) {
-
-        if (( arguments.size() > 0 ) && ( arguments.get( 0 ).toString().equals( "xml" ))) {
-            return new XmlEscape();
-        } else {
-            return new HtmlEscape();
-        }
-    }
-}


[06/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/varargs.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/varargs.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/varargs.txt
deleted file mode 100644
index a310855..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/varargs.txt
+++ /dev/null
@@ -1,44 +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.
- */
-
-0 == 0
-0 == 0
-11 == 11
-11 == 11
-1122 == 1122
-1122 == 1122
-112233 == 112233
-112233 == 112233
-
--22334411 == -22334411
--223311 == -223311
--2211 == -2211
--11 == -11
-
-0 == 0
--11 == -11
-1122 == 1122
--112233 == -112233
--11223344 == -11223344
--1122334455 == -1122334455
-
-1122 == 1122
--1122 == -1122
-
-string, true, 123, 1000000 == string, true, 123, 1000000

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/variables.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/variables.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/variables.txt
deleted file mode 100644
index 5365b07..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/variables.txt
+++ /dev/null
@@ -1,62 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Variable Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now get into variable nesting:</p>
-
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-<p>My message.</p>
-
-<p>More deep nesting...</p>
-
-<p>My message.</p>
-<p>one</p>
-<p>one</p>
-
-
-<p>Nesting inside nesting...</p>
-
-<p>two</p>
-<p>two</p>
-<p>two</p>
-<p>two</p>
-
-<p>Test underscores...</p>
-
-<p>out</p>
-<p>out</p>
-
-SAVE
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/whitespace-trim.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/whitespace-trim.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/whitespace-trim.txt
deleted file mode 100644
index e74163a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/whitespace-trim.txt
+++ /dev/null
@@ -1,60 +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.
- */
-LB
-LB
-LB
-LB
-  IB
-  IC1  IC2C1C2  ICS CS1 CS2 C3C1C2
-B
-B
-C1CB
-C1
-C2  ICB
-  IC  ICB
-  ICCB
---
-LB
-LB
-LB
-LB
-  IB
-  IC1  IC2C1C2  ICS CS1 CS2 C3C1C2
-B
-B
-C1CB
-C1
-C2  ICB
-  IC  ICB
-  ICCB
---
-  IB
-  IC1C2  IB
-12
----
-1 23
-  4
-  5  6
----
-a
-bc
----
-foo
----
-foo

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstrip-in-header.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstrip-in-header.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstrip-in-header.txt
deleted file mode 100644
index 2cb2913..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstrip-in-header.txt
+++ /dev/null
@@ -1,23 +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.
- */
-a
-
-b
-a
-b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstripping.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstripping.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstripping.txt
deleted file mode 100644
index 2aae297..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/wstripping.txt
+++ /dev/null
@@ -1,39 +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.
- */
-a
-b
-c 
-d
-e2
-f
-g
-x
-  x
-    x
-  y
-y
-x
-y
-x
-y
-a
-  x
-b
-  x
-c
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-fragment.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-fragment.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-fragment.txt
deleted file mode 100644
index cb0da5f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-fragment.txt
+++ /dev/null
@@ -1,25 +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.
- */
-b = b
-@document = @document
-@document = @document
-
-C<>&"']]> = C<>&"']]>
-
-<root xmlns:n="http://x"><a><b><n:c>C&lt;>&amp;"']]&gt;</n:c></b></a></root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-ns_prefix-scope.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-ns_prefix-scope.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-ns_prefix-scope.txt
deleted file mode 100644
index bf8e6bd..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml-ns_prefix-scope.txt
+++ /dev/null
@@ -1,29 +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.
- */
-//e: e in NS namespace-test, e in NS namespace-test
-//n:e: e in NS foo, e in NS foo
-//bar:e: e in NS bar, e in NS bar
-
-Included:
-//n:e: e in NS foo, e in NS foo
-//n:e: e in NS foo, e in NS foo
-
-Imported:
-//n:e: e in NS bar, e in NS bar
-//n:e: e in NS bar, e in NS bar

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml.txt
deleted file mode 100644
index 718bba1..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xml.txt
+++ /dev/null
@@ -1,65 +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.
- */
-  <?firstPi customKey="something"?>
-  firstPi
-  customKey="something"
-  <?secondPi secondPiData?>
-  secondPi
-  secondPiData
-2
-p
- customKey="something"
-
-<ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text1</ns1:e11><ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text2</ns1:e11>
-<ns1:e12 xmlns:ns1="http://www.foo.com/ns1/"><![CDATA[cdata-section1]]></ns1:e12><ns1:e12 xmlns:ns1="http://www.foo.com/ns1/"><![CDATA[cdata-section2<&]]></ns1:e12>
-<ns1:e1 xmlns:ns1="http://www.foo.com/ns1/" a1="v1" a2="v2">
-    <ns1:e11>text1</ns1:e11>
-    <ns1:e12><![CDATA[cdata-section1]]></ns1:e12>
-  </ns1:e1>
-<ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text1</ns1:e11><ns1:e11 xmlns:ns1="http://www.foo.com/ns1/">text2</ns1:e11>
-a1
-v2
-rootroot
-root
-  root
-  e1
-  e11
-  e12
-  e2
-  e11
-  e12
-  root
-  root
-  e1
-  root
-  e1
-  e11
-  root
-  e1
-  e12
-  root
-  e2
-  root
-  e2
-  e11
-  root
-  e2
-  e12
-cdata-section2&lt;&amp;
-cdata-section2<&

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns1.txt
deleted file mode 100644
index 69af553..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns1.txt
+++ /dev/null
@@ -1,63 +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.
- */
-
-<book xmlns="http://example.com/eBook">
-  <title>Test Book</title>
-  <chapter>
-    <title>Ch1</title>
-    <para>p1.1</para>
-    <para>p1.2</para>
-    <para>p1.3</para>
-  </chapter>
-  <chapter>
-    <title>Ch2</title>
-    <para>p2.1</para>
-    <para>p2.2</para>
-  </chapter>
-</book>
-
-  <html>
-    <head>
-      <title>Test Book</title>
-    </head>
-    <body>
-      <h1>Test Book</h1>
-
-  
-    <h2>Ch1</h2>
-
-    
-      <p>p1.1
-
-      <p>p1.2
-
-      <p>p1.3
-
-  
-    <h2>Ch2</h2>
-
-    
-      <p>p2.1
-
-      <p>p2.2
-
-  
-    </body>
-  </html>
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns3.txt
deleted file mode 100644
index f028f0a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns3.txt
+++ /dev/null
@@ -1,47 +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.
- */
-  <html>
-    <head>
-      <title>Test Book</title>
-    </head>
-    <body>
-      <h1>Test Book</h1>
-
-  
-    <h2>Ch1</h2>
-
-    
-      <p>p1.1
-
-      <p>p1.2
-
-      <p>p1.3
-
-  
-    <h2>Ch2</h2>
-
-    
-      <p>p2.1
-
-      <p>p2.2
-
-  
-    </body>
-  </html>
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns4.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns4.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns4.txt
deleted file mode 100644
index f028f0a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns4.txt
+++ /dev/null
@@ -1,47 +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.
- */
-  <html>
-    <head>
-      <title>Test Book</title>
-    </head>
-    <body>
-      <h1>Test Book</h1>
-
-  
-    <h2>Ch1</h2>
-
-    
-      <p>p1.1
-
-      <p>p1.2
-
-      <p>p1.3
-
-  
-    <h2>Ch2</h2>
-
-    
-      <p>p2.1
-
-      <p>p2.2
-
-  
-    </body>
-  </html>
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns5.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns5.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns5.txt
deleted file mode 100644
index 6e42b09..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/xmlns5.txt
+++ /dev/null
@@ -1,26 +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.
- */
-No NS = No NS
-x NS = x NS
-y NS = y NS
-x NS = x NS
-No NS = No NS
-- = -
-- = -
-- = -

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/BeansTestResources.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/BeansTestResources.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/BeansTestResources.properties
deleted file mode 100644
index 609e20b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/BeansTestResources.properties
+++ /dev/null
@@ -1,19 +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.
-
-message=Message
-format={0,date,yyyy-MM-dd}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/defaultxmlns1.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/defaultxmlns1.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/defaultxmlns1.xml
deleted file mode 100644
index ed289bb..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/defaultxmlns1.xml
+++ /dev/null
@@ -1,24 +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.
--->
-<root xmlns:x="http://x.com" xmlns:y="http://y.com">
-  <t1>No NS</t1>
-  <x:t2>x NS</x:t2>
-  <y:t3>y NS</y:t3>
-  <t4 xmlns="http://x.com">x NS</t4>
-</root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml-ns_prefix-scope.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml-ns_prefix-scope.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml-ns_prefix-scope.xml
deleted file mode 100644
index 934acac..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml-ns_prefix-scope.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<root xmlns="http://freemarker.org/test/namespace-test"
-    xmlns:foo="http://freemarker.org/test/foo"
-    xmlns:bar="http://freemarker.org/test/bar">
-  <e>e in NS namespace-test</e>
-  <foo:e>e in NS foo</foo:e>
-  <bar:e>e in NS bar</bar:e>
-</root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml.xml
deleted file mode 100644
index abf7e96..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xml.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.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.
--->
-<?firstPi customKey="something"?>
-<?secondPi secondPiData?>
-<ns1:root xmlns:ns1="http://www.foo.com/ns1/">
-  <ns1:e1 a1="v1" a2="v2">
-    <ns1:e11>text1</ns1:e11>
-    <ns1:e12><![CDATA[cdata-section1]]></ns1:e12>
-  </ns1:e1>
-  <ns1:e2>
-    <ns1:e11>text2</ns1:e11>
-    <ns1:e12><![CDATA[cdata-section2<&]]></ns1:e12>
-  </ns1:e2>
-</ns1:root>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlfragment.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlfragment.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlfragment.xml
deleted file mode 100644
index b5578b6..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlfragment.xml
+++ /dev/null
@@ -1,19 +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.
--->
-<root><a><b><c xmlns="http://x">C&lt;&gt;&amp;"']]&gt;</c></b></a></root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns.xml
deleted file mode 100644
index 6f6453e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns.xml
+++ /dev/null
@@ -1,32 +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.
--->
-<book xmlns="http://example.com/eBook">
-  <title>Test Book</title>
-  <chapter>
-    <title>Ch1</title>
-    <para>p1.1</para>
-    <para>p1.2</para>
-    <para>p1.3</para>
-  </chapter>
-  <chapter>
-    <title>Ch2</title>
-    <para>p2.1</para>
-    <para>p2.2</para>
-  </chapter>
-</book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns2.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns2.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns2.xml
deleted file mode 100644
index c8bfc9f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns2.xml
+++ /dev/null
@@ -1,32 +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.
--->
-<eb:book xmlns:eb="http://example.com/eBook">
-  <eb:title>Test Book</eb:title>
-  <eb:chapter>
-    <eb:title>Ch1</eb:title>
-    <eb:para>p1.1</eb:para>
-    <eb:para>p1.2</eb:para>
-    <eb:para>p1.3</eb:para>
-  </eb:chapter>
-  <eb:chapter>
-    <eb:title>Ch2</eb:title>
-    <eb:para>p2.1</eb:para>
-    <eb:para>p2.2</eb:para>
-  </eb:chapter>
-</eb:book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns3.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns3.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns3.xml
deleted file mode 100644
index 8502ead..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/models/xmlns3.xml
+++ /dev/null
@@ -1,32 +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.
--->
-<book xmlns:x="http://x" xmlns:y="http://y">
-  <x:title>Test Book</x:title>
-  <chapter>
-    <y:title>Ch1</y:title>
-    <para>p1.1</para>
-    <para>p1.2</para>
-    <para>p1.3</para>
-  </chapter>
-  <x:chapter>
-    <y:title>Ch2</y:title>
-    <x:para>p2.1</x:para>
-    <y:para>p2.2</y:para>
-  </x:chapter>
-</book>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/api-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/api-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/api-builtins.ftl
deleted file mode 100644
index 5a9e2d7..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/api-builtins.ftl
+++ /dev/null
@@ -1,40 +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.
--->
-<@assertEquals expected="b" actual=map?api.get(2?int) />
-<@assertEquals expected=2 actual=list?api.indexOf(3?int) />
-<@assert test=set?api.contains("b") />
-<@assert test=!set?api.contains("d") />
-
-<#assign dump = "">
-<#list map?api.entrySet() as entry>
-    <#assign dump = dump + entry.key + ": " + entry.value>
-    <#if entry_has_next>
-        <#assign dump = dump + ", ">
-    </#if>
-</#list>
-<@assertEquals expected="1: a, 2: b, 3: c" actual=dump />
-
-<@assert test=map?has_api />
-<@assert test=list?has_api />
-<@assert test=set?has_api />
-<@assert test=!s?has_api />
-<@assert test=!1?has_api />
-<@assert test=!""?has_api />
-<@assert test=!{}?has_api />
-<@assert test=!true?has_api />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/arithmetic.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/arithmetic.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/arithmetic.ftl
deleted file mode 100644
index afd4c28..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/arithmetic.ftl
+++ /dev/null
@@ -1,50 +0,0 @@
-[#ftl]
-[#--
-  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.
---]
-<html>
-<head>
-<title>FreeMarker: Arithmetic Test</title>
-</head>
-<body>
-[#assign foo = 1234, bar = 23.77] 
-
-<p>A simple test follows:</p>
-
-<p>Perform a number assignment:</p>
-
-[#setting locale="en_US"][#assign x = 1.2345, y=2]
-
-#{ x+y ; m2M3}
-#{ y ; m2M3}
-#{ x/y ; m40M40}
-#{y/x}
-#{ y/x ; M4}
-
-<P>Display a number with at least 3 digits after the decimal point</P>
-
-#{foo ; m3}
-
-<p>Now use numbers in assignment</p>
-
-[#assign mynumber = foo + bar   [#-- a comment --] ]
-
-#{mynumber}
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/assignments.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/assignments.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/assignments.ftl
deleted file mode 100644
index f9f546d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/assignments.ftl
+++ /dev/null
@@ -1,108 +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.
--->
-<#assign x = 1>
-<@assertEquals expected=1 actual=x />
-<#assign x = x + 1>
-<@assertEquals expected=2 actual=x />
-<#assign x += 1>
-<@assertEquals expected=3 actual=x />
-<#assign x /= 2>
-<@assertEquals expected=1.5 actual=x />
-<#assign x *= 2>
-<@assertEquals expected=3 actual=x />
-<#assign x %= 2>
-<@assertEquals expected=1 actual=x />
-<#assign x += x  x += x  x += x>
-<@assertEquals expected=8 actual=x />
-<#assign x += x, x += x, x += x>
-<@assertEquals expected=64 actual=x />
-<#assign x++>
-<@assertEquals expected=65 actual=x />
-<#assign x-->
-<@assertEquals expected=64 actual=x />
-<#assign x--, x--, x--, x++, x -= 60>
-<@assertEquals expected=2 actual=x />
-
-<#assign x = 'a'>
-<#assign x += 1>
-<@assertEquals expected='a1' actual=x />
-
-<#assign x = 1>
-<#assign x += 'a'>
-<@assertEquals expected='1a' actual=x />
-
-<#assign x = [11]>
-<#assign x += [22]>
-<@assertEquals expected=11 actual=x[0] />
-<@assertEquals expected=22 actual=x[1] />
-<@assertEquals expected=2 actual=x?size />
-
-<#assign x = { 'a': 11 }>
-<#assign x += { 'b': 22 }>
-<@assertEquals expected=11 actual=x.a />
-<@assertEquals expected=22 actual=x.b />
-<@assertEquals expected=2 actual=x?size />
-
-<#assign x = 1>
-<#global g = 11>
-<#global g -= x>
-<@assertEquals expected=10 actual=g />
-<#global g *= 2>
-<@assertEquals expected=20 actual=g />
-<#global g /= 2.5>
-<@assertEquals expected=8 actual=g />
-<#global g += 2>
-<@assertEquals expected=10 actual=g />
-<#global g++>
-<@assertEquals expected=11 actual=g />
-<#global g-->
-<@assertEquals expected=10 actual=g />
-
-<#macro m>
-    <#local v = x + g>
-    <@assertEquals expected=11 actual=v />
-    <#local v -= x>
-    <@assertEquals expected=10 actual=v />
-    <#local v *= 2>
-    <@assertEquals expected=20 actual=v />
-    <#local v /= 2.5>
-    <@assertEquals expected=8 actual=v />
-    <#local v += 2>
-    <@assertEquals expected=10 actual=v />
-    <#local v++>
-    <@assertEquals expected=11 actual=v />
-    <#local v-->
-    <@assertEquals expected=10 actual=v />
-</#macro>
-<@m />
-
-<#assign foo = 'a'>
-<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo -= 1></@>
-<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo++></@>
-<@assertFails messageRegexp=r".*expected.*number.*assignment.*foo.*string.*"><#assign foo--></@>
-<#assign x = 1>
-<@assertFails messageRegexp=r"(?s).*expected.*number.*string.*'a'.*"><#assign x -= 'a'></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*-=.*"><#assign noSuchVar -= 1></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\+=.*"><#assign noSuchVar += 1></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\*=.*"><#assign noSuchVar *= 1></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*/=.*"><#assign noSuchVar /= 1></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*%=.*"><#assign noSuchVar %= 1></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*\+\+.*"><#assign noSuchVar++></@>
-<@assertFails messageRegexp=r"(?s).*assignment.*noSuchVar.*missing.*--.*"><#assign noSuchVar--></@>
-<@assertFails messageRegexp=r'(?s).*assignment.*noSuchVar.*missing.*\+=.*"\$".*'><#assign $noSuchVar += 1></@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean-formatting.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean-formatting.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean-formatting.ftl
deleted file mode 100644
index a521fe8..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean-formatting.ftl
+++ /dev/null
@@ -1,82 +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.
--->
-<#assign suppress>
-<@assertFails message="true,false">${true}</@>
-<@assertFails message="true,false">${false}</@>
-<@assertFails message="true,false">${"" + true}</@>
-<@assertFails message="true,false">${"" + false}</@>
-<@assertFails message="true,false">${true?upper_case}</@>
-<@assertFails message="true,false">${false?upper_case}</@>
-<@assertEquals expected="true" actual=true?string />
-<@assertEquals expected="false" actual=false?string />
-<@assertEquals expected="true" actual=true?c />
-<@assertEquals expected="false" actual=false?c />
-<@assertEquals expected="t" actual=true?string('t', 'f') />
-<@assertEquals expected="f" actual=false?string('t', 'f') />
-<#setting boolean_format = 'true,false'>
-<@assertFails message="true,false">${true}</@>
-
-<#setting boolean_format = 'ja,nein'>
-<@assertEquals expected="ja" actual="" + true />
-<@assertEquals expected="nein" actual="" + false />
-<@assertEquals expected="JA" actual=true?upper_case />
-<@assertEquals expected="NEIN" actual=false?upper_case />
-<@assertEquals expected="ja" actual=true?string />
-<@assertEquals expected="nein" actual=false?string />
-<@assertEquals expected="true" actual=true?c />
-<@assertEquals expected="false" actual=false?c />
-<@assertEquals expected="t" actual=true?string('t', 'f') />
-<@assertEquals expected="f" actual=false?string('t', 'f') />
-
-<#setting boolean_format = 'y,n'>
-<#assign x = false>
-<#assign n = 123><#assign m = { x: 'foo', n: 'bar' }><@assertEquals actual=m['n'] + m['123'] expected='foobar' />
-<@assertFails exception="UnexpectedTypeException">${m[false]}</@>
-<@assertFails message="can't compare">${x == 'false'}</@>
-<@assertFails message="can't compare">${x != 'false'}</@>
-<@assertFails message="can't convert">${booleanVsStringMethods.expectsString(x)}</@>
-<@assertEquals actual=booleanVsStringMethods.expectsString(booleanAndString) expected="theStringValue" />
-<@assertEquals actual=booleanVsStringMethods.expectsBoolean(x) expected=false />
-<@assertEquals actual=booleanVsStringMethods.expectsBoolean(booleanAndString) expected=true />
-<@assertEquals actual=booleanVsStringMethods.overloaded(x) expected="boolean false" />
-<@assertEquals actual=123?upper_case expected="123" />
-<@assertEquals actual=true?upper_case expected="Y" />
-
-</#assign>
-<#escape x as x?upper_case>
-<#assign x = true>${x} ${true} ${true?string}
-<#assign x = false>${x} ${false} ${false?string}
-<#noescape><#assign x = true>${x} ${true} ${true?string}</#noescape>
-</#escape>
-<#assign x = false>${x} ${false} ${false?string}
-<#assign x = true>${x} ${true} ${true?string}
-<#assign x = false>${x} ${false} ${false?string}
-${'str:' + x} ${'str:' + false}
-${x?string('ja', 'nein')} ${true?string('ja', 'nein')}
-${booleanAndString} ${booleanAndString?string}
-
-<#setting boolean_format = 'y,n'>
-<@assertEquals actual='true'?boolean expected=true />
-<@assertEquals actual='false'?boolean expected=false />
-<@assertEquals actual='y'?boolean expected=true />
-<@assertEquals actual='n'?boolean expected=false />
-<@assertFails message="can't convert">${'N'?boolean}</@>
-<@assertFails message="can't convert">${'True'?boolean}</@>
-<@assertFails message="can't convert">${0?boolean}</@>
-<@assertFails message="sequence">${[]?boolean}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean.ftl
deleted file mode 100644
index ab11c64..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/boolean.ftl
+++ /dev/null
@@ -1,142 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Boolean Values Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<#assign b=true>
-
-<p>Now perform scalar boolean tests:</p>
-
-<p><#if b>
-    b is true.<br />
-<#else>
-    b is false.<br />
-</#if></p>
-
-<p><#if false>
-    This can't be!<br />
-<#else>
-    This makes sense.<br />
-</#if></p>
-
-<p><#if boolean3>
-    boolean3 succeeded.<br />
-<#else>
-    boolean3 failed.<br />
-</#if></p>
-
-<p><#if boolean4>
-    boolean4 succeeded.<br />
-<#else>
-    boolean4 failed.<br />
-</#if></p>
-
-<p><#if boolean4 || boolean5>
-    boolean4 || boolean5 succeeded.<br />
-<#else>
-    boolean4 || boolean5 failed.<br />
-</#if></p>
-
-<p><#if boolean5 || boolean4 || boolean5>
-    boolean5 || boolean4 || boolean5 succeeded.<br />
-<#else>
-    boolean5 || boolean4 || boolean5 failed.<br />
-</#if></p>
-
-<p><#if boolean4 && boolean5>
-    boolean4 && boolean5 succeeded.<br />
-<#else>
-    boolean4 && boolean5 failed.<br />
-</#if></p>
- 
-<p>Now test list models:</p>
-
-<p><#if list1?exists>
-    list1 succeeded.<br />
-<#else>
-    list1 failed.<br />
-</#if></p>
-
-<p><#if list2?exists>
-    list2 succeeded.<br />
-<#else>
-    list2 failed.<br />
-</#if></p>
-
-<p>Test hash models:</p>
-
-<p><#if hash1?exists>
-    hash1 succeeded: ${hash1.temp}<br />
-<#else>
-    hash1 failed: ${hash1.temp}<br />
-</#if></p>
-
-<p><#if hash2?exists>
-    hash2 succeeded.<br />
-<#else>
-    hash2 failed.<br />
-</#if></p>
-
-<p>Test not operator:</p>
-
-<p><#if ! boolean1>
-   Not boolean1 succeeded
-<#else>
-   Not boolean1 failed
-</#if></p>
-
-<p><#if !boolean1>
-   Not boolean1 succeeded
-<#else>
-   Not boolean1 failed
-</#if></p>
-
-<p><#if ! boolean2>
-   Not boolean2 succeeded
-<#else>
-   Not boolean2 failed
-</#if></p>
-
-<p><#if !boolean2>
-   Not boolean2 succeeded
-<#else>
-   Not boolean2 failed
-</#if></p>
-
-<p><#if message == "Hello, world!">
-   Message is "Hello, world!"
-<#else>
-   Message is something else (${message})
-</#if></p>
-
-<p><#if message != "Hello, world!">
-   Message is not "Hello, world!" -- it's ${message}
-<#else>
-   Message is "Hello, world!"
-</#if></p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header.ftl
deleted file mode 100644
index 638f4b9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header.ftl
+++ /dev/null
@@ -1,27 +0,0 @@
-<#ftl encoding="ISO-8859-2">
-<#--
-  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.
--->
-<head>
-  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
-</head>
-<body>
-����
-<#include "charset-in-header_inc1.ftl">
-<#include "charset-in-header_inc2.ftl">
-</body>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc1.ftl
deleted file mode 100644
index b8dc608..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc1.ftl
+++ /dev/null
@@ -1,20 +0,0 @@
-<#ftl encoding="ISO-8859-1">
-<#--
-  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.
--->
-����

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc2.ftl
deleted file mode 100644
index 66100ec..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/charset-in-header_inc2.ftl
+++ /dev/null
@@ -1,19 +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.
--->
-őŐűŰ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
deleted file mode 100644
index 9c47168..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
+++ /dev/null
@@ -1,50 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Comment Test</title>
-</head>
-<body>
-<#--
-
-A simple test follows:
-
-${message}
-
-A more rigorous test, showing that we're not faking it:
-
-${message@#$%&}
-
---><#-- > --><#-- -> --><#-- -- --><#-- -- > -->
-<#if message?exists>
-	<p>Message exists!
-	<#--
-		...and even generates output!
-	-->
-	</p>
-</#if>
-
-a <#-- < --> b
-a <#-- </#noparse> - -- --> b
-
-${1 + 2 + [#-- c --] <#-- c --> <!-- c --> 3}
-${<!-- > -> -- #> #] --> 7}
-${<#-- glitch... --] 8}
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comparisons.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comparisons.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comparisons.ftl
deleted file mode 100644
index a711d4d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comparisons.ftl
+++ /dev/null
@@ -1,218 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Numeric Operations Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Start with the increment operator:</p>
-<#assign a1 = 0>
-<p>a1 = ${a1}</p>
-<#assign a1 = a1 + 1>
-<p>a1 = ${a1}</p>
-<#assign a1 = a1 + 1>
-<p>a1 = ${a1}</p>
-
-<p>Now the decrement operator:</p>
-<#assign a2 = 5>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-<p>a2 = ${a2}</p>
-<#assign a2 = a2 - 1>
-
-<p>Now the add operator:</p>
-<#assign op1 = 5>
-<#assign op2 = 3>
-<#assign op3 = op1 + op2>
-<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p>
-<#assign op3 = op3 + op2>
-<p>op3 = ${op3}</p>
-
-<p>And the subtract operator:</p>
-<#assign op3 = op1 - op2 >
-<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p>
-<#assign op3 = op3 - op2 >
-<p>op3 = ${op3}</p>
-
-<p>The comparison operators:</p>
-<#assign list1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]>
-<#list list1 as item>
-   <p>Item is: ${item}</p>
-   <#if item lt 5>
-   <p>Item is less than five.</p>
-   </#if>
-   <#if item <= 7>
-   <p>Item is less than or equals to seven.</p>
-   </#if>
-   <#if item gt 2>
-   <p>Item is greater than two.</p>
-   </#if>
-   <#if (item >= 10)>
-   <p>Item is greater than or equal to ten.</p>
-   </#if>
-</#list>
-
-<#-- Signum-based optimization test, all 9 permutations: -->
-<#-- 1 -->
-<@assert test= !(0 != 0) />
-<@assert test= (0 == 0) />
-<@assert test= !(0 > 0) />
-<@assert test= (0 >= 0) />
-<@assert test= !(0 < 0) />
-<@assert test= (0 <= 0) />
-<#-- 2 -->
-<@assert test= !(3 != 3) />
-<@assert test= (3 == 3) />
-<@assert test= !(3 > 3) />
-<@assert test= (3 >= 3) />
-<@assert test= !(3 < 3) />
-<@assert test= (3 <= 3) />
-<#-- 3 -->
-<@assert test= !(-3 != -3) />
-<@assert test= (-3 == -3) />
-<@assert test= !(-3 > -3) />
-<@assert test= (-3 >= -3) />
-<@assert test= !(-3 < -3) />
-<@assert test= (-3 <= -3) />
-<#-- 4 -->
-<@assert test= (3 != 0) />
-<@assert test= !(3 == 0) />
-<@assert test= (3 > 0) />
-<@assert test= (3 >= 0) />
-<@assert test= !(3 < 0) />
-<@assert test= !(3 <= 0) />
-<#-- 5 -->
-<@assert test= (0 != 3) />
-<@assert test= !(0 == 3) />
-<@assert test= !(0 > 3) />
-<@assert test= !(0 >= 3) />
-<@assert test= (0 < 3) />
-<@assert test= (0 <= 3) />
-<#-- 6 -->
-<@assert test= (-3 != 0) />
-<@assert test= !(-3 == 0) />
-<@assert test= !(-3 > 0) />
-<@assert test= !(-3 >= 0) />
-<@assert test= (-3 < 0) />
-<@assert test= (-3 <= 0) />
-<#-- 7 -->
-<@assert test= (0 != -3) />
-<@assert test= !(0 == -3) />
-<@assert test= (0 > -3) />
-<@assert test= (0 >= -3) />
-<@assert test= !(0 < -3) />
-<@assert test= !(0 <= -3) />
-<#-- 8 -->
-<@assert test= (-3 != 3) />
-<@assert test= !(-3 == 3) />
-<@assert test= !(-3 > 3) />
-<@assert test= !(-3 >= 3) />
-<@assert test= (-3 < 3) />
-<@assert test= (-3 <= 3) />
-<#-- 9 -->
-<@assert test= (3 != -3) />
-<@assert test= !(3 == -3) />
-<@assert test= (3 > -3) />
-<@assert test= (3 >= -3) />
-<@assert test= !(3 < -3) />
-<@assert test= !(3 <= -3) />
-<#-- Again, now on runtime: -->
-<#assign m3 = -3>
-<#assign p3 = 3>
-<#assign z = 0>
-<#-- 1 -->
-<@assert test= !(z != z) />
-<@assert test= (z == z) />
-<@assert test= !(z > z) />
-<@assert test= (z >= z) />
-<@assert test= !(z < z) />
-<@assert test= (z <= z) />
-<#-- 2 -->
-<@assert test= !(p3 != p3) />
-<@assert test= (p3 == p3) />
-<@assert test= !(p3 > p3) />
-<@assert test= (p3 >= p3) />
-<@assert test= !(p3 < p3) />
-<@assert test= (p3 <= p3) />
-<#-- 3 -->
-<@assert test= !(m3 != m3) />
-<@assert test= (m3 == m3) />
-<@assert test= !(m3 > m3) />
-<@assert test= (m3 >= m3) />
-<@assert test= !(m3 < m3) />
-<@assert test= (m3 <= m3) />
-<#-- 4 -->
-<@assert test= (p3 != z) />
-<@assert test= !(p3 == z) />
-<@assert test= (p3 > z) />
-<@assert test= (p3 >= z) />
-<@assert test= !(p3 < z) />
-<@assert test= !(p3 <= z) />
-<#-- 5 -->
-<@assert test= (z != p3) />
-<@assert test= !(z == p3) />
-<@assert test= !(z > p3) />
-<@assert test= !(z >= p3) />
-<@assert test= (z < p3) />
-<@assert test= (z <= p3) />
-<#-- 6 -->
-<@assert test= (m3 != z) />
-<@assert test= !(m3 == z) />
-<@assert test= !(m3 > z) />
-<@assert test= !(m3 >= z) />
-<@assert test= (m3 < z) />
-<@assert test= (m3 <= z) />
-<#-- 7 -->
-<@assert test= (z != m3) />
-<@assert test= !(z == m3) />
-<@assert test= (z > m3) />
-<@assert test= (z >= m3) />
-<@assert test= !(z < m3) />
-<@assert test= !(z <= m3) />
-<#-- 8 -->
-<@assert test= (m3 != p3) />
-<@assert test= !(m3 == p3) />
-<@assert test= !(m3 > p3) />
-<@assert test= !(m3 >= p3) />
-<@assert test= (m3 < p3) />
-<@assert test= (m3 <= p3) />
-<#-- 9 -->
-<@assert test= (p3 != m3) />
-<@assert test= !(p3 == m3) />
-<@assert test= (p3 > m3) />
-<@assert test= (p3 >= m3) />
-<@assert test= !(p3 < m3) />
-<@assert test= !(p3 <= m3) />
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/compress.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/compress.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/compress.ftl
deleted file mode 100644
index faf4ad6..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/compress.ftl
+++ /dev/null
@@ -1,59 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Compress Test</title>
-</head>
-<body>
-
-<#assign utility={'standardCompress': "org.apache.freemarker.core.util.StandardCompress"?new()}>
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<#compress>
-
-  <p>This is the same message,  using the &quot;compress&quot; tag:</p>
-
-
-<p>${message}</p>
-</#compress>
-
-<@utility.standardCompress buffer_size=8>
-
-  <p>This is the same message,  using the &quot;StandardCompress&quot; transform model:</p>
-
-
-<p>${message}</p>
-</@>
-
-<@utility.standardCompress single_line=true>
-
-<p>This 
-   multi-line message 
-     should 
-be compressed 
-   to a single line.</p></@>
-
-<p>An example where the first character is not whitespace but the second character is:</p>
-<p><#compress>x y</#compress></p>
-
-<p>The end.</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/date-type-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/date-type-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/date-type-builtins.ftl
deleted file mode 100644
index f05654b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/date-type-builtins.ftl
+++ /dev/null
@@ -1,47 +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.
--->
-<#setting time_zone = "UTC">
-
-<@assert test=unknown?is_unknown_date_like />
-<@assert test=!timeOnly?is_unknown_date_like />
-<@assert test=!dateOnly?is_unknown_date_like />
-<@assert test=!dateTime?is_unknown_date_like />
-
-<@assert test=!unknown?is_date_only />
-<@assert test=!timeOnly?is_date_only />
-<@assert test=dateOnly?is_date_only />
-<@assert test=!dateTime?is_date_only />
-
-<@assert test=!unknown?is_time />
-<@assert test=timeOnly?is_time />
-<@assert test=!dateOnly?is_time />
-<@assert test=!dateTime?is_time />
-
-<@assert test=!unknown?is_datetime />
-<@assert test=!timeOnly?is_datetime />
-<@assert test=!dateOnly?is_datetime />
-<@assert test=dateTime?is_datetime />
-
-<@assertFails message="isn't known if">${unknown?string.xs}</@>
-<@assertEquals expected="2003-04-05T06:07:08Z" actual=unknown?datetime_if_unknown?string.xs />
-<@assertEquals expected="2003-04-05Z" actual=unknown?date_if_unknown?string.xs />
-<@assertEquals expected="06:07:08Z" actual=unknown?time_if_unknown?string.xs />
-<@assertEquals expected="2003-04-05T06:07:08Z" actual=dateTime?date_if_unknown?string.xs />
-<@assertEquals expected="2003-04-05" actual=dateOnly?time_if_unknown?string.xs />
-<@assertEquals expected="06:07:08" actual=timeOnly?date_if_unknown?string.xs />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
deleted file mode 100644
index 85fb028..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
+++ /dev/null
@@ -1,163 +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.
--->
-<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
-<#setting time_zone="GMT+02">
-<@assertEquals actual=d?iso_utc expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso_utc_ms expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?iso_utc_m expected="2010-05-15T20:38Z" />
-<@assertEquals actual=d?iso_utc_h expected="2010-05-15T20Z" />
-<@assertEquals actual=d?iso_utc_nz expected="2010-05-15T20:38:05" />
-<@assertEquals actual=d?iso_utc_ms_nz expected="2010-05-15T20:38:05.023" />
-<@assertEquals actual=d?iso_utc_m_nz expected="2010-05-15T20:38" />
-<@assertEquals actual=d?iso_utc_h_nz expected="2010-05-15T20" />
-<@assertEquals actual=d?iso_local expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso_local_ms expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?iso_local_m expected="2010-05-15T22:38+02:00" />
-<@assertEquals actual=d?iso_local_h expected="2010-05-15T22+02:00" />
-<@assertEquals actual=d?iso_local_nz expected="2010-05-15T22:38:05" />
-<@assertEquals actual=d?iso_local_ms_nz expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?iso_local_m_nz expected="2010-05-15T22:38" />
-<@assertEquals actual=d?iso_local_h_nz expected="2010-05-15T22" />
-
-<@assertEquals actual=d?date?iso_utc expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_ms expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_m expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_h expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_ms_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_m_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_h_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_ms expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_m expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_h expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_ms_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_m_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_h_nz expected="2010-05-15" />
-
-<@assertEquals actual=d?time?iso_utc expected="20:38:05Z" />
-<@assertEquals actual=d?time?iso_utc_ms expected="20:38:05.023Z" />
-<@assertEquals actual=d?time?iso_utc_m expected="20:38Z" />
-<@assertEquals actual=d?time?iso_utc_h expected="20Z" />
-<@assertEquals actual=d?time?iso_utc_nz expected="20:38:05" />
-<@assertEquals actual=d?time?iso_utc_ms_nz expected="20:38:05.023" />
-<@assertEquals actual=d?time?iso_utc_m_nz expected="20:38" />
-<@assertEquals actual=d?time?iso_utc_h_nz expected="20" />
-<@assertEquals actual=d?time?iso_local expected="22:38:05+02:00" />
-<@assertEquals actual=d?time?iso_local_ms expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?iso_local_m expected="22:38+02:00" />
-<@assertEquals actual=d?time?iso_local_h expected="22+02:00" />
-<@assertEquals actual=d?time?iso_local_nz expected="22:38:05" />
-<@assertEquals actual=d?time?iso_local_ms_nz expected="22:38:05.023" />
-<@assertEquals actual=d?time?iso_local_m_nz expected="22:38" />
-<@assertEquals actual=d?time?iso_local_h_nz expected="22" />
-
-<#assign dStrange = "600-01-01 23:59:59:123 +0000"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
-<@assertEquals actual=dStrange?iso_utc_ms expected="0600-01-03T23:59:59.123Z" />
-
-<#-- java.sql treatment -->
-<@assertEquals actual=sqlDate?iso_local expected="2010-05-15" />
-<@assertEquals actual=sqlDate?iso_local_nz expected="2010-05-15" />
-<@assertEquals actual=sqlTime?iso_local_nz expected="22:38:05" />
-<@assertEquals actual=sqlTime?iso_utc_nz expected="20:38:05" />
-
-<#setting time_zone="GMT+03"> <#-- should not mater -->
-<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso_ms("UTC") expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?iso_m("UTC") expected="2010-05-15T20:38Z" />
-<@assertEquals actual=d?iso_h("UTC") expected="2010-05-15T20Z" />
-<@assertEquals actual=d?iso_nz("UTC") expected="2010-05-15T20:38:05" />
-<@assertEquals actual=d?iso_ms_nz("UTC") expected="2010-05-15T20:38:05.023" />
-<@assertEquals actual=d?iso_m_nz("UTC") expected="2010-05-15T20:38" />
-<@assertEquals actual=d?iso_h_nz("UTC") expected="2010-05-15T20" />
-<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso_ms("GMT+02") expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?iso_m("GMT+02") expected="2010-05-15T22:38+02:00" />
-<@assertEquals actual=d?iso_h("GMT+02") expected="2010-05-15T22+02:00" />
-<@assertEquals actual=d?iso_nz("GMT+02") expected="2010-05-15T22:38:05" />
-<@assertEquals actual=d?iso_ms_nz("GMT+02") expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?iso_m_nz("GMT+02") expected="2010-05-15T22:38" />
-<@assertEquals actual=d?iso_h_nz("GMT+02") expected="2010-05-15T22" />
-
-<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h_nz("GMT+02") expected="2010-05-15" />
-
-<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" />
-<@assertEquals actual=d?time?iso_ms("UTC") expected="20:38:05.023Z" />
-<@assertEquals actual=d?time?iso_m("UTC") expected="20:38Z" />
-<@assertEquals actual=d?time?iso_h("UTC") expected="20Z" />
-<@assertEquals actual=d?time?iso_nz("UTC") expected="20:38:05" />
-<@assertEquals actual=d?time?iso_ms_nz("UTC") expected="20:38:05.023" />
-<@assertEquals actual=d?time?iso_m_nz("UTC") expected="20:38" />
-<@assertEquals actual=d?time?iso_h_nz("UTC") expected="20" />
-<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" />
-<@assertEquals actual=d?time?iso_ms("GMT+02") expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?iso_m("GMT+02") expected="22:38+02:00" />
-<@assertEquals actual=d?time?iso_h("GMT+02") expected="22+02:00" />
-<@assertEquals actual=d?time?iso_nz("GMT+02") expected="22:38:05" />
-<@assertEquals actual=d?time?iso_ms_nz("GMT+02") expected="22:38:05.023" />
-<@assertEquals actual=d?time?iso_m_nz("GMT+02") expected="22:38" />
-<@assertEquals actual=d?time?iso_h_nz("GMT+02") expected="22" />
-
-<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso(adaptedToStringScalar) expected="2010-05-15T22:38:05+02:00" />
-
-<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.001Z" />
-<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.01Z" />
-<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.1Z" />
-<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00Z" />
-
-<#setting time_zone="GMT+02">
-<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
-<@assertEquals actual=d?iso_local expected="2010-05-15" />
-<@assertEquals actual=d?iso_utc expected="2010-05-14" />
-
-<#setting time_zone="GMT+02:30">
-<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
-<@assertEquals actual=d?iso_local expected="2010-05-15T00:00:00+02:30" />
-
-<#setting time_zone="America/New_York">
-<@assertEquals actual="2010-05-09 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-05-09T16:00:00-04:00" />
-<@assertEquals actual="2010-01-01 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-01-01T15:00:00-05:00" />
-
-<@assertFails>${d?iso("no such zone")}</@>
-
-<#setting time_zone="GMT+02">
-<@assertEquals actual=sqlTime?iso_local expected="22:38:05" />
-<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" />


[07/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listliteral.txt
deleted file mode 100644
index 2048ac5..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listliteral.txt
+++ /dev/null
@@ -1,75 +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.
- */
-<html>
-<head>
-<title>FreeMarker: List Literal Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now perform a list assignment:</p>
-
-
-The list contains 5 items.
-
-<p>test1</p>
-<p>test23</p>
-<p>test45</p>
-<p>Hello, world!</p>
-<p>hello</p>
-
-<p>Now update the assignment and repeat:</p>
-
-
-<p>test1</p>
-<p>test23</p>
-<p>test45</p>
-<p>Hello, world!</p>
-<p>hello</p>
-
-<p>Now reassign the list and repeat:</p>
-
-
-<p>bar</p>
-<p>Temporary</p>
-<p>test1</p>
-<p>test23</p>
-
-<p>Silly, but necessary tests, for one and zero element lists:</p>
-
-
-<p>Hello, world</p>
-
-<p>Zero item test:</p>
-
-
-
-<p>Dumb test for number literals -- these weren't working as expected:</p>
-
-
-<p>1</p>
-<p>2</p>
-<p>3</p>
-<p>5</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/localization.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/localization.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/localization.txt
deleted file mode 100644
index bd3c87d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/localization.txt
+++ /dev/null
@@ -1,32 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Localization Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>G'day, mate!</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/logging.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/logging.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/logging.txt
deleted file mode 100644
index 4fa6b2a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/logging.txt
+++ /dev/null
@@ -1,27 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Logging Test</title>
-</head>
-<body>
-
-A simple test follows:
-
-ERROR [org.apache.freemarker.core.Template]: message is not a TemplateHashModel, it's a freemarker.template.SimpleScalar.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/loopvariable.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/loopvariable.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/loopvariable.txt
deleted file mode 100644
index 25c20ac..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/loopvariable.txt
+++ /dev/null
@@ -1,54 +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.
- */
----
-  2
-  -     L1 1
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-  -     L1 2
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-  -     L1 3
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-*
-  1
-  -     L1 1
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-  -     L1 2
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-  -     L1 3
-  -       L2 1: 1; 2; 3; 
-  -       L2 2: 1; 2; 3; 
-*
-*
----
-  1 0.5
-  2 1
-  3 1.5
-  4 2 Last!
-123.4
----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros-return.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros-return.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros-return.txt
deleted file mode 100644
index 5aa47ff..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros-return.txt
+++ /dev/null
@@ -1,23 +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.
- */
-m{
-m{
-m{
-b{
-m:b{
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros.txt
deleted file mode 100644
index 680a08e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros.txt
+++ /dev/null
@@ -1,67 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Function Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now perform function tests:</p>
-
-
-<p>Function is defined, now let's call it:</p>
-
-    <a href="/home.html">
-        <img src="/images/home.png" border="0" alt="Home">
-    </a>
-    Kilroy was here.
-
-<p>Again, but with different parameters:</p>
-
-    <a href="/about.html">
-        <img src="/image/about-us.jpeg" border="0" alt="About Us">
-    </a>
-    Kilroy was here.
-
-   Good.
-
-<p>A recursive function call:</p>
-
-
-    0
-    1
-    2
-    3
-
-<p>Test "catch-all" macro parameter:</p>
-
-
-foo=a baz=[]
-foo=a baz=[bar=b]
-foo=a baz=[bar=b, baz=c]
-
-
-Hello World! Today is Monday.
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros2.txt
deleted file mode 100644
index 1b4e007..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/macros2.txt
+++ /dev/null
@@ -1,22 +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.
- */
-1 1
-2 2
-4
-m3 with d="4" Failed!

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/multimodels.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/multimodels.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/multimodels.txt
deleted file mode 100644
index 54ec68d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/multimodels.txt
+++ /dev/null
@@ -1,93 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Test of Multiple Model implementations</title>
-</head>
-<body>
-
-<p>Let's begin with a simple model:</p>
-<p>Hello, world!</p>
-
-<p>Cool, now get into the first model. This implements a scalar, list, and
-hash as a single class. Let's try some tests...</p>
-
-<p>MultiModel1 as a string!</p>
-
-<p>Now as a list...</p>
-
-Model1 value: 0<br />
-Model1 value: 1<br />
-Model1 value: 2<br />
-Model1 value: 3<br />
-Model1 value: 4<br />
-Model1 value: 5<br />
-Model1 value: 6<br />
-Model1 value: 7<br />
-Model1 value: 8<br />
-Model1 value: 9<br />
-Model3 is alive!<br />
-
-<p>Index into a list...</p>
-<p>Model1 value: 1</p>
-<p>List size is: Nasty!</p>
-<p>List size is: Nasty!</p>
-
-<p>Now, again, as a hash. First using dot notation, then using [] notation:</p>
-
-<p>Selftest of a hash from MultiModel1</p>
-<p>Selftest of a hash from MultiModel1</p>
-
-<p>Now for the tricky stuff... use a model to index into another model...</p>
-<p>selftest</p>
-<p>Selftest of a hash from MultiModel1</p>
-<p>self</p>
-<p>Selftest of a hash from MultiModel1</p>
-
-<p>Same thing, this time a List index...</p>
-<p>0</p>
-<p>Model1 value: 0</p>
-<p>Model1 value: 1</p>
-
-<p>Now, do the same recursively...</p>
-<p>MultiModel1 as a string!</p>
-<p>Model2 is alive!</p>
-<p>Arguments are:<br />test<br /></p>
-<p>Arguments are:<br />MultiModel1 as a string!<br />Selftest of a hash from MultiModel1<br />Hello, world!<br /></p>
-
-<p>Does this really not work?</p>
-<p>Model3 is alive!</p>
-<p>Selftest from MultiModel3!</p>
-<p>Hello world from MultiModel3!</p>
-
-<p>(Again, with Hashes)</p>
-<p>Model3 is alive!</p>
-<p>Selftest from MultiModel3!</p>
-
-<p>Model3 is alive!</p>
-<p>Selftest from MultiModel3!</p>
-<p>Selftest from MultiModel3!</p>
-
-<p>As I suspected! (Manual on Expressions needs updating.)</p>
-
-<p>Second test on list size</p>
-<p>Key size, not the listSize method.</p>
-<p>Key size, not the listSize method.</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/nested.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/nested.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/nested.txt
deleted file mode 100644
index bcfb104..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/nested.txt
+++ /dev/null
@@ -1,25 +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.
- */
-    test 3/1: undefined undefined undefined 
-    test 3/2: undefined undefined undefined 
-    test 3/3: undefined undefined undefined 
-
-    test 3/1: Y X Count 1 
-    test 3/2: Y X Count 2 
-    test 3/3: Y X Count 3 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-allowsnothing.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-allowsnothing.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-allowsnothing.txt
deleted file mode 100644
index b8384c7..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-allowsnothing.txt
+++ /dev/null
@@ -1,19 +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.
- */
-fails
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-defaultresolver.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-defaultresolver.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-defaultresolver.txt
deleted file mode 100644
index 35e7a3e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-defaultresolver.txt
+++ /dev/null
@@ -1,19 +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.
- */
-works
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-optin.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-optin.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-optin.txt
deleted file mode 100644
index 9d8e883..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/new-optin.txt
+++ /dev/null
@@ -1,32 +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.
- */
-works
-fails
-
-works
-works
-
-works
-fails
-
-works
-fails
-
-works
-works
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines1.txt
deleted file mode 100644
index bc58731..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines1.txt
+++ /dev/null
@@ -1,29 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Newlines Test</title>
-</head>
-<body>
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines2.txt
deleted file mode 100644
index c131421..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/newlines2.txt
+++ /dev/null
@@ -1,30 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Newlines the Second Test</title>
-</head>
-<body>
-<p>A simple test follows:</p>
-
-<p>Hello, world!
-</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/noparse.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/noparse.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/noparse.txt
deleted file mode 100644
index 5e8486c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/noparse.txt
+++ /dev/null
@@ -1,54 +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.
- */
-<html>
-<head>
-<title>FreeMarker: NoParse Test</title>
-</head>
-<body>
-
-A simple test follows:
-
-${message}
-
-A more rigorous test, showing that we're not faking it:
-
-${message@#$%&}
-
-	<p>Message exists!
-		...and even generates output!
-		<#if message>
-			Nested statements are ok, too.
-		</#if>
-	</p>
-
-Here's another edge case, this time, trying to output a &lt;noparse&gt;
-inside another &lt;noparse&gt;
-
-
-This is what the noparse instruction looks like:
-
-<#noparse>This part of the template wont be parsed by the 
-FreeMarker parser. Instead, it will be treated as verbatim text information,
-and output as such.</#noparse>
-
-The rest of the template appears here.
-
-Simple.
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-format.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-format.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-format.txt
deleted file mode 100644
index a6f8475..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-format.txt
+++ /dev/null
@@ -1,33 +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.
- */
-1
-1
-1 234 567,89
-1234567.886
-1,00
-1
-1234567,89
-1234567.886
-1
-1
-1.000000000000001
-0.0000000000000001
--0.0000000000000001
-1
-0.0000000000000001

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-literal.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-literal.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-literal.txt
deleted file mode 100644
index b80bc85..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-literal.txt
+++ /dev/null
@@ -1,79 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Number Literal Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Now perform a number assignment:</p>
-
-1,3
-
-
-My number is: 1,8
-My float is: 1.800000
-The int part is: 1
-
-
-1.83
-
-<p>Now use numbers in assignment</p>
-
-6
-
-8
-
-<p>Try numbers in tests</p>
-
-MyMessage is not 152, its: 8.
-
-<if (mymessage > 5)>
-   MyMessage is greater than five.
-</if
-
-		MyMessage is: 8.
-
-<p>Now for numbers in dynamic keys:</p>
-
-
-one
-three
-
-<p>Numbers in hashes:</p>
-
-twelve
-twelve
-twelve
-
-
-<p>Numbers in method calls:</p>
-
-Single argument value is: 1
-Single argument value is: 1
-Single argument value is: 12
-Single argument value is: 3
-Single argument value is: 3
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-to-date.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-to-date.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-to-date.txt
deleted file mode 100644
index bc8a10e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/number-to-date.txt
+++ /dev/null
@@ -1,31 +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.
- */
-2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
-2011-05-16 == 2011-05-16
-19:47:55.54Z == 19:47:55.54Z
-
-2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
-2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
-2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
-2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z
-1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z
-1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z
-1970-01-01T00:00:00Z == 1970-01-01T00:00:00Z
-
-failed

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/numerical-cast.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/numerical-cast.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/numerical-cast.txt
deleted file mode 100644
index 3bf6cd0..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/numerical-cast.txt
+++ /dev/null
@@ -1,462 +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.
- */
-
-?int:
-    0?int=0
-    1?int=1
-    -1?int=-1
-    0.5?int=0
-    1.5?int=1
-    -0.5?int=0
-    -1.5?int=-1
-    0.25?int=0
-    -0.25?int=0
-    1.75?int=1
-    -1.75?int=-1
-    1.01?int=1
-    -1.01?int=-1
-    0.01?int=0
-    -0.01?int=0
-    127?int=127
-    128?int=128
-    -127?int=-127
-    -128?int=-128
-    32767?int=32767
-    32768?int=32768
-    -32767?int=-32767
-    -32768?int=-32768
-    2147483647?int=2147483647
-    2147483648?int=-2147483648
-    -2147483647?int=-2147483647
-    -2147483648?int=-2147483648
-    4294967295?int=-1
-    4294967296?int=0
-    -4294967295?int=1
-    -4294967296?int=0
-    2147483647.1?int=2147483647
-    2147483648.1?int=-2147483648
-    -2147483647.1?int=-2147483647
-    -2147483648.1?int=-2147483648
-    4294967295.1?int=-1
-    4294967296.1?int=0
-    -4294967295.1?int=1
-    -4294967296.1?int=0
-    2147483647.5?int=2147483647
-    2147483648.5?int=-2147483648
-    -2147483647.5?int=-2147483647
-    -2147483648.5?int=-2147483648
-    4294967295.5?int=-1
-    4294967296.5?int=0
-    -4294967295.5?int=1
-    -4294967296.5?int=0
-
-?double
-    0?double=0
-    1?double=1
-    -1?double=-1
-    0.5?double=0.5
-    1.5?double=1.5
-    -0.5?double=-0.5
-    -1.5?double=-1.5
-    0.25?double=0.25
-    -0.25?double=-0.25
-    1.75?double=1.75
-    -1.75?double=-1.75
-    1.01?double=1.01
-    -1.01?double=-1.01
-    0.01?double=0.01
-    -0.01?double=-0.01
-    127?double=127
-    128?double=128
-    -127?double=-127
-    -128?double=-128
-    32767?double=32767
-    32768?double=32768
-    -32767?double=-32767
-    -32768?double=-32768
-    2147483647?double=2147483647
-    2147483648?double=2147483648
-    -2147483647?double=-2147483647
-    -2147483648?double=-2147483648
-    4294967295?double=4294967295
-    4294967296?double=4294967296
-    -4294967295?double=-4294967295
-    -4294967296?double=-4294967296
-    2147483647.1?double=2147483647.1
-    2147483648.1?double=2147483648.1
-    -2147483647.1?double=-2147483647.1
-    -2147483648.1?double=-2147483648.1
-    4294967295.1?double=4294967295.1
-    4294967296.1?double=4294967296.1
-    -4294967295.1?double=-4294967295.1
-    -4294967296.1?double=-4294967296.1
-    2147483647.5?double=2147483647.5
-    2147483648.5?double=2147483648.5
-    -2147483647.5?double=-2147483647.5
-    -2147483648.5?double=-2147483648.5
-    4294967295.5?double=4294967295.5
-    4294967296.5?double=4294967296.5
-    -4294967295.5?double=-4294967295.5
-    -4294967296.5?double=-4294967296.5
-
-?long
-    0?long=0
-    1?long=1
-    -1?long=-1
-    0.5?long=0
-    1.5?long=1
-    -0.5?long=0
-    -1.5?long=-1
-    0.25?long=0
-    -0.25?long=0
-    1.75?long=1
-    -1.75?long=-1
-    1.01?long=1
-    -1.01?long=-1
-    0.01?long=0
-    -0.01?long=0
-    127?long=127
-    128?long=128
-    -127?long=-127
-    -128?long=-128
-    32767?long=32767
-    32768?long=32768
-    -32767?long=-32767
-    -32768?long=-32768
-    2147483647?long=2147483647
-    2147483648?long=2147483648
-    -2147483647?long=-2147483647
-    -2147483648?long=-2147483648
-    4294967295?long=4294967295
-    4294967296?long=4294967296
-    -4294967295?long=-4294967295
-    -4294967296?long=-4294967296
-    2147483647.1?long=2147483647
-    2147483648.1?long=2147483648
-    -2147483647.1?long=-2147483647
-    -2147483648.1?long=-2147483648
-    4294967295.1?long=4294967295
-    4294967296.1?long=4294967296
-    -4294967295.1?long=-4294967295
-    -4294967296.1?long=-4294967296
-    2147483647.5?long=2147483647
-    2147483648.5?long=2147483648
-    -2147483647.5?long=-2147483647
-    -2147483648.5?long=-2147483648
-    4294967295.5?long=4294967295
-    4294967296.5?long=4294967296
-    -4294967295.5?long=-4294967295
-    -4294967296.5?long=-4294967296
-
-?long from date
-    1304877615000 = 1304877615000
-
-?float
-    0?float=0
-    1?float=1
-    -1?float=-1
-    0.5?float=0.5
-    1.5?float=1.5
-    -0.5?float=-0.5
-    -1.5?float=-1.5
-    0.25?float=0.25
-    -0.25?float=-0.25
-    1.75?float=1.75
-    -1.75?float=-1.75
-    1.01?float=1.00999999
-    -1.01?float=-1.00999999
-    0.01?float=0.01
-    -0.01?float=-0.01
-    127?float=127
-    128?float=128
-    -127?float=-127
-    -128?float=-128
-    32767?float=32767
-    32768?float=32768
-    -32767?float=-32767
-    -32768?float=-32768
-    2147483647?float=2147483648
-    2147483648?float=2147483648
-    -2147483647?float=-2147483648
-    -2147483648?float=-2147483648
-    4294967295?float=4294967296
-    4294967296?float=4294967296
-    -4294967295?float=-4294967296
-    -4294967296?float=-4294967296
-    2147483647.1?float=2147483648
-    2147483648.1?float=2147483648
-    -2147483647.1?float=-2147483648
-    -2147483648.1?float=-2147483648
-    4294967295.1?float=4294967296
-    4294967296.1?float=4294967296
-    -4294967295.1?float=-4294967296
-    -4294967296.1?float=-4294967296
-    2147483647.5?float=2147483648
-    2147483648.5?float=2147483648
-    -2147483647.5?float=-2147483648
-    -2147483648.5?float=-2147483648
-    4294967295.5?float=4294967296
-    4294967296.5?float=4294967296
-    -4294967295.5?float=-4294967296
-    -4294967296.5?float=-4294967296
-
-?byte
-    0?byte=0
-    1?byte=1
-    -1?byte=-1
-    0.5?byte=0
-    1.5?byte=1
-    -0.5?byte=0
-    -1.5?byte=-1
-    0.25?byte=0
-    -0.25?byte=0
-    1.75?byte=1
-    -1.75?byte=-1
-    1.01?byte=1
-    -1.01?byte=-1
-    0.01?byte=0
-    -0.01?byte=0
-    127?byte=127
-    128?byte=-128
-    -127?byte=-127
-    -128?byte=-128
-    32767?byte=-1
-    32768?byte=0
-    -32767?byte=1
-    -32768?byte=0
-    2147483647?byte=-1
-    2147483648?byte=0
-    -2147483647?byte=1
-    -2147483648?byte=0
-    4294967295?byte=-1
-    4294967296?byte=0
-    -4294967295?byte=1
-    -4294967296?byte=0
-    2147483647.1?byte=-1
-    2147483648.1?byte=0
-    -2147483647.1?byte=1
-    -2147483648.1?byte=0
-    4294967295.1?byte=-1
-    4294967296.1?byte=0
-    -4294967295.1?byte=1
-    -4294967296.1?byte=0
-    2147483647.5?byte=-1
-    2147483648.5?byte=0
-    -2147483647.5?byte=1
-    -2147483648.5?byte=0
-    4294967295.5?byte=-1
-    4294967296.5?byte=0
-    -4294967295.5?byte=1
-    -4294967296.5?byte=0
-
-?short
-    0?short=0
-    1?short=1
-    -1?short=-1
-    0.5?short=0
-    1.5?short=1
-    -0.5?short=0
-    -1.5?short=-1
-    0.25?short=0
-    -0.25?short=0
-    1.75?short=1
-    -1.75?short=-1
-    1.01?short=1
-    -1.01?short=-1
-    0.01?short=0
-    -0.01?short=0
-    127?short=127
-    128?short=128
-    -127?short=-127
-    -128?short=-128
-    32767?short=32767
-    32768?short=-32768
-    -32767?short=-32767
-    -32768?short=-32768
-    2147483647?short=-1
-    2147483648?short=0
-    -2147483647?short=1
-    -2147483648?short=0
-    4294967295?short=-1
-    4294967296?short=0
-    -4294967295?short=1
-    -4294967296?short=0
-    2147483647.1?short=-1
-    2147483648.1?short=0
-    -2147483647.1?short=1
-    -2147483648.1?short=0
-    4294967295.1?short=-1
-    4294967296.1?short=0
-    -4294967295.1?short=1
-    -4294967296.1?short=0
-    2147483647.5?short=-1
-    2147483648.5?short=0
-    -2147483647.5?short=1
-    -2147483648.5?short=0
-    4294967295.5?short=-1
-    4294967296.5?short=0
-    -4294967295.5?short=1
-    -4294967296.5?short=0
-
-?floor
-    0?floor=0
-    1?floor=1
-    -1?floor=-1
-    0.5?floor=0
-    1.5?floor=1
-    -0.5?floor=-1
-    -1.5?floor=-2
-    0.25?floor=0
-    -0.25?floor=-1
-    1.75?floor=1
-    -1.75?floor=-2
-    1.01?floor=1
-    -1.01?floor=-2
-    0.01?floor=0
-    -0.01?floor=-1
-    127?floor=127
-    128?floor=128
-    -127?floor=-127
-    -128?floor=-128
-    32767?floor=32767
-    32768?floor=32768
-    -32767?floor=-32767
-    -32768?floor=-32768
-    2147483647?floor=2147483647
-    2147483648?floor=2147483648
-    -2147483647?floor=-2147483647
-    -2147483648?floor=-2147483648
-    4294967295?floor=4294967295
-    4294967296?floor=4294967296
-    -4294967295?floor=-4294967295
-    -4294967296?floor=-4294967296
-    2147483647.1?floor=2147483647
-    2147483648.1?floor=2147483648
-    -2147483647.1?floor=-2147483648
-    -2147483648.1?floor=-2147483649
-    4294967295.1?floor=4294967295
-    4294967296.1?floor=4294967296
-    -4294967295.1?floor=-4294967296
-    -4294967296.1?floor=-4294967297
-    2147483647.5?floor=2147483647
-    2147483648.5?floor=2147483648
-    -2147483647.5?floor=-2147483648
-    -2147483648.5?floor=-2147483649
-    4294967295.5?floor=4294967295
-    4294967296.5?floor=4294967296
-    -4294967295.5?floor=-4294967296
-    -4294967296.5?floor=-4294967297
-
-?ceiling
-    0?ceiling=0
-    1?ceiling=1
-    -1?ceiling=-1
-    0.5?ceiling=1
-    1.5?ceiling=2
-    -0.5?ceiling=0
-    -1.5?ceiling=-1
-    0.25?ceiling=1
-    -0.25?ceiling=0
-    1.75?ceiling=2
-    -1.75?ceiling=-1
-    1.01?ceiling=2
-    -1.01?ceiling=-1
-    0.01?ceiling=1
-    -0.01?ceiling=0
-    127?ceiling=127
-    128?ceiling=128
-    -127?ceiling=-127
-    -128?ceiling=-128
-    32767?ceiling=32767
-    32768?ceiling=32768
-    -32767?ceiling=-32767
-    -32768?ceiling=-32768
-    2147483647?ceiling=2147483647
-    2147483648?ceiling=2147483648
-    -2147483647?ceiling=-2147483647
-    -2147483648?ceiling=-2147483648
-    4294967295?ceiling=4294967295
-    4294967296?ceiling=4294967296
-    -4294967295?ceiling=-4294967295
-    -4294967296?ceiling=-4294967296
-    2147483647.1?ceiling=2147483648
-    2147483648.1?ceiling=2147483649
-    -2147483647.1?ceiling=-2147483647
-    -2147483648.1?ceiling=-2147483648
-    4294967295.1?ceiling=4294967296
-    4294967296.1?ceiling=4294967297
-    -4294967295.1?ceiling=-4294967295
-    -4294967296.1?ceiling=-4294967296
-    2147483647.5?ceiling=2147483648
-    2147483648.5?ceiling=2147483649
-    -2147483647.5?ceiling=-2147483647
-    -2147483648.5?ceiling=-2147483648
-    4294967295.5?ceiling=4294967296
-    4294967296.5?ceiling=4294967297
-    -4294967295.5?ceiling=-4294967295
-    -4294967296.5?ceiling=-4294967296
-
-?round
-    0?round=0
-    1?round=1
-    -1?round=-1
-    0.5?round=1
-    1.5?round=2
-    -0.5?round=0
-    -1.5?round=-1
-    0.25?round=0
-    -0.25?round=0
-    1.75?round=2
-    -1.75?round=-2
-    1.01?round=1
-    -1.01?round=-1
-    0.01?round=0
-    -0.01?round=0
-    127?round=127
-    128?round=128
-    -127?round=-127
-    -128?round=-128
-    32767?round=32767
-    32768?round=32768
-    -32767?round=-32767
-    -32768?round=-32768
-    2147483647?round=2147483647
-    2147483648?round=2147483648
-    -2147483647?round=-2147483647
-    -2147483648?round=-2147483648
-    4294967295?round=4294967295
-    4294967296?round=4294967296
-    -4294967295?round=-4294967295
-    -4294967296?round=-4294967296
-    2147483647.1?round=2147483647
-    2147483648.1?round=2147483648
-    -2147483647.1?round=-2147483647
-    -2147483648.1?round=-2147483648
-    4294967295.1?round=4294967295
-    4294967296.1?round=4294967296
-    -4294967295.1?round=-4294967295
-    -4294967296.1?round=-4294967296
-    2147483647.5?round=2147483648
-    2147483648.5?round=2147483649
-    -2147483647.5?round=-2147483647
-    -2147483648.5?round=-2147483648
-    4294967295.5?round=4294967296
-    4294967296.5?round=4294967297
-    -4294967295.5?round=-4294967295
-    -4294967296.5?round=-4294967296

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding1.txt
deleted file mode 100644
index 3b5215a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding1.txt
+++ /dev/null
@@ -1,27 +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.
- */
-Output charset: UTF-8
-URL escaping charset: undefined
-
-a%FE%FF%00%2F%00%25b
-a%FE%FF%00%2F%00%25b
-a%2F%25b
-a%2F%25b
-a%FE%FF%00%2F%00%25b
-a%2F%25b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding2.txt
deleted file mode 100644
index 6956b6c..0000000
Binary files a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding2.txt and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding3.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding3.txt
deleted file mode 100644
index c0369f6..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/output-encoding3.txt
+++ /dev/null
@@ -1,26 +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.
- */
-Output charset: ISO-8859-1
-URL escaping charset: UTF-16
-
-UTF-16: a%FE%FF%00%2F%00%25b
-ISO-8859-1: a%2F%25b
-UTF-16: a%FE%FF%00%2F%00%25b
-ISO-8859-1: a%2F%25b
-ISO-8859-1: a%2F%25b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/precedence.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/precedence.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/precedence.txt
deleted file mode 100644
index b19cb31..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/precedence.txt
+++ /dev/null
@@ -1,48 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Operator Precedence Test</title>
-</head>
-<body>
-
-@@@@@@@@@@@
-
-<br />
-<br />
-
-##########
-
-<br />
-<br />
-
-&&&&&&&&&&&
-
-<br />
-<br />
-
-!!!!!!!!!!!
-
-<br />
-<br />
-
-$$$$$$$$$$$
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/recover.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/recover.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/recover.txt
deleted file mode 100644
index 880cea3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/recover.txt
+++ /dev/null
@@ -1,26 +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.
- */
- Hello, World
- Well, that did not work.
- Now we nest another attempt/recover here:
-   Oops...
-   Remember, freeMarker sequences are zero-based! Hello, World
- Now we check the current error message.
-  The template is not currently available
-  The included template had a problem.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/root.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/root.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/root.txt
deleted file mode 100644
index 041222c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/root.txt
+++ /dev/null
@@ -1,44 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Root Lookup Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-<p>Access the same variable via the root variable (dot syntax):</p>
-
-<p>Hello, world!</p>
-
-<p>Access the same variable via the root variable (bracket syntax):</p>
-
-<p>Hello, world!</p>
-
-<p>Ensure that root lookups are unaffected by local variables:</p>
-
-
-  Hello, world!
-  Hello, world! Part Deux
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/sequence-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/sequence-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/sequence-builtins.txt
deleted file mode 100644
index 4f7796a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/sequence-builtins.txt
+++ /dev/null
@@ -1,404 +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.
- */
-Sorting scalars:
-----------------
-
-String order:
-- aardvark
-- Barbara
-- beetroot
-- whale
-- zeppelin
-
-First: aardvark
-Last: zeppelin
-Size 5
-
-Numerical order:
-- -324
-- -34
-- 0
-- 0.1
-- 0.11
-- 1
-- 5
-- 111
-- 123
-- 543
-
-First: -324
-Last: 543
-Size 10
-
-Date/time order:
-- 06:05
-- 08:05
-- 08:15
-- 18:00
-
-Boolean order:
-- false
-- false
-- true
-- true
-
-
-Sorting hashes:
----------------
-
-Order by name:
-- aardvark: 30
-- Barbara: 53
-- beetroot: 0.3
-- whale: 2000
-- zeppelin: -200
-
-Order by weight:
-- zeppelin: -200
-- beetroot: 0.3
-- aardvark: 30
-- Barbara: 53
-- whale: 2000
-
-Order by a.x.v:
-- aqweqw
-- dfgdf
-- qweqw
-- utyu
-
-Order by a.y, which is a date:
-- 1998-02-20
-- 1999-01-20
-- 1999-04-19
-- 1999-04-20
-
-Reverse:
---------
-
-Order by weight desc:
-- whale: 2000
-- Barbara: 53
-- aardvark: 30
-- beetroot: 0.3
-- zeppelin: -200
-
-Order by weight desc desc:
-- zeppelin: -200
-- beetroot: 0.3
-- aardvark: 30
-- Barbara: 53
-- whale: 2000
-
-Order by weight desc desc desc:
-- whale: 2000
-- Barbara: 53
-- aardvark: 30
-- beetroot: 0.3
-- zeppelin: -200
-
-Contains:
----------
-
-True:
-true
-true
-true
-true
-true
-true
-true
-
-False:
-false
-false
-false
-false
-false
-false
-false
-
-False: false
-
-Index_of:
----------
-
-0 = 0
-1 = 1
-2 = 2
-6 = 6
-0 = 0
-1 = 1
-2 = 2
-
--1 = -1
--1 = -1
--1 = -1
--1 = -1
--1 = -1
--1 = -1
--1 = -1
-
--1 = -1
-
-Last_index_of:
---------------
-
-6 = 6
-1 = 1
-2 = 2
-7 = 7
--1 = -1
-0 = 0
-1 = 1
-2 = 2
--1 = -1
-
-Index_of and last_index_of with starting indices
-------------------------------------------------
-
-seq_index_of "Joe":
-0 = 0
-0 = 0
-0 = 0
-2 = 2
-2 = 2
--1 = -1
--1 = -1
- 
-seq_last_index_of "Joe":
--1 = -1
--1 = -1
-0 = 0
-0 = 0
-2 = 2
-2 = 2
-2 = 2
- 
-seq_index_of "Susan":
-3 = 3
-3 = 3
-3 = 3
-3 = 3
-3 = 3
-3 = 3
--1 = -1
- 
-seq_last_index_of "Susan":
--1 = -1
--1 = -1
--1 = -1
--1 = -1
--1 = -1
-3 = 3
-3 = 3
-
-seq_index_of "a":
-0 = 0
-0 = 0
-0 = 0
--1 = -1
--1 = -1
--1 = -1
--1 = -1
-
-seq_index_of "b":
-1 = 1
-1 = 1
-1 = 1
-1 = 1
--1 = -1
--1 = -1
-
-seq_index_of "c":
-2 = 2
-2 = 2
-2 = 2
-2 = 2
-2 = 2
--1 = -1
- 
-seq_last_index_of "a":
--1 = -1
--1 = -1
-0 = 0
-0 = 0
-0 = 0
-0 = 0
-0 = 0
-
-seq_last_index_of "b":
--1 = -1
--1 = -1
--1 = -1
-1 = 1
-1 = 1
-1 = 1
-
-seq_last_index_of "c":
--1 = -1
--1 = -1
--1 = -1
--1 = -1
-2 = 2
-2 = 2
-
-Sequence builtins ignoring nulls
---------------------------------
-
-true = true
-2 = 2
-0 = 0
-
-These should throw exception, but for BC they don't:
-false = false
--1 = -1
--1 = -1
-
-Sequence built-ins failing on date-type mismatch
-------------------------------------------------
-
-
-Chunk
------
-
-columns = 1, fill = NULL:
-  Rows: 7
-    a   <-- Columns: 1
-    b   <-- Columns: 1
-    c   <-- Columns: 1
-    d   <-- Columns: 1
-    e   <-- Columns: 1
-    f   <-- Columns: 1
-    g   <-- Columns: 1
-  
-columns = 2, fill = NULL:
-  Rows: 4
-    a b   <-- Columns: 2
-    c d   <-- Columns: 2
-    e f   <-- Columns: 2
-    g   <-- Columns: 1
-  
-columns = 3, fill = NULL:
-  Rows: 3
-    a b c   <-- Columns: 3
-    d e f   <-- Columns: 3
-    g   <-- Columns: 1
-  
-columns = 4, fill = NULL:
-  Rows: 2
-    a b c d   <-- Columns: 4
-    e f g   <-- Columns: 3
-  
-columns = 5, fill = NULL:
-  Rows: 2
-    a b c d e   <-- Columns: 5
-    f g   <-- Columns: 2
-  
-columns = 10, fill = NULL:
-  Rows: 1
-    a b c d e f g   <-- Columns: 7
-  
-columns = 1, fill = -:
-  Rows: 7
-    a   <-- Columns: 1
-    b   <-- Columns: 1
-    c   <-- Columns: 1
-    d   <-- Columns: 1
-    e   <-- Columns: 1
-    f   <-- Columns: 1
-    g   <-- Columns: 1
-  
-columns = 2, fill = -:
-  Rows: 4
-    a b   <-- Columns: 2
-    c d   <-- Columns: 2
-    e f   <-- Columns: 2
-    g -   <-- Columns: 2
-  
-columns = 3, fill = -:
-  Rows: 3
-    a b c   <-- Columns: 3
-    d e f   <-- Columns: 3
-    g - -   <-- Columns: 3
-  
-columns = 4, fill = -:
-  Rows: 2
-    a b c d   <-- Columns: 4
-    e f g -   <-- Columns: 4
-  
-columns = 5, fill = -:
-  Rows: 2
-    a b c d e   <-- Columns: 5
-    f g - - -   <-- Columns: 5
-  
-columns = 10, fill = -:
-  Rows: 1
-    a b c d e f g - - -   <-- Columns: 10
-  
-columns = 3, fill = NULL:
-  Rows: 3
-    1 2 3   <-- Columns: 3
-    4 5 6   <-- Columns: 3
-    7 8 9   <-- Columns: 3
-  
-columns = 3, fill = -:
-  Rows: 3
-    1 2 3   <-- Columns: 3
-    4 5 6   <-- Columns: 3
-    7 8 9   <-- Columns: 3
-  
-columns = 3, fill = NULL:
-  Rows: 1
-    1   <-- Columns: 1
-  
-columns = 3, fill = -:
-  Rows: 1
-    1 - -   <-- Columns: 3
-  
-columns = 3, fill = NULL:
-  Rows: 0
-  
-columns = 3, fill = -:
-  Rows: 0
-  
-
-
-
-Join
-----
-
-- 1, two, three, 4
-- 
-- 1, two, three, 4.
-- (empty)
-- a, c
-- a, c
-- a, c.
-- 
-- (empty)
-- (empty)
-- a, b, c.
-- a, b, c.
-
-
-Misc
-----
-
-First of set 1: a
-First of set 2: a
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/specialvars.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/specialvars.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/specialvars.txt
deleted file mode 100644
index e2fa13e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/specialvars.txt
+++ /dev/null
@@ -1,25 +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.
- */
-en == en
-en_US == en_US
-utf-8 == utf-8
-specialvars.ftl == specialvars.ftl
-iso-8859-1 == iso-8859-1
-x == x
-true == true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps-matches.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps-matches.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps-matches.txt
deleted file mode 100644
index ba14e7f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps-matches.txt
+++ /dev/null
@@ -1,99 +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.
- */
-
-List mode:
-Size: 4
-[L16][L27][L38][L49]
-[L16][L27][L38][L49]
-
-Iterator mode:
-[L16][L27][L38][L49]
-[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)]
-[L16][L27][L38][L49]
-
-Iterator mode changes to list mode:
-[L16]/4[L27]/4[L38]/4[L49]/4
-[L16][L27][L38][L49]
-
-Iterator mode changes to list mode 2:
-[L16][L27][L38][L49]
-[L16]/4[L27]/4[L38]/4[L49]/4
-
-List mode with embedded iteration:
-[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)]
-
-Entire input match:
-- M: L16
-    - G: L16
-    - G: 1
-    - G: 6
-- M: L27
-    - G: L27
-    - G: 2
-    - G: 7
-- M: L38
-    - G: L38
-    - G: 3
-    - G: 8
-- M: L49
-    - G: L49
-    - G: 4
-    - G: 9
-firstGS was: L16, 1, 6
-
-Entire input match 2:
-Matches: true
-- G: x12
-- G: 1
-- G: 2
-As list:
-- M: x12
-    - G: x12
-    - G: 1
-    - G: 2
-Groups again:
-- G: x12
-- G: 1
-- G: 2
-
-Entire input match 3:
-Matches: false
-
-Entire input match 4:
-Matches: true
-- G: x12
-- G: 1
-- G: 2
-
-Substring match nested into entire input match:
-- G: x12 ([x12{x12, 1, 2}])
-- G: 1 ([x12{x12, 1, 2}])
-- G: 2 ([x12{x12, 1, 2}])
-
-Different entire input and substring matches:
-123, 123
-- M: 1 (Gs: 1, 1)
-- M: 2 (Gs: 2, 2)
-- M: 3 (Gs: 3, 3)
-
-Different entire input and substring matches 2:
-123
-- M: 1 (Gs: 1)
-- M: 2 (Gs: 2)
-- M: 3 (Gs: 3)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps.txt
deleted file mode 100644
index c54dc96..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins-regexps.txt
+++ /dev/null
@@ -1,112 +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.
- */
-true == true
-true == true
-
-false == false
-true == true
-
-false == false
-true == true
-
-false == false
-true == true
-
-false == false
-false == false
-false == false
-true == true
-true == true
-true == true
-
-false == false
-false == false
-true == true
-true == true
-true == true
-true == true
-
-
-Lower 'c'-words:
-- coverage
-- considered
-
-Any 'c'-words:
-- Code
-- coverage
-- considered
-
-Lower line-last words:
-- coverage
-
-Any line-last words:
-- coverage
-- BROKEN
-
-Any last words:
-- BROKEN
-
-c-word with follower:
-- "Code without"
-  Groups: "Code without", "Code", "without"
-- "coverage\nis"
-  Groups: "coverage\nis", "coverage", "is"
-- "considered to"
-  Groups: "considered to", "considered", "to"
-
-c-word with follower in the same line:
-- Code without
-- considered to
-
-Lower c-word with follower in the same line:
-- considered to
-
-  Ignored but logged in 2.3: False == False
-  Ignored but logged in 2.3: False == False
-
-FOObar == FOObar
-Foobar == Foobar
-FOObar == FOObar
-FOObarFOO == FOObarFOO
-FOObarfOO == FOObarfOO
-FOObarfOO == FOObarfOO
-Foobar == Foobar
-FOObar == FOObar
-FOObarFOO == FOObarFOO
-FOObarfOO == FOObarfOO
-FOObarfOO == FOObarfOO
-foobar == foobar
-foobar == foobar
-FOObar == FOObar
-FOObarFOO == FOObarFOO
-FOObarfOo == FOObarfOo
-FAlse == FAlse
-FAlse == FAlse
-
-  Ignored but logged in 2.3: FOObar
-
-[foo, barxbaaz] == [foo, barxbaaz]
-[foo, barxbaaz] == [foo, barxbaaz]
-[foo, bar, baaz] == [foo, bar, baaz]
-[foo, barxbaaz] == [foo, barxbaaz]
-[foo, bar, baaz] == [foo, bar, baaz]
-[fooXXbarxxbaaz] == [fooXXbarxxbaaz]
-[foo, bar, baaz] == [foo, bar, baaz]
-[F, ls] == [F, ls]
-[Fals, ] == [Fals, ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins1.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins1.txt
deleted file mode 100644
index 6e689ac..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins1.txt
+++ /dev/null
@@ -1,112 +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.
- */
-FreeMarker: Encoding string built-in tests
-
-  
-cap_first:    DieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
-uncap_first:  dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
-uncap_first:blah
-capitalize:   Diebugsdie! * Vazzze 123456 --cdc-- --<<--@ X ${"kigyo"?upper_case}  
-html:         dieBugsDie! * vazzZE 123456 --cdc-- --&lt;&lt;--@ x ${&quot;kigyo&quot;?upper_case}  
-length:     71
-lower_case:   diebugsdie! * vazzze 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  
-rtf:          dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x $\{"kigyo"?upper_case\}  
-trim:       dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}
-trim2:      foo bar
-trim3:      foo bar
-trim4:      foo bar
-upper_case:   DIEBUGSDIE! * VAZZZE 123456 --CDC-- --<<--@ X ${"KIGYO"?UPPER_CASE}  
-xml:          dieBugsDie! * vazzZE 123456 --cdc-- --&lt;&lt;--@ x ${&quot;kigyo&quot;?upper_case}  
-xhtml:      &quot;Blah&#39;s is &gt; 1 &amp; &lt; 2&quot;
-
-word_list:
-- dieBugsDie!
-- *
-- vazzZE
-- 123456
-- --cdc--
-- --<<--@
-- x
-- ${"kigyo"?upper_case}
-
-interpret:   dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x KIGYO  
-number: -122,35
-1500
-5
-0
-0
-true
-true
-true
-true
-true
-
-default constructor
-1
-xxx
-xxx:yyy
-
-
-In The Sacred, Holy beginning, God created The Sacred, Holy Heavens and The Sacred, Holy Earth. 
-In the very beginning, God created the Heavens and The Earth. 
-|I|n| |t|h|e| |b|e|g|i|n|n|i|n|g|,| |G|o|d| |c|r|e|a|t|e|d| |t|h|e| |H|e|a|v|e|n|s| |a|n|d| |T|h|e| |E|a|r|t|h|.| 
-|In the beginning, God created the Heavens and The Earth. 
-
-In the beginning, God created the sky and The Earth. 
-
-matches
-
-  the beginning
-  the sacred beginning
-  the Heavens
-  the sacred Heavens
-  The Earth
-  The sacred Earth
-
-In the beginning, God created the Heavens and The Earth.
-beginning
-the Heavens and The Earth.
-
-   foo
-   bar
-   baz
-       foobar
-
-
-FOOBAR
-
-[a] = [a]
-[a\\'x'\nb] = [a\\'x'\nb]
-[\u0001\u001a ] = [\u0001\u001a ]
-
-[a] = [a]
-[a\\\'x\'\nb] = [a\\\'x\'\nb]
-[\x01\x1A ] = [\x01\x1A ]
-[\x3C![CDATA[] = [\x3C![CDATA[]
-[]]\>] = []]\>]
-
-[a] = [a]
-[a\\'x'\nb] = [a\\'x'\nb]
-[\u0001\u001A ] = [\u0001\u001A ]
-[\n\r\t\f\b\"] = [\n\r\t\f\b\"]
-[\/] = [\/]
-[a/b] = [a/b]
-[<\/script>] = [<\/script>]
-[\u003C![CDATA[] = [\u003C![CDATA[]
-[]]\u003E] = []]\u003E]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins2.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins2.txt
deleted file mode 100644
index f5eebd9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/string-builtins2.txt
+++ /dev/null
@@ -1,135 +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.
- */
---
-1 = 1
-5 = 5
-0 = 0
---
-5 = 5
-1 = 1
-7 = 7
---
-true = true
-false = false
-true = true
---
-true = true
-false = false
-true = true
---
-true = true
-true = true
-true = true
-false = false
-true = true
---
-[abbcdbb] = [abbcdbb]
-[qwe] = [qwe]
-[qwe] = [qwe]
-[qwe] = [qwe]
-[qwe
-] = [qwe
-]
-[qwe
-] = [qwe
-]
---
-[abbcdbb] = [abbcdbb]
-[abb-dbb] = [abb-dbb]
-[a-=*cd-=*] = [a-=*cd-=*]
---
-[a][][cd][][] == [a][][cd][][]
-[][die][maggots][!] == [][die][maggots][!]
-[Die maggots!] == [Die maggots!]
---
-[     ]
-[    a]
-[   ab]
-[  abc]
-[ abcd]
-[abcde]
-[abcdef]
-[abcdefg]
-[abcdefgh]
-[-----]
-[----a]
-[---ab]
-[--abc]
-[-abcd]
-[abcde]
-[abcdef]
-[abcdefg]
-[abcdefgh]
-[.oO.oO.o]
-[.oO.oO.a]
-[.oO.oOab]
-[.oO.oabc]
-[.oO.abcd]
-[.oOabcde]
-[.oabcdef]
-[.abcdefg]
-[abcdefgh]
-[abcdefghi]
-[abcdefghij]
-[]
-[/]
-[/\]
-[/\_]
-[/\_/]
-[/\_/\]
-[/\_/\_]
-[/\_/\_/]
---
-[     ]
-[a    ]
-[ab   ]
-[abc  ]
-[abcd ]
-[abcde]
-[abcdef]
-[abcdefg]
-[abcdefgh]
-[-----]
-[a----]
-[ab---]
-[abc--]
-[abcd-]
-[abcde]
-[abcdef]
-[abcdefg]
-[abcdefgh]
-[.oO.oO.o]
-[aoO.oO.o]
-[abO.oO.o]
-[abc.oO.o]
-[abcdoO.o]
-[abcdeO.o]
-[abcdef.o]
-[abcdefgo]
-[abcdefgh]
-[abcdefghi]
-[abcdefghij]
-[]
-[/]
-[/\]
-[/\_]
-[/\_/]
-[/\_/\]
-[/\_/\_]
-[/\_/\_/]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringbimethods.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringbimethods.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringbimethods.txt
deleted file mode 100644
index 8ef415d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringbimethods.txt
+++ /dev/null
@@ -1,29 +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.
- */
-3.00
-3.00
-01:02:03.000
-01:02:03.000
----
-de
-true false
-yes no
-igen nem
-0.0 1.0
-true true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringliteral.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringliteral.txt
deleted file mode 100644
index 3d9d4c9..0000000
Binary files a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/stringliteral.txt and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/switch.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/switch.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/switch.txt
deleted file mode 100644
index 5d42785..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/switch.txt
+++ /dev/null
@@ -1,80 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Switch-Case Test</title>
-</head>
-<body>
-
-<p>Here we iterate over a list of animals.</p>
-
-<p>Animal is: aardvark.<br />
-        This is the HTML for other animals.
-</p>
-<p>Animal is: kiwi.<br />
-        This is the HTML for the user's favorite animal.
-</p>
-<p>Animal is: gecko.<br />
-        This is the HTML for small animals.
-</p>
-<p>Animal is: cat.<br />
-        This is the HTML for other animals.
-</p>
-<p>Animal is: dog.<br />
-        This is the HTML for other animals.
-</p>
-<p>Animal is: elephant.<br />
-        This is the HTML for large animals.
-</p>
-<p>Animal is: squirrel.<br />
-        This is the HTML for small animals.
-</p>
-<p>Animal is: zebra.<br />
-        This is the HTML for a large stripey animal.
-        This is the HTML for large animals.
-</p>
-
-      1
-          i2
-      2
-          i4
-          ft
-      ft
-      3
-          i4
-      3
-          i6
-
-[]
-
-  ""
-  "1234"
-  "234"
-  "34"
-  "4"
-
-  "12default45"
-  "2default45"
-  "default"
-  "45"
-  "5"
-
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/transforms.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/transforms.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/transforms.txt
deleted file mode 100644
index 6b7f986..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/transforms.txt
+++ /dev/null
@@ -1,68 +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.
- */
-<html>
-<head>
-<title>FreeMarker: Transformation Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>Hello, world!</p>
-
-&lt;p&gt;Hello, world!&lt;/p&gt;
-
-<P>Now try the Utility package:</p>
-<p>Utility transformations</p>
-
-&lt;p&gt;Utility transformations&lt;/p&gt;
-
-<p>Now some nested transforms:</p>
-<p >This tests the compress transformation</p >&lt;p &gt;This tests the compress transformation&lt;/p &gt;&lt;p &gt;This tests the compress transformation&lt;/p &gt;
-<p>Now try method and transform interactions:</p>
-&lt;p&gt;This isn&apos;t a valid XML string.&lt;/p&gt;
-&lt;p&gt;This isn't a valid HTML string.&lt;/p&gt;
-
-<p>A more advanced interaction involves getting a TemplateMethodModel
-to initialise a TemplateTransformModel, as follow:</p>
-
-Comment: This is a comment
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-
-Comment: This is a second comment
-
-A test string containing quotes: &quot;This isn&apos;t a test&quot;.
-A test string containing amps: Fish & Chips.
-A test string containing tags: <p>Fish &amp; Chips.</p>
-Comment: This is a third comment
-
-A test string containing quotes: &quot;This isn&apos;t a test&quot;.
-A test string containing amps: Fish &amp; Chips.
-A test string containing tags: <p>Fish &amp;amp; Chips.</p>
-Comment: Utility transformations
-
-A test string containing quotes: "This isn't a test".
-A test string containing amps: Fish & Chips.
-A test string containing tags: &lt;p&gt;Fish &amp; Chips.&lt;/p&gt;
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
deleted file mode 100644
index 0b4e23a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
+++ /dev/null
@@ -1,33 +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.
- */
-StNuBoMeTaMaHaHxSeCoCxEnInDiNo
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 1 0 0 1 1 0 0
-0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
-0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 0 0 0

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/var-layers.txt
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/var-layers.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/var-layers.txt
deleted file mode 100644
index 5fd6e2e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/expected/var-layers.txt
+++ /dev/null
@@ -1,37 +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.
- */
-  1 = 1
-  2 = 2
-  3 = 3
-4 = 4 = 4
-5 = 5 = 5
-6 but 4 = 4
-7 = 7 = 7
-Invisiblity test 1.: passed
-Invisiblity test 2.: passed
-Invisiblity test 3.: passed
---
-  1 = 1
-  2 = 2
-  3 = 3
-  4 = 4 = 4 = 4
-  5
-  6 == 6
-  7 == 7 == 7
---



[18/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/Listables.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/Listables.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/Listables.java
new file mode 100644
index 0000000..55d06d5
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/Listables.java
@@ -0,0 +1,185 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateCollectionModel;
+import org.apache.freemarker.core.model.TemplateHashModelEx;
+import org.apache.freemarker.core.model.TemplateHashModelEx2;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.WrappingTemplateModel;
+import org.apache.freemarker.core.model.impl.DefaultMapAdapter;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.SimpleCollection;
+import org.apache.freemarker.core.model.impl.SimpleHash;
+
+import com.google.common.collect.ImmutableMap;
+
+@SuppressWarnings("boxing")
+public class Listables {
+    
+    private static final List<Integer> LIST;
+    static {
+        List<Integer> list = new ArrayList<>();
+        list.add(11);
+        list.add(22);
+        list.add(33);
+        LIST = list;
+    }
+
+    private static final List<Integer> LINKED_LIST;
+    static {
+        List<Integer> list = new LinkedList<>();
+        list.add(11);
+        list.add(22);
+        list.add(33);
+        LINKED_LIST = list;
+    }
+
+    private static final List<Integer> EMPTY_LINKED_LIST = new LinkedList<>();
+
+    private static final Set<Integer> SET;
+    static {
+        Set<Integer> set = new TreeSet<>();
+        set.add(11);
+        set.add(22);
+        set.add(33);
+        SET = set;
+    }
+    
+    public List<Integer> getList() {
+        return LIST;
+    }
+    
+    public List<Integer> getLinkedList() {
+        return LINKED_LIST;
+    }
+    
+    public Set<Integer> getSet() {
+        return SET;
+    }
+
+    public Iterator<Integer> getIterator() {
+        return SET.iterator();
+    }
+
+    public List<Integer> getEmptyList() {
+        return Collections.emptyList();
+    }
+    
+    public List<Integer> getEmptyLinkedList() {
+        return Collections.emptyList();
+    }
+    
+    public Set<Integer> getEmptySet() {
+        return Collections.emptySet();
+    }
+
+    public Iterator<Integer> getEmptyIterator() {
+        return Collections.<Integer>emptySet().iterator();
+    }
+    
+    public List<TemplateHashModelEx2> getHashEx2s() throws TemplateModelException {
+        Map<Object, Object> map;
+        map = new LinkedHashMap<>();
+        map.put("k1", "v1");
+        map.put(2, "v2");
+        map.put("k3", "v3");
+        map.put(null, "v4");
+        map.put(true, "v5");
+        map.put(false, null);
+        
+        return getMapsWrappedAsEx2(map);
+    }
+
+    public List<? extends TemplateHashModelEx> getEmptyHashes() throws TemplateModelException {
+        List<TemplateHashModelEx> emptyMaps = new ArrayList<>();
+        emptyMaps.addAll(getMapsWrappedAsEx2(Collections.emptyMap()));
+        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build()
+                .wrap(Collections.emptyMap()));
+        return emptyMaps;
+    }
+    
+    /**
+     * Returns the map wrapped on various ways.
+     */
+    private List<TemplateHashModelEx2> getMapsWrappedAsEx2(Map<?, ?> map) throws TemplateModelException {
+        List<TemplateHashModelEx2> maps = new ArrayList<>();
+        
+        DefaultObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
+        maps.add(new SimpleHash(map, ow));
+        maps.add((DefaultMapAdapter) ow.wrap(map));
+
+        return maps;
+    }
+    
+    public TemplateHashModelEx getHashNonEx2() {
+        return new NonEx2MapAdapter(ImmutableMap.of("k1", 11, "k2", 22),
+                new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build());
+    }
+    
+    public static class NonEx2MapAdapter extends WrappingTemplateModel implements TemplateHashModelEx {
+
+        private final Map<?, ?> map;
+        
+        public NonEx2MapAdapter(Map<?, ?> map, ObjectWrapper wrapper) {
+            super(wrapper);
+            this.map = map;
+        }
+        
+        @Override
+        public TemplateModel get(String key) throws TemplateModelException {
+            return wrap(map.get(key));
+        }
+        
+        @Override
+        public boolean isEmpty() {
+            return map.isEmpty();
+        }
+        
+        @Override
+        public int size() {
+            return map.size();
+        }
+        
+        @Override
+        public TemplateCollectionModel keys() {
+            return new SimpleCollection(map.keySet(), getObjectWrapper());
+        }
+        
+        @Override
+        public TemplateCollectionModel values() {
+            return new SimpleCollection(map.values(), getObjectWrapper());
+        }
+        
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel1.java
new file mode 100644
index 0000000..ce04928
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel1.java
@@ -0,0 +1,116 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.SimpleHash;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Testcase to see how FreeMarker deals with multiple Template models.
+ */
+public class MultiModel1 implements TemplateHashModel,
+        TemplateSequenceModel, TemplateScalarModel {
+
+    private ObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
+
+    private TemplateModel m_cSubModel = new MultiModel2();
+    private TemplateModel m_cListHashModel1 = new MultiModel4(ow);
+    private TemplateModel m_cListHashModel2 = new MultiModel5(ow);
+    private TemplateSequenceModel m_cListModel = new SimpleSequence(ow);
+    private TemplateHashModel m_cHashModel = new SimpleHash(ow);
+
+    /** Creates new MultiModel1 */
+    public MultiModel1() {
+        for ( int i = 0; i < 10; i++ ) {
+            ((SimpleSequence) m_cListModel).add( "Model1 value: " + Integer.toString( i ));
+        }
+        ((SimpleSequence) m_cListModel).add( new MultiModel3() );
+        ((SimpleHash) m_cHashModel).put( "nested", new MultiModel3() );
+    }
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        if ( key.equals( "model2" )) {
+            return m_cSubModel;
+        } else if ( key.equals( "modellist" )) {
+            return m_cListModel;
+        } else if ( key.equals( "selftest" )) {
+            return new SimpleScalar( "Selftest of a hash from MultiModel1" );
+        } else if ( key.equals( "one" )) {
+            return m_cListHashModel1;
+        } else if ( key.equals( "two" )) {
+            return m_cListHashModel2;
+        } else if ( key.equals( "size" )) {
+            return new SimpleScalar( "Nasty!" );
+        } else if ( key.equals( "nesting1" )) {
+            return m_cHashModel;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    /**
+     * @return the specified index in the list
+     */
+    @Override
+    public TemplateModel get(int i) throws TemplateModelException {
+        return m_cListModel.get( i );
+    }
+
+    /**
+     * Returns the scalar's value as a String.
+     *
+     * @return the String value of this scalar.
+     */
+    @Override
+    public String getAsString() {
+        return "MultiModel1 as a string!";
+    }
+
+    @Override
+    public int size() throws TemplateModelException {
+        return m_cListModel.size();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel2.java
new file mode 100644
index 0000000..e264936
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel2.java
@@ -0,0 +1,63 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.freemarker.core.model.TemplateMethodModel;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+
+/**
+ * Testcase to see how FreeMarker deals with multiple Template models.
+ */
+public class MultiModel2 implements TemplateScalarModel, TemplateMethodModel {
+
+    /**
+     * Returns the scalar's value as a String.
+     *
+     * @return the String value of this scalar.
+     */
+    @Override
+    public String getAsString() {
+        return "Model2 is alive!";
+    }
+
+    /**
+     * Executes a method call.
+     *
+     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing the values
+     * of the arguments passed to the method.
+     * @return the <tt>TemplateModel</tt> produced by the method, or null.
+     */
+    @Override
+    public Object exec(List arguments) {
+        StringBuilder  aResults = new StringBuilder( "Arguments are:<br />" );
+        Iterator    iList = arguments.iterator();
+
+        while ( iList.hasNext() ) {
+            aResults.append( (String) iList.next() );
+            aResults.append( "<br />" );
+        }
+
+        return new SimpleScalar( aResults.toString() );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel3.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel3.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel3.java
new file mode 100644
index 0000000..b84150c
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel3.java
@@ -0,0 +1,69 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+
+/**
+ * Testcase to see how FreeMarker deals with multiple Template models.
+ */
+public class MultiModel3 implements TemplateScalarModel, TemplateHashModel {
+
+    /**
+     * Returns the scalar's value as a String.
+     *
+     * @return the String value of this scalar.
+     */
+    @Override
+    public String getAsString() {
+        return "Model3 is alive!";
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        if ( key.equals( "selftest" )) {
+            return new SimpleScalar( "Selftest from MultiModel3!" );
+        } else if ( key.equals( "message" )) {
+            return new SimpleScalar( "Hello world from MultiModel3!" );
+        } else {
+            return null;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel4.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel4.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel4.java
new file mode 100644
index 0000000..a5fb8e5
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel4.java
@@ -0,0 +1,77 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Testcase to see how FreeMarker deals with multiple Template models.
+ */
+public class MultiModel4 implements TemplateSequenceModel, TemplateHashModel {
+
+    private final SimpleSequence m_cList;
+
+    public MultiModel4(ObjectWrapper ow) {
+        this.m_cList = new SimpleSequence(ow);
+    }
+
+    /**
+     * @return the specified index in the list
+     */
+    @Override
+    public TemplateModel get(int i) throws TemplateModelException {
+        return m_cList.get( i );
+    }
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        if ( key.equals( "size" )) {
+            return new SimpleScalar( "Key size, not the listSize method." );
+        } else {
+            return null;
+        }
+    }
+
+
+    @Override
+    public int size() {
+        return m_cList.size();
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return size() == 0;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel5.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel5.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel5.java
new file mode 100644
index 0000000..f08fb8c
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/MultiModel5.java
@@ -0,0 +1,81 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Testcase to see how FreeMarker deals with multiple Template models.
+ */
+public class MultiModel5 implements TemplateSequenceModel, TemplateHashModel {
+
+    private final SimpleSequence m_cList;
+
+    /** Creates new MultiModel5 */
+    public MultiModel5(ObjectWrapper ow) {
+        this.m_cList = new SimpleSequence(ow);
+        m_cList.add( new SimpleScalar( "Dummy to make list non-empty" ));
+    }
+
+    /**
+     * @return the specified index in the list
+     */
+    @Override
+    public TemplateModel get(int i) throws TemplateModelException {
+        return m_cList.get( i );
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    @Override
+    public int size() {
+        return m_cList.size();
+    }
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) {
+        if ( key.equals( "empty" )) {
+            return new SimpleScalar( "Dummy hash value, for test purposes." );
+        } else {
+            return null;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel.java
new file mode 100644
index 0000000..98ba89f
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel.java
@@ -0,0 +1,52 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+/**
+ * Testcase to see how FreeMarker's ?new built-in deals with constructors.
+ */
+public class NewTestModel
+implements
+    TemplateScalarModel {
+    private final String string;
+    
+    public NewTestModel() {
+        string = "default constructor";
+    }
+
+    public NewTestModel(String str) {
+        string = str;
+    }
+
+    public NewTestModel(long i) {
+        string = Long.toString(i);
+    }
+
+    public NewTestModel(Object o1, java.io.Serializable o2) {
+        string = o1 + ":" + o2;
+    }
+
+    @Override
+    public String getAsString() {
+        return string;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel2.java
new file mode 100644
index 0000000..f715d5c
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NewTestModel2.java
@@ -0,0 +1,52 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+/**
+ * Testcase to see how FreeMarker's ?new built-in deals with constructors.
+ */
+public class NewTestModel2
+implements
+    TemplateScalarModel {
+    private final String string;
+    
+    public NewTestModel2() {
+        string = "default constructor";
+    }
+
+    public NewTestModel2(String str) {
+        string = str;
+    }
+
+    public NewTestModel2(long i) {
+        string = Long.toString(i);
+    }
+
+    public NewTestModel2(Object o1, java.io.Serializable o2) {
+        string = o1 + ":" + o2;
+    }
+
+    @Override
+    public String getAsString() {
+        return string;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NumberAndStringModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NumberAndStringModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NumberAndStringModel.java
new file mode 100644
index 0000000..cc4eec1
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/NumberAndStringModel.java
@@ -0,0 +1,47 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateNumberModel;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+public class NumberAndStringModel implements TemplateNumberModel,
+		TemplateScalarModel {
+	
+	private final String s;
+	
+	public NumberAndStringModel(String s) {
+		super();
+		this.s = s;
+	}
+
+	@Override
+    public String getAsString() throws TemplateModelException {
+		return s;
+	}
+
+	@Override
+    @SuppressWarnings("boxing")
+    public Number getAsNumber() throws TemplateModelException {
+		return s.length();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedConstructor.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedConstructor.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedConstructor.java
new file mode 100644
index 0000000..f8da268
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedConstructor.java
@@ -0,0 +1,46 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+public class OverloadedConstructor implements TemplateScalarModel {
+    
+    String value;
+    
+    public OverloadedConstructor(int i) {
+        value = "int " + i;
+    }
+    
+    public OverloadedConstructor(String s) {
+        value = "String " + s;
+    }
+
+    public OverloadedConstructor(CharSequence s) {
+        value = "CharSequence " + s;
+    }
+    
+    @Override
+    public String getAsString() throws TemplateModelException {
+        return value;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods.java
new file mode 100644
index 0000000..4eac8cc
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods.java
@@ -0,0 +1,191 @@
+/*
+ * 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.templatesuite.models;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.freemarker.core.util.FTLUtil;
+
+/**
+ * For testing overloaded method selection.
+ */
+public class OverloadedMethods {
+
+	public String oneArg(Object a1) {
+		return methodCallToStr("oneArg<Object>", a1);
+	}
+
+	public String oneArg(String a1) {
+		return methodCallToStr("oneArg<String>", a1);
+	}
+
+	public String oneArg(Boolean a1) {
+		return methodCallToStr("oneArg<Boolean>", a1);
+	}
+
+	public String oneArg(boolean a1) {
+		return methodCallToStr("oneArg<boolean>", Boolean.valueOf(a1));
+	}
+	
+	public String oneArg(List a1) {
+		return methodCallToStr("oneArg<List>", a1);
+	}
+
+	public String oneArg(Map a1) {
+		return methodCallToStr("oneArg<Map>", a1);
+	}
+
+    public String oneArg2(Map a1) {
+        return methodCallToStr("oneArg2<Map>", a1);
+    }
+
+    public String oneArg2(List a1) {
+        return methodCallToStr("oneArg2<List>", a1);
+    }
+    
+    public String oneArg3(List a1, List a2) {
+        return methodCallToStr("oneArg3<List, List>", a1, a2);
+    }
+
+    public String oneArg3(List a1) {
+        return methodCallToStr("oneArg3<List>", a1);
+    }
+    
+    public String oneArg4(Integer a1) {
+        return methodCallToStr("oneArg4<Integer>", a1);
+    }
+
+    public String oneArg4(int a1) {
+        return methodCallToStr("oneArg4<int>", Integer.valueOf(a1));
+    }
+
+    public String notOverloaded(List a1) {
+        return methodCallToStr("notOverloaded<List>", a1);
+    }
+    
+	public String varargsIssue1(Map a1, List a2) {
+	    return methodCallToStr("varargsIssue1<Map, List>", a1, a2);
+	}
+
+    public String varargsIssue1(Object... a1) {
+        return methodCallToStr("varargsIssue1<Object...>", a1);
+    }
+
+    public String varargsIssue2(String a1, List a2) {
+        return methodCallToStr("varargsIssue2<String, List>", a1, a2);
+    }
+
+    public String varargsIssue2(String a1, Map a2) {
+        return methodCallToStr("varargsIssue2<String, Map>", a1, a2);
+    }
+
+    public String varargsIssue2(Object... a1) {
+        return methodCallToStr("varargsIssue2<Object...>", a1);
+    }
+    
+    public String numberIssue1(int a1) {
+        return methodCallToStr("numberIssue1<int>", a1);
+    }
+    
+    public String numberIssue1(float a1) {
+        return methodCallToStr("numberIssue1<float>", a1);
+    }
+    
+    public String numberIssue2(int a1) {
+        return methodCallToStr("numberIssue2<int>", a1);
+    }
+    
+    public String numberIssue2(BigDecimal a1) {
+        return methodCallToStr("numberIssue2<BigDecimal>", a1);
+    }
+
+    public String numberIssue3(int a1) {
+        return methodCallToStr("numberIssue3<int>", a1);
+    }
+    
+    public String numberIssue3(double a1) {
+        return methodCallToStr("numberIssue3<double>", a1);
+    }
+    
+	private String methodCallToStr(String methodName, Object... args) {
+		StringBuilder sb = new StringBuilder();
+		
+		sb.append(methodName);
+		sb.append('(');
+		boolean hadItems = false;
+		for (Object arg : args) {
+			if (hadItems) sb.append(", ");
+			sb.append(valueToStr(arg));
+			hadItems = true;
+		}
+		sb.append(')');
+		
+		return sb.toString();
+	}
+	
+	private String valueToStr(Object value) {
+		if (value == null) {
+		    return "null";
+		} else if (value instanceof Character) {
+			return "'" + FTLUtil.escapeStringLiteralPart(value.toString()) + "'";
+		} else if (value instanceof String) {
+			return "\"" + FTLUtil.escapeStringLiteralPart((String) value) + "\"";
+		} else if (value instanceof Map) {
+			StringBuilder sb = new StringBuilder(); 
+			sb.append("{");
+			boolean hadItems = false;
+			for (Map.Entry<?, ?> ent : ((Map<?, ?>) value).entrySet()) {
+				if (hadItems) sb.append(", ");
+				sb.append(valueToStr(ent.getKey()));
+				sb.append(": ");
+				sb.append(valueToStr(ent.getValue()));
+				hadItems = true;
+			}
+			sb.append("}");
+			return sb.toString();
+		} else if (value instanceof Collection || value.getClass().isArray()) {
+			StringBuilder sb = new StringBuilder();
+			
+	        if (value.getClass().isArray()) {
+	            value = Arrays.asList(value);
+                sb.append("array");
+	        } else if (value instanceof Set) {
+				sb.append("set");
+			}
+			sb.append("[");
+			boolean hadItems = false;
+			for (Object i : (Collection) value) {
+				if (hadItems) sb.append(", ");
+				sb.append(i);
+				hadItems = true;
+			}
+			sb.append("]");
+			return sb.toString();
+		} else {
+			return value.toString(); 
+		}
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/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
new file mode 100644
index 0000000..e9084c9
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/OverloadedMethods2.java
@@ -0,0 +1,1110 @@
+/*
+ * 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.templatesuite.models;
+
+import java.io.File;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.freemarker.core.Environment;
+import org.apache.freemarker.core.model.AdapterTemplateModel;
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateModel;
+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;
+
+public class OverloadedMethods2 {
+
+    public String mVarargs(String... a1) {
+        StringBuilder sb = new StringBuilder();
+        for (String s : a1) {
+            sb.append(s);
+        }
+        return "mVarargs(String... a1 = " + sb + ")";
+    }
+    
+    public BigInteger bigInteger(BigDecimal n) {
+        return n.toBigInteger();
+    }
+
+    public RationalNumber rational(int a, int b) {
+        return new RationalNumber(a, b);
+    }
+    
+    public String mVarargs(File a1, String... a2) {
+        return "mVarargs(File a1, String... a2)";
+    }
+
+    public NumberAndStringModel getNnS(String s) {
+        return new NumberAndStringModel(s);
+    }
+    
+    public String mNull1(String a1) {
+        return "mNull1(String a1 = " + a1 + ")";
+    }
+
+    public String mNull1(int a1) {
+        return "mNull1(int a1 = " + a1 + ")";
+    }
+    
+    public String mNull2(String a1) {
+        return "mNull2(String a1 = " + a1 + ")";
+    }
+    
+    public String mNull2(Object a1) {
+        return "mNull2(Object a1 = " + a1 + ")";
+    }
+    
+    public String mSpecificity(Object a1, String a2) {
+        return "mSpecificity(Object a1, String a2)";
+    }
+    
+    public String mSpecificity(String a1, Object a2) {
+        return "mSpecificity(String a1, Object a2)";
+    }
+    
+    public String mChar(char a1) {
+        return "mChar(char a1 = " + a1 + ")";
+    }
+    
+    public String mChar(Character a1) {
+        return "mChar(Character a1 = " + a1 + ")";
+    }
+    
+    public String mBoolean(boolean a1) {
+        return "mBoolean(boolean a1 = " + a1 + ")";
+    }
+    
+    public String mBoolean(Boolean a1) {
+        return "mBoolean(Boolean a1 = " + a1 + ")";
+    }
+
+    public int mIntNonOverloaded(int a1) {
+        return a1;
+    }
+
+    public String mIntPrimVSBoxed(int a1) {
+        return "mIntPrimVSBoxed(int a1 = " + a1 + ")";
+    }
+    
+    public String mIntPrimVSBoxed(Integer a1) {
+        return "mIntPrimVSBoxed(Integer a1 = " + a1 + ")";
+    }
+
+    public String mNumPrimVSPrim(short a1) {
+        return "mNumPrimVSPrim(short a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimVSPrim(long a1) {
+        return "mNumPrimVSPrim(long a1 = " + a1 + ")";
+    }
+
+    public String mNumBoxedVSBoxed(Short a1) {
+        return "mNumBoxedVSBoxed(Short a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedVSBoxed(Long a1) {
+        return "mNumBoxedVSBoxed(Long a1 = " + a1 + ")";
+    }
+
+    public String mNumUnambigous(Short a1, boolean otherOverload) {
+        return "mmNumUnambigous won't be called";
+    }
+    
+    public String mNumUnambigous(Integer a1) {
+        return "mNumUnambigous(Integer a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(Byte a1) {
+        return "mNumBoxedAll(Byte a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(Short a1) {
+        return "mNumBoxedAll(Short a1 = " + a1 + ")";
+    }
+
+    public String mNumBoxedAll(Integer a1) {
+        return "mNumBoxedAll(Integer a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(Long a1) {
+        return "mNumBoxedAll(Long a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(Float a1) {
+        return "mNumBoxedAll(Float a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(Double a1) {
+        return "mNumBoxedAll(Double a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(BigInteger a1) {
+        return "mNumBoxedAll(BigInteger a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll(BigDecimal a1) {
+        return "mNumBoxedAll(BigDecimal a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(byte a1) {
+        return "mNumPrimAll(byte a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(short a1) {
+        return "mNumPrimAll(short a1 = " + a1 + ")";
+    }
+
+    public String mNumPrimAll(int a1) {
+        return "mNumPrimAll(int a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(long a1) {
+        return "mNumPrimAll(long a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(float a1) {
+        return "mNumPrimAll(float a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(double a1) {
+        return "mNumPrimAll(double a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(BigInteger a1) {
+        return "mNumPrimAll(BigInteger a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll(BigDecimal a1) {
+        return "mNumPrimAll(BigDecimal a1 = " + a1 + ")";
+    }
+
+    
+    public String mNumBoxedAll2nd(Short a1) {
+        return "mNumBoxedAll2nd(Short a1 = " + a1 + ")";
+    }
+
+    public String mNumBoxedAll2nd(Long a1) {
+        return "mNumBoxedAll2nd(Long a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedAll2nd(Double a1) {
+        return "mNumBoxedAll2nd(Double a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll2nd(short a1) {
+        return "mNumPrimAll2nd(short a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll2nd(long a1) {
+        return "mNumPrimAll2nd(long a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimAll2nd(double a1) {
+        return "mNumPrimAll2nd(double a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimFallbackToNumber(long a1) {
+        return "mNumPrimFallbackToNumber(long a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimFallbackToNumber(Number a1) {
+        return "mNumPrimFallbackToNumber(Number a1 = " + a1 + ")";
+    }
+    
+    public String mNumPrimFallbackToNumber(Object a1) {
+        return "mNumPrimFallbackToNumber(Object a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedFallbackToNumber(Long a1) {
+        return "mNumBoxedFallbackToNumber(Long a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedFallbackToNumber(Number a1) {
+        return "mNumBoxedFallbackToNumber(Number a1 = " + a1 + ")";
+    }
+    
+    public String mNumBoxedFallbackToNumber(Object a1) {
+        return "mNumBoxedFallbackToNumber(Object a1 = " + a1 + ")";
+    }
+
+    public String mDecimalLoss(int a1) {
+        return "mDecimalLoss(int a1 = " + a1 + ")";
+    }
+        
+    public String mDecimalLoss(double a1) {
+        return "mDecimalLoss(double a1 = " + a1 + ")";
+    }
+    
+    public String mNumConversionLoses1(byte i, Object o1, Object o2) {
+        return "byte " + i;
+    }
+    
+    public String mNumConversionLoses1(double i, Object o1, Object o2) {
+        return "double " + i;
+    }
+
+    public String mNumConversionLoses1(Number i, String o1, String o2) {
+        return "Number " + i + " " + i.getClass().getName();
+    }
+
+    public String mNumConversionLoses2(int i, Object o1, Object o2) {
+        return "int " + i;
+    }
+
+    public String mNumConversionLoses2(long i, Object o1, Object o2) {
+        return "long " + i;
+    }
+
+    public String mNumConversionLoses2(Number i, String o1, String o2) {
+        return "Number " + i + " " + i.getClass().getName();
+    }
+
+    public String mNumConversionLoses3(int i, Object o1, Object o2) {
+        return "int " + i;
+    }
+
+    public String mNumConversionLoses3(Serializable i, String o1, String o2) {
+        return "Serializable " + i + " " + i.getClass().getName();
+    }
+    
+    public String nIntAndLong(int i) {
+        return "nIntAndLong(int " + i + ")";
+    }
+    
+    public String nIntAndLong(long i) {
+        return "nIntAndLong(long " + i + ")";
+    }
+
+    public String nIntAndShort(int i) {
+        return "nIntAndShort(int " + i + ")";
+    }
+    
+    public String nIntAndShort(short i) {
+        return "nIntAndShort(short " + i + ")";
+    }
+
+    public String nLongAndShort(long i) {
+        return "nLongAndShort(long " + i + ")";
+    }
+    
+    public String nLongAndShort(short i) {
+        return "nLongAndShort(short " + i + ")";
+    }
+
+    public String varargs1(String s, int... xs) {
+        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs1(String s, double... xs) {
+        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", double... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs1(String s, Object... xs) {
+        return "varargs1(String s = " + _StringUtil.jQuote(s) + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs1(Object s, Object... xs) {
+        return "varargs1(Object s = " + s + ", Object... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs2(int... xs) {
+        return "varargs2(int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs2(double... xs) {
+        return "varargs2(double... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs3(String... xs) {
+        return "varargs3(String... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs3(Comparable... xs) {
+        return "varargs3(Comparable... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs3(Object... xs) {
+        return "varargs3(Object... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs4(Integer... xs) {
+        return "varargs4(Integer... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs4(int... xs) {
+        return "varargs4(int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+
+    public String varargs5(int... xs) {
+        return "varargs5(int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs5(int a1, int... xs) {
+        return "varargs5(int a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs5(int a1, int a2, int... xs) {
+        return "varargs5(int a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.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) + ")";
+    }
+
+    public String varargs6(String a1, int... xs) {
+        return "varargs6(String a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs6(Object a1, int a2, int... xs) {
+        return "varargs6(Object a1 = " + a1 + ", int a2 = " + a2 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs7(int... xs) {
+        return "varargs7(int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String varargs7(short a1, int... xs) {
+        return "varargs7(short a1 = " + a1 + ", int... xs = " + TestUtil.arrayToString(xs) + ")";
+    }
+    
+    public String mNullAmbiguous(String s) {
+        return "mNullAmbiguous(String s = " + s + ")";
+    }
+
+    public String mNullAmbiguous(int i) {
+        return "mNullAmbiguous(int i = " + i + ")";
+    }
+
+    public String mNullAmbiguous(File f) {
+        return "mNullAmbiguous(File f = " + f + ")";
+    }
+    
+    public String mNullAmbiguous2(String s) {
+        return "mNullNonAmbiguous(String s = " + s + ")";
+    }
+
+    public String mNullAmbiguous2(File f) {
+        return "mNullAmbiguous(File f = " + f + ")";
+    }
+
+    public String mNullAmbiguous2(Object o) {
+        return "mNullAmbiguous(Object o = " + o + ")";
+    }
+
+    public String mNullNonAmbiguous(String s) {
+        return "mNullNonAmbiguous(String s = " + s + ")";
+    }
+
+    public String mNullNonAmbiguous(int i) {
+        return "mNullNonAmbiguous(int i = " + i + ")";
+    }
+    
+    public String mVarargsIgnoredTail(int i, double... ds) {
+        return "mVarargsIgnoredTail(int i = " + i + ", double... ds = " + TestUtil.arrayToString(ds) + ")";
+    }
+    
+    public String mVarargsIgnoredTail(int... is) {
+        return "mVarargsIgnoredTail(int... is = " + TestUtil.arrayToString(is) + ")";
+    }
+    
+    public String mLowRankWins(int x, int y, Object o) {
+        return "mLowRankWins(int x = " + x + ", int y = " + y + ", Object o = " + o + ")";
+    }
+
+    public String mLowRankWins(Integer x, Integer y, String s) {
+        return "mLowRankWins(Integer x = " + x + ", Integer y = " + y + ", String s = " + s + ")";
+    }
+    
+    public String mRareWrappings(File f, double d1, Double d2, double d3, boolean b) {
+        return "mRareWrappings(File f = " + f + ", double d1 = " + d1 + ", Double d2 = " + d2
+                + ", double d3 = " + d3 + ", b = " + b + ")";
+    }
+
+    public String mRareWrappings(Object o, double d1, Double d2, Double d3, boolean b) {
+        return "mRareWrappings(Object o = " + o + ", double d1 = " + d1 + ", Double d2 = " + d2
+                + ", double d3 = " + d3 + ", b = " + b + ")";
+    }
+
+    public String mRareWrappings(String s, double d1, Double d2, Double d3, boolean b) {
+        return "mRareWrappings(String s = " + s + ", double d1 = " + d1 + ", Double d2 = " + d2
+                + ", double d3 = " + d3 + ", b = " + b + ")";
+    }
+
+    public String mRareWrappings2(String s) {
+        return "mRareWrappings2(String s = " + s + ")";
+    }
+    
+    public String mRareWrappings2(byte b) {
+        return "mRareWrappings2(byte b = " + b + ")";
+    }
+    
+    public File getFile() {
+        return new File("file");
+    }
+
+    public String mSeqToArrayNonOverloaded(String[] items, String s) {
+        return "mSeqToArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+    }
+    
+    public String mSeqToArrayGoodHint(String[] items, String s) {
+        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+    }
+
+    public String mSeqToArrayGoodHint(String[] items, int i) {
+        return "mSeqToArrayGoodHint(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+    }
+
+    public String mSeqToArrayGoodHint2(String[] items, String s) {
+        return "mSeqToArrayGoodHint2(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+    }
+
+    public String mSeqToArrayGoodHint2(String item) {
+        return "mSeqToArrayGoodHint2(String " + item + ")";
+    }
+    
+    public String mSeqToArrayPoorHint(String[] items, String s) {
+        return "mSeqToArrayPoorHint(String[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+    }
+
+    public String mSeqToArrayPoorHint(String item, int i) {
+        return "mSeqToArrayPoorHint(String " + item + ", int " + i + ")";
+    }
+
+    public String mSeqToArrayPoorHint2(String[] items) {
+        return "mSeqToArrayPoorHint2(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mSeqToArrayPoorHint2(String item) {
+        return "mSeqToArrayPoorHint2(String " + item + ")";
+    }
+    
+    public String mSeqToArrayPoorHint3(String[] items) {
+        return "mSeqToArrayPoorHint3(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mSeqToArrayPoorHint3(int[] items) {
+        return "mSeqToArrayPoorHint3(int[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVsListPreference(String[] items) {
+        return "mStringArrayVsListPreference(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVsListPreference(List items) {
+        return "mStringArrayVsListPreference(List " + TestUtil.listToString(items) + ")";
+    }
+
+    public String mStringArrayVsObjectArrayPreference(String[] items) {
+        return "mStringArrayVsObjectArrayPreference(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVsObjectArrayPreference(Object[] items) {
+        return "mStringArrayVsObjectArrayPreference(Object[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mIntArrayVsIntegerArrayPreference(int[] items) {
+        return "mIntArrayVsIntegerArrayPreference(int[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mIntArrayVsIntegerArrayPreference(Integer[] items) {
+        return "mIntArrayVsIntegerArrayPreference(Integer[] " + TestUtil.arrayToString(items) + ")";
+    }
+    
+    public String mIntArrayNonOverloaded(int[] items) {
+        return "mIntArrayNonOverloaded(int[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mIntegerArrayNonOverloaded(Integer[] items) {
+        return "mIntegerArrayNonOverloaded(Integer[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mIntegerListNonOverloaded(List<Integer> items) {
+        return "mIntegerListNonOverloaded(List<Integer> " + items + ")";
+    }
+
+    public String mStringListNonOverloaded(List<String> items) {
+        return "mStringListNonOverloaded(List<String> " + items + ")";
+    }
+
+    public String mStringArrayNonOverloaded(String[] items) {
+        return "mStringArrayNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mObjectListNonOverloaded(List<Object> items) {
+        return "mObjectListNonOverloaded(List<Object> " + items + ")";
+    }
+
+    public String mObjectArrayNonOverloaded(Object[] items) {
+        return "mObjectArrayNonOverloaded(Object[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mIntegerArrayOverloaded(Integer[] items, int i) {
+        return "mIntegerArrayOverloaded(Integer[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+    }
+
+    public String mIntegerArrayOverloaded(Object obj, boolean b) {
+        return "mIntegerArrayOverloaded(Object " + obj + ", boolean " + b + ")";
+    }
+
+    public String mStringArrayOverloaded(String[] items, int i) {
+        return "mStringArrayOverloaded(String[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+    }
+
+    public String mStringArrayOverloaded(Object obj, boolean b) {
+        return "mStringArrayOverloaded(Object " + obj + ", boolean " + b + ")";
+    }
+
+    public String mCharArrayOverloaded(char[] items, int i) {
+        return "mCharArrayOverloaded(char[] " + TestUtil.arrayToString(items) + ", int " + i + ")";
+    }
+
+    public String mCharArrayOverloaded(Character[] items, String s) {
+        return "mCharArrayOverloaded(Character[] " + TestUtil.arrayToString(items) + ", String " + s + ")";
+    }
+    
+    public String mCharArrayOverloaded(Object obj, boolean b) {
+        return "mCharArrayOverloaded(Object " + obj + ", boolean " + b + ")";
+    }
+
+    public String mStringArrayArrayOverloaded(String[][] arrayArray, int i) {
+        return "mStringArrayArrayOverloaded(String[][] " + TestUtil.arrayToString(arrayArray) + ", int " + i + ")";
+    }
+    
+    public String mStringArrayArrayOverloaded(Object obj, boolean b) {
+        return "mStringArrayArrayOverloaded(Object " + obj + ", boolean " + b + ")";
+    }
+    
+    public String mIntArrayArrayOverloaded(int[][] xss) {
+        return "mIntArrayArrayOverloaded(" + TestUtil.arrayToString(xss) + ")";
+    }
+
+    public String mIntArrayArrayOverloaded(String s) {
+        return "mIntArrayArrayOverloaded(" + s + ")";
+    }
+    
+    public String mArrayOfListsOverloaded(List[] xss) {
+        return "mArrayOfListsOverloaded(" + TestUtil.arrayToString(xss) + ")";
+    }
+
+    public String mArrayOfListsOverloaded(String x) {
+        return "mArrayOfListsOverloaded(" + x + ")";
+    }
+    
+    public String mIntArrayArrayNonOverloaded(int[][] xss) {
+        return "mIntArrayArrayNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
+    }
+
+    public String mArrayOfListsNonOverloaded(List[] xss) {
+        return "mArrayOfListsNonOverloaded(" + TestUtil.arrayToString(xss) + ")";
+    }
+    
+    public String mStringArrayVarargsNonOverloaded(String... items) {
+        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded(String... items) {
+        return "mStringArrayVarargsNonOverloaded(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded1(String... items) {
+        return "mStringArrayVarargsOverloaded1(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded1(List<String> items) {
+        return "mStringArrayVarargsOverloaded1(List " + TestUtil.listToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded2(String... items) {
+        return "mStringArrayVarargsOverloaded2(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded2(String item) {
+        return "mStringArrayVarargsOverloaded2(String " + item + ")";
+    }
+    
+    public String mStringArrayVarargsOverloaded3(String... items) {
+        return "mStringArrayVarargsOverloaded3(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded3(String item1, String item2) {
+        return "mStringArrayVarargsOverloaded3(String " + item1 + ", String " + item2 + ")";
+    }
+    
+    public String mStringArrayVarargsOverloaded4(String... items) {
+        return "mStringArrayVarargsOverloaded4(String[] " + TestUtil.arrayToString(items) + ")";
+    }
+
+    public String mStringArrayVarargsOverloaded4(List... items) {
+        return "mStringArrayVarargsOverloaded4(List[] " + TestUtil.arrayToString(items) + ")";
+    }
+    
+    public String mListOrString(List<String> items) {
+        return "mListOrString(List " + TestUtil.listToString(items) + ")";
+    }
+
+    public String mListOrString(String item) {
+        return "mListOrString(String " + item + ")";
+    }
+
+    public String mListListOrString(List<List<Object>> items) {
+        return "mListListOrString(List " + TestUtil.listToString(items) + ")";
+    }
+
+    public String mListListOrString(String item) {
+        return "mListListOrString(String " + item + ")";
+    }
+    
+    public String mMapOrBoolean(Map v) {
+        return "mMapOrBoolean(Map " + v + ")";
+    }
+
+    public String mMapOrBoolean(boolean v) {
+        return "mMapOrBoolean(boolean " + v + ")";
+    }
+
+    public String mMapOrBooleanVarargs(Map... v) {
+        return "mMapOrBooleanVarargs(Map... " + TestUtil.arrayToString(v) + ")";
+    }
+
+    public String mMapOrBooleanVarargs(boolean... v) {
+        return "mMapOrBooleanVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
+    }
+
+    public String mMapOrBooleanFixedAndVarargs(Map v) {
+        return "mMapOrBooleanFixedAndVarargs(Map " + v + ")";
+    }
+
+    public String mMapOrBooleanFixedAndVarargs(boolean v) {
+        return "mMapOrBooleanFixedAndVarargs(boolean " + v + ")";
+    }
+
+    public String mMapOrBooleanFixedAndVarargs(Map... v) {
+        return "mMapOrBooleanFixedAndVarargs(Map... " + TestUtil.arrayToString(v) + ")";
+    }
+
+    public String mMapOrBooleanFixedAndVarargs(boolean... v) {
+        return "mMapOrBooleanFixedAndVarargs(boolean... " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mNumberOrArray(Number v) {
+        return "mNumberOrArray(Number " + v + ")";
+    }
+
+    public String mNumberOrArray(Object[] v) {
+        return "mNumberOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mIntOrArray(int v) {
+        return "mIntOrArray(int " + v + ")";
+    }
+
+    public String mIntOrArray(Object[] v) {
+        return "mIntOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+
+    public String mDateOrArray(Date v) {
+        return "mDateOrArray(Date " + v.getTime() + ")";
+    }
+
+    public String mDateOrArray(Object[] v) {
+        return "mDateOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mStringOrArray(String v) {
+        return "mStringOrArray(String " + v + ")";
+    }
+
+    public String mStringOrArray(Object[] v) {
+        return "mStringOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mBooleanOrArray(boolean v) {
+        return "mBooleanOrArray(boolean " + v + ")";
+    }
+
+    public String mBooleanOrArray(Object[] v) {
+        return "mBooleanOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mMapOrArray(Map v) {
+        return "mMapOrArray(Map " + v + ")";
+    }
+
+    public String mMapOrArray(Object[] v) {
+        return "mMapOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mListOrArray(List v) {
+        return "mListOrArray(List " + v + ")";
+    }
+
+    public String mListOrArray(Object[] v) {
+        return "mListOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mSetOrArray(Set v) {
+        return "mSetOrArray(Set " + v + ")";
+    }
+
+    public String mSetOrArray(Object[] v) {
+        return "mSetOrArray(Object[] " + TestUtil.arrayToString(v) + ")";
+    }
+    
+    public String mCharNonOverloaded(char c) {
+        return "mCharNonOverloaded(char " + c + ")";
+    }
+
+    public String mCharacterNonOverloaded(Character c) {
+        return "mCharacterNonOverloaded(Character " + c + ")";
+    }
+    
+    public String mCharOrCharacterOverloaded(char c) {
+        return "mCharOrCharacterOverloaded(char " + c + ")";
+    }
+
+    public String mCharOrCharacterOverloaded(Character c) {
+        return "mCharOrCharacterOverloaded(Character " + c + ")";
+    }
+
+    public String mCharOrBooleanOverloaded(char c) {
+        return "mCharOrBooleanOverloaded(char " + c + ")";
+    }
+
+    public String mCharOrBooleanOverloaded(boolean b) {
+        return "mCharOrBooleanOverloaded(boolean " + b + ")";
+    }
+
+    public String mCharOrStringOverloaded(char c, boolean b) {
+        return "mCharOrStringOverloaded(char " + c + ", boolean " + b + ")";
+    }
+
+    public String mCharOrStringOverloaded(String s, int i) {
+        return "mCharOrStringOverloaded(String " + s + ", int " + i + ")";
+    }
+
+    public String mCharacterOrStringOverloaded(Character c, boolean b) {
+        return "mCharacterOrStringOverloaded(Character " + c + ", boolean " + b + ")";
+    }
+
+    public String mCharacterOrStringOverloaded(String s, int i) {
+        return "mCharacterOrStringOverloaded(String " + s + ", int " + i + ")";
+    }
+    
+    public String mCharOrStringOverloaded2(String s) {
+        return "mCharOrStringOverloaded2(String " + s + ")";
+    }
+
+    public String mCharOrStringOverloaded2(char c) {
+        return "mCharOrStringOverloaded2(char " + c + ")";
+    }
+    
+    public String mCharacterOrStringOverloaded2(String s) {
+        return "mCharacterOrStringOverloaded2(String " + s + ")";
+    }
+
+    public String mCharacterOrStringOverloaded2(Character c) {
+        return "mCharacterOrStringOverloaded2(Character " + c + ")";
+    }
+    
+
+    public String getJavaString() {
+        return "s";
+    }
+    
+    public List getJavaStringList() {
+        List list = new ArrayList();
+        list.add("a");
+        list.add("b");
+        return list;
+    }
+
+    public List getJavaString2List() {
+        List list = new ArrayList();
+        list.add("aa");
+        list.add("bb");
+        return list;
+    }
+
+    public List getJavaStringListList() {
+        List listList = new ArrayList();
+        {
+            List list = new ArrayList();
+            list.add("a");
+            list.add("b");
+            
+            listList.add(list);
+        }
+        {
+            List list = new ArrayList();
+            list.add("c");
+            
+            listList.add(list);
+        }
+        return listList;
+    }
+
+    public List getJavaStringSequenceList() throws TemplateModelException {
+        ObjectWrapper ow = Environment.getCurrentEnvironment().getObjectWrapper();
+        
+        List listList = new ArrayList();
+        {
+            List list = new ArrayList();
+            list.add("a");
+            list.add("b");
+            
+            listList.add(ow.wrap(list));
+        }
+        {
+            List list = new ArrayList();
+            list.add("c");
+            
+            listList.add(ow.wrap(list));
+        }
+        return listList;
+    }
+    
+    public List<int[]> getJavaListOfIntArrays() {
+        List list = new ArrayList();
+        list.add(new int[] {1, 2, 3});
+        list.add(new int[] {});
+        list.add(new int[] {4});
+        return list;
+    }
+    
+    @SuppressWarnings("boxing")
+    public List getJavaIntegerListList() {
+        List listList = new ArrayList();
+        {
+            List list = new ArrayList();
+            list.add(1);
+            list.add(2);
+            
+            listList.add(list);
+        }
+        {
+            List list = new ArrayList();
+            list.add(3);
+            
+            listList.add(list);
+        }
+        return listList;
+    }
+    
+    @SuppressWarnings("boxing")
+    public List<Integer> getJavaIntegerList() {
+        List<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(2);
+        return list;
+    }
+
+    @SuppressWarnings("boxing")
+    public List<Byte> getJavaByteList() {
+        List<Byte> list = new ArrayList<>();
+        list.add((byte) 1);
+        list.add((byte) 2);
+        return list;
+    }
+
+    @SuppressWarnings("boxing")
+    public List<Character> getJavaCharacterList() {
+        List<Character> list = new ArrayList<>();
+        list.add('c');
+        list.add('C');
+        return list;
+    }
+    
+    public String[] getJavaStringArray() {
+        return new String[] { "a", "b" };
+    }
+
+    public int[] getJavaIntArray() {
+        return new int[] { 11, 22 };
+    }
+
+    public Integer[] getJavaIntegerArray() {
+        return new Integer[] { Integer.valueOf(11), Integer.valueOf(22) };
+    }
+    
+    public String[] getJavaEmptyStringArray() {
+        return new String[] { };
+    }
+    
+    public String[][] getJavaStringArrayArray() {
+        return new String[][] { new String[] { "a", "b" }, new String[] { }, new String[] { "c" } };
+    }
+    
+    public Object[] getJavaObjectArray() {
+        return new Object[] { "a", "b" };
+    }
+    
+    public TemplateModel getHashAndScalarModel() {
+        return HashAndScalarModel.INSTANCE;
+    }
+
+    public TemplateModel getBooleanAndScalarModel() {
+        return BooleanAndScalarModel.INSTANCE;
+    }
+    
+    public TemplateModel getAllModels() {
+        return AllTemplateModels.INSTANCE;
+    }
+
+    public TemplateNumberModel getAdaptedNumber() {
+        return new MyAdapterNumberModel();
+    }
+
+    public TemplateNumberModel getWrapperNumber() {
+        return new MyWrapperNumberModel();
+    }
+
+    public TemplateBooleanModel getStringAdaptedToBoolean() {
+        return new MyStringAdaptedToBooleanModel();
+    }
+    
+    public TemplateBooleanModel getStringAdaptedToBoolean2() {
+        return new MyStringAdaptedToBooleanModel2();
+    }
+    
+    public TemplateBooleanModel getStringWrappedAsBoolean() {
+        return new MyStringWrapperAsBooleanModel();
+    }
+    
+    public TemplateBooleanModel getBooleanWrappedAsAnotherBoolean() {
+        return new MyBooleanWrapperAsAnotherBooleanModel(); 
+    }
+    
+    public String bugReport363(Map<String, ?> fields, List<?> listField) {
+        return "Executed: testMethod(Map fields, List listField) on input: fields=" + fields
+                + " and listField=" + listField;
+    }
+
+    public String bugReport363(Object... fields) {
+        return "Executed: testMethod(Object... fields) on input: fields=" + TestUtil.arrayToString(fields);
+    }
+    
+    private static class MyAdapterNumberModel implements TemplateNumberModel, AdapterTemplateModel {
+
+        @Override
+        public Object getAdaptedObject(Class hint) {
+            if (hint == double.class) {
+                return Double.valueOf(123.0001);
+            } else if (hint == Double.class) {
+                return Double.valueOf(123.0002);
+            } else {
+                return Long.valueOf(124L);
+            }
+        }
+
+        @Override
+        public Number getAsNumber() throws TemplateModelException {
+            return Integer.valueOf(122);
+        }
+        
+    }
+    
+    private static class MyWrapperNumberModel implements TemplateNumberModel, WrapperTemplateModel {
+
+        @Override
+        public Number getAsNumber() throws TemplateModelException {
+            return Integer.valueOf(122);
+        }
+
+        @Override
+        public Object getWrappedObject() {
+            return Double.valueOf(123.0001);
+        }
+        
+    }
+    
+    private static class MyStringWrapperAsBooleanModel implements TemplateBooleanModel, WrapperTemplateModel {
+
+        @Override
+        public Object getWrappedObject() {
+            return "yes";
+        }
+
+        @Override
+        public boolean getAsBoolean() throws TemplateModelException {
+            return true;
+        }
+        
+    }
+
+    private static class MyBooleanWrapperAsAnotherBooleanModel implements TemplateBooleanModel, WrapperTemplateModel {
+
+        @Override
+        public Object getWrappedObject() {
+            return Boolean.TRUE;
+        }
+
+        @Override
+        public boolean getAsBoolean() throws TemplateModelException {
+            return false;
+        }
+        
+    }
+    
+    private static class MyStringAdaptedToBooleanModel implements TemplateBooleanModel, AdapterTemplateModel {
+
+        @Override
+        public Object getAdaptedObject(Class hint) {
+            if (hint != Boolean.class && hint != boolean.class) {
+                return "yes";
+            } else {
+                return Boolean.TRUE;
+            }
+        }
+
+        @Override
+        public boolean getAsBoolean() throws TemplateModelException {
+            return false;
+        }
+        
+    }
+
+    private static class MyStringAdaptedToBooleanModel2 implements TemplateBooleanModel, AdapterTemplateModel {
+
+        @Override
+        public Object getAdaptedObject(Class hint) {
+            return "yes";
+        }
+
+        @Override
+        public boolean getAsBoolean() throws TemplateModelException {
+            return true;
+        }
+        
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
new file mode 100644
index 0000000..7992b1e
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleMapAndCollectionObjectWrapper.java
@@ -0,0 +1,60 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.SimpleHash;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Forces using "simple" models for {@link Map}-s, {@link Collection}-s and arrays. This is mostly useful for template
+ * test cases that wish to test with these models, but otherwise need to able to wrap beans and such. 
+ */
+public class SimpleMapAndCollectionObjectWrapper extends DefaultObjectWrapper {
+
+    public SimpleMapAndCollectionObjectWrapper(Version incompatibleImprovements) {
+        super(new DefaultObjectWrapper.Builder(incompatibleImprovements), true);
+    }
+
+    @Override
+    public TemplateModel wrap(Object obj) throws TemplateModelException {
+        if (obj == null) {
+            return super.wrap(null);
+        }        
+        if (obj.getClass().isArray()) {
+            obj = Arrays.asList((Object[]) obj);
+        }
+        if (obj instanceof Collection) {
+            return new SimpleSequence((Collection<?>) obj, this);
+        }
+        if (obj instanceof Map) {
+            return new SimpleHash((Map<?, ?>) obj, this);
+        }
+        
+        return super.wrap(obj);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleTestMethod.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleTestMethod.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleTestMethod.java
new file mode 100644
index 0000000..21fc5c0
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/SimpleTestMethod.java
@@ -0,0 +1,49 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.List;
+
+import org.apache.freemarker.core.model.TemplateMethodModel;
+import org.apache.freemarker.core.model.impl.SimpleScalar;
+
+/**
+ * A simple method model used as a test bed.
+ */
+public class SimpleTestMethod implements TemplateMethodModel {
+
+    /**
+     * Executes a method call.
+     *
+     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
+     * the values of the arguments passed to the method.
+     * @return the <tt>TemplateModel</tt> produced by the method, or null.
+     */
+    @Override
+    public Object exec(List arguments) {
+        if ( arguments.size() == 0 ) {
+            return new SimpleScalar( "Empty list provided" );
+        } else if ( arguments.size() > 1 ) {
+            return new SimpleScalar( "Argument size is: " + arguments.size() );
+        } else {
+            return new SimpleScalar( "Single argument value is: " + arguments.get(0) );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBean.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBean.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBean.java
new file mode 100644
index 0000000..b963bd7
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBean.java
@@ -0,0 +1,17 @@
+package org.apache.freemarker.core.templatesuite.models;
+
+public class TestBean {
+
+    public int m(int n) {
+        return n * 10;
+    }
+
+    public int mOverloaded(int n) {
+        return n * 10;
+    }
+
+    public String mOverloaded(String s) {
+        return s.toUpperCase();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBoolean.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBoolean.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBoolean.java
new file mode 100644
index 0000000..8339d59
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestBoolean.java
@@ -0,0 +1,16 @@
+package org.apache.freemarker.core.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateBooleanModel;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+
+public class TestBoolean implements TemplateBooleanModel, TemplateScalarModel {
+    @Override
+    public boolean getAsBoolean() {
+        return true;
+    }
+
+    @Override
+    public String getAsString() {
+        return "de";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestMethod.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestMethod.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestMethod.java
new file mode 100644
index 0000000..d9087a3
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestMethod.java
@@ -0,0 +1,12 @@
+package org.apache.freemarker.core.templatesuite.models;
+
+import java.util.List;
+
+import org.apache.freemarker.core.model.TemplateMethodModel;
+
+public class TestMethod implements TemplateMethodModel {
+    @Override
+    public Object exec(List arguments) {
+        return "x";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestNode.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestNode.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestNode.java
new file mode 100644
index 0000000..dfc68c7
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TestNode.java
@@ -0,0 +1,32 @@
+package org.apache.freemarker.core.templatesuite.models;
+
+import org.apache.freemarker.core.model.TemplateNodeModel;
+import org.apache.freemarker.core.model.TemplateSequenceModel;
+
+public class TestNode implements TemplateNodeModel {
+
+    @Override
+    public String getNodeName() {
+        return "name";
+    }
+
+    @Override
+    public TemplateNodeModel getParentNode() {
+        return null;
+    }
+
+    @Override
+    public String getNodeType() {
+        return "element";
+    }
+
+    @Override
+    public TemplateSequenceModel getChildNodes() {
+        return null;
+    }
+
+    @Override
+    public String getNodeNamespace() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformHashWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformHashWrapper.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformHashWrapper.java
new file mode 100644
index 0000000..7771d6d
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformHashWrapper.java
@@ -0,0 +1,79 @@
+/*
+ * 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.templatesuite.models;
+
+import org.apache.freemarker.core.Configuration;
+import org.apache.freemarker.core.model.ObjectWrapper;
+import org.apache.freemarker.core.model.TemplateHashModel;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.SimpleHash;
+import org.apache.freemarker.core.util.HtmlEscape;
+import org.apache.freemarker.core.util.StandardCompress;
+
+/**
+ * Part of the TestTransform testcase suite.
+ */
+public class TransformHashWrapper implements TemplateHashModel,
+        TemplateScalarModel {
+
+    private ObjectWrapper ow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
+    private SimpleHash m_cHashModel = new SimpleHash(ow);
+
+    /** Creates new TransformHashWrapper */
+    public TransformHashWrapper() {
+        m_cHashModel.put( "htmlEscape", new HtmlEscape() );
+        m_cHashModel.put( "compress", new StandardCompress() );
+        m_cHashModel.put( "escape", new TransformMethodWrapper1() );
+        m_cHashModel.put( "special", new TransformMethodWrapper2() );
+    }
+
+    /**
+     * Gets a <tt>TemplateModel</tt> from the hash.
+     *
+     * @param key the name by which the <tt>TemplateModel</tt>
+     * is identified in the template.
+     * @return the <tt>TemplateModel</tt> referred to by the key,
+     * or null if not found.
+     */
+    @Override
+    public TemplateModel get(String key) throws TemplateModelException {
+        return m_cHashModel.get( key );
+    }
+
+    /**
+     * @return true if this object is empty.
+     */
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    /**
+     * Returns the scalar's value as a String.
+     * @return the String value of this scalar.
+     */
+    @Override
+    public String getAsString() {
+        return "Utility transformations";
+    }
+}



[05/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-like.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-like.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-like.ftl
deleted file mode 100644
index a5accaf..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-like.ftl
+++ /dev/null
@@ -1,155 +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.
--->
-<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
-<#setting time_zone="GMT+02">
-<@assertEquals actual=d?string.xs  expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string.iso expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string('xs')  expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string('iso') expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string.xs_nz  expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?string.iso_nz expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?string.xs_fz  expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string.iso_fz expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?string.xs_u  expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?string.iso_u expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?string.xs_s_u  expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?string.iso_s_u expected="2010-05-15T20:38:05Z" />
-
-<@assertEquals actual=d?date?string.xs  expected="2010-05-15+02:00" />
-<@assertEquals actual=d?date?string.iso expected="2010-05-15" />
-<@assertEquals actual=d?date?string.xs_nz  expected="2010-05-15" />
-<@assertEquals actual=d?date?string.iso_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?string.xs_fz  expected="2010-05-15+02:00" />
-<@assertEquals actual=d?date?string.iso_fz expected="2010-05-15" />
-
-<@assertEquals actual=d?time?string.xs  expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?string.iso expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?string.xs_nz  expected="22:38:05.023" />
-<@assertEquals actual=d?time?string.iso_nz expected="22:38:05.023" />
-<@assertEquals actual=d?time?string.xs_fz  expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?string.iso_fz expected="22:38:05.023+02:00" />
-
-<#-- java.sql treatment -->
-<@assertEquals actual=sqlDate?string.xs  expected="2010-05-15" />
-<@assertEquals actual=sqlDate?string.iso expected="2010-05-15" />
-<@assertEquals actual=sqlDate?string.xs_fz  expected="2010-05-15+02:00" />
-<@assertEquals actual=sqlDate?string.iso_fz expected="2010-05-15" />
-<@assertEquals actual=sqlDate?string.xs_nz  expected="2010-05-15" />
-<@assertEquals actual=sqlDate?string.iso_nz expected="2010-05-15" />
-<@assertEquals actual=sqlTime?string.xs  expected="22:38:05.023" />
-<@assertEquals actual=sqlTime?string.iso expected="22:38:05.023" />
-<@assertEquals actual=sqlTime?string.xs_fz  expected="22:38:05.023+02:00" />
-<@assertEquals actual=sqlTime?string.iso_fz expected="22:38:05.023+02:00" />
-<@assertEquals actual=sqlTime?string.xs_nz  expected="22:38:05.023" />
-<@assertEquals actual=sqlTime?string.iso_nz expected="22:38:05.023" />
-
-<#assign d = "12:30:15:1 +0200"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?string.xs  expected="12:30:15.001+02:00" />
-<@assertEquals actual=d?string.iso expected="12:30:15.001+02:00" />
-<@assertEquals actual=d?string.xs_ms  expected="12:30:15.001+02:00" />
-<@assertEquals actual=d?string.iso_ms expected="12:30:15.001+02:00" />
-<@assertEquals actual=d?string.iso_s expected="12:30:15+02:00" />
-<@assertEquals actual=d?string.iso_m expected="12:30+02:00" />
-<@assertEquals actual=d?string.iso_h expected="12+02:00" />
-<#assign d = "12:30:15:10 +0200"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?string.xs  expected="12:30:15.01+02:00" />
-<@assertEquals actual=d?string.iso expected="12:30:15.01+02:00" />
-<@assertEquals actual=d?string.xs_ms  expected="12:30:15.010+02:00" />
-<@assertEquals actual=d?string.iso_ms expected="12:30:15.010+02:00" />
-<#assign d = "12:30:15:100 +0200"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?string.xs  expected="12:30:15.1+02:00" />
-<@assertEquals actual=d?string.iso expected="12:30:15.1+02:00" />
-<@assertEquals actual=d?string.xs_ms  expected="12:30:15.100+02:00" />
-<@assertEquals actual=d?string.iso_ms expected="12:30:15.100+02:00" />
-<#assign d = "12:30:15:0 +0200"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?string.xs  expected="12:30:15+02:00" />
-<@assertEquals actual=d?string.iso expected="12:30:15+02:00" />
-<@assertEquals actual=d?string.xs_ms  expected="12:30:15.000+02:00" />
-<@assertEquals actual=d?string.iso_ms expected="12:30:15.000+02:00" />
-
-<#setting time_zone="GMT+02">
-<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
-<@assertEquals actual=d?string.xs  expected="2010-05-15+02:00" />
-<@assertEquals actual=d?string.iso expected="2010-05-15" />
-<#setting time_zone="GMT+00">
-<@assertEquals actual=d?string.xs  expected="2010-05-14Z" />
-<@assertEquals actual=d?string.iso expected="2010-05-14" />
-
-<#setting time_zone="GMT+02:30">
-<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
-<@assertEquals actual=d?string.xs  expected="2010-05-15T00:00:00+02:30" />
-<@assertEquals actual=d?string.iso expected="2010-05-15T00:00:00+02:30" />
-
-<#setting time_zone="GMT-05">
-<#setting locale = "en_US">
-<#assign d = "BC 0001-05-15"?date("G yyyy-MM-dd")>
-<#-- Tests that: (a) BC 1 isn't 0 like in ISO 8601; (b) No Julian calendar is used.  -->
-<@assertEquals actual=d?string.xs  expected="-1-05-13-05:00" />
-<@assertEquals actual=d?string.iso expected="0000-05-13" />
-
-<#assign dt = "2010-05-15T01:02:03"?datetime.xs>
-<#setting datetime_format="xs">
-<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" />
-<#setting datetime_format="xs u">
-<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
-<#setting datetime_format="iso u">
-<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
-<#setting datetime_format="xs fz">
-<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" />
-<#setting datetime_format="xs fz u">
-<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" />
-<#setting datetime_format="xs nz u">
-<@assertEquals actual=dt?string expected="2010-05-15T06:02:03" />
-<#setting datetime_format="iso m nz">
-<@assertEquals actual=dt?string expected="2010-05-15T01:02" />
-
-<#assign d = dt?date>
-<#setting date_format="xs">
-<@assertEquals actual=d?string expected="2010-05-15-05:00" />
-<#setting date_format="iso">
-<@assertEquals actual=d?string expected="2010-05-15" />
-<#setting date_format="xs fz">
-<@assertEquals actual=d?string expected="2010-05-15-05:00" />
-<#setting date_format="xs fz u">
-<@assertEquals actual=d?string expected="2010-05-15Z" />
-<#setting date_format="iso fz u">
-<@assertEquals actual=d?string expected="2010-05-15" />
-<#setting date_format="xs nz">
-<@assertEquals actual=d?string expected="2010-05-15" />
-
-<#assign t = dt?time>
-<@assertEquals actual=d?string expected="2010-05-15" />
-<#setting time_format="xs">
-<@assertEquals actual=t?string expected="01:02:03-05:00" />
-<#setting time_format="iso_m">
-<@assertEquals actual=t?string expected="01:02-05:00" />
-<#setting time_format="xs fz">
-<@assertEquals actual=t?string expected="01:02:03-05:00" />
-<#setting time_format="xs nz">
-<@assertEquals actual=t?string expected="01:02:03" />
-<#setting time_format="iso nz ms">
-<@assertEquals actual=t?string expected="01:02:03.000" />
-
-<@assertFails message="Use ?date, ?time, or ?datetime">${unknownDate?string.xs}</@>
-<@assertFails message="Use ?date, ?time, or ?datetime">${unknownDate?string.iso}</@>
-<@assertFails message="format string">${.now?string.xs_fz_nz}</@>
-<@assertFails message="format string">${.now?string.xs_u_fu}</@>
-<@assertFails message="format string">${.now?string.xs_s_ms}</@>
-<@assertFails message="format string">${.now?string.xs_q}</@>
-<@assertFails message="format string">${.now?string.xss}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-java.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-java.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-java.ftl
deleted file mode 100644
index 82001db..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-java.ftl
+++ /dev/null
@@ -1,71 +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.
--->
-<#setting locale="en_US">
-<#setting time_zone="GMT">
-<#setting datetime_format="">
-${date}
-${unknownDate?datetime}
-${date?string}
-${date?string[""]}
-${date?string.short}
-${date?string.medium}
-${date?string.long}
-${date?string.short_short}
-${date?string.short_medium}
-${date?string.short_long}
-${date?string.medium_short}
-${date?string.medium_medium}
-${date?string.medium_long}
-${date?string.long_short}
-${date?string.long_medium}
-${date?string.long_long}
-${unknownDate?date}
-${date?date?string[""]}
-${date?date?string.short}
-${date?date?string.medium}
-${date?date?string.long}
-${unknownDate?time}
-${date?time?string[""]}
-${date?time?string.short}
-${date?time?string.medium}
-${date?time?string.long}
-<#setting locale="hu_hu">
-<#setting datetime_format="long_long">
-${date}
-<#setting locale="en_US">
-<#setting datetime_format="EEE, dd MMM yyyyy HH:mm:ss z">
-${date}
-${unknownDate?string["EEE, dd MMM yyyy HH:mm:ss z"]}
-${unknownDate?string("EEE, dd MMM yyyy HH:mm:ss z")}
-${unknownDate?string.yyyy}
-
-<#setting datetime_format="yyyy">
-<#assign s = date?string>
-${s}
-<#setting datetime_format="MM">
-${s}
-
-<#-- Check ?string lazy evaluation bug was fixed: -->
-<#setting datetime_format="yyyy">
-<#assign s = date?string>
-<#-- no ${s} -->
-<#setting datetime_format="MM">
-${s}
-<#assign s = date?string>
-${s}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateparsing.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateparsing.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateparsing.ftl
deleted file mode 100644
index d830f95..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateparsing.ftl
+++ /dev/null
@@ -1,84 +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.
--->
-<#setting locale="en_US">
-<#setting time_zone="GMT">
-<#setting datetime_format="G yyyy-MM-dd HH:mm:ss.S Z">
-<#setting date_format="G yyyy-MM-dd Z">
-<#setting time_format="HH:mm:ss.S Z">
-
-<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000" actual='AD 1998-10-30 19:30:44.512 +0400'?datetime?string />
-<@assertEquals expected="AD 1998-10-29 +0000" actual='AD 1998-10-30 +0400'?date?string />
-<@assertEquals expected="15:30:44.512 +0000" actual='19:30:44.512 +0400'?time?string />
-
-<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000"
-               actual='10/30/1998 19:30:44:512 GMT+04:00'?datetime("MM/dd/yyyy HH:mm:ss:S z")?string />
-<@assertEquals expected="AD 1998-10-29 +0000"
-               actual='10/30/1998 GMT+04:00'?date("MM/dd/yyyy z")?string />
-<@assertEquals expected="15:30:44.512 +0000"
-               actual='19:30:44:512 GMT+04:00'?time("HH:mm:ss:S z")?string />
-
-<@assertEquals expected="AD 1998-10-30 15:30:44.512 +0000" actual='1998-10-30T19:30:44.512+04:00'?datetime.xs?string />
-<@assertEquals expected="AD 1998-10-29 +0000" actual='1998-10-30+04:00'?date.xs?string />
-<@assertEquals expected="15:30:44.512 +0000" actual='19:30:44.512+04:00'?time.xs?string />
-
-<#assign gmtStr='1998-10-30T19:30:44.512'?datetime.xs?string />
-<#setting time_zone="GMT+01:00">
-<#assign gmt01Str='1998-10-30T19:30:44.512'?datetime.xs?string />
-<#setting time_zone="default">
-<#assign defStr='1998-10-30T19:30:44.512'?datetime.xs?string />
-<@assert test = gmtStr != gmt01Str />
-<@assert test = defStr != gmtStr || defStr != gmt01Str />
-
-<#assign refDate = "AD 1998-10-30 +0000"?date>
-<#assign refTime = "15:30:44.512 +0000"?time>
-<#assign refDateTime = "AD 1998-10-30 15:30:44.512 +0000"?datetime>
-<#setting time_zone="UTC">
-<#list ['xs', 'xs_nz', 'xs_fz', 'xs s', 'xs ms'] as format>
-  <#setting date_format=format>
-  <#setting time_format=format>
-  <#setting datetime_format=format>
-  <@assertEquals expected=refDate actual="1998-10-30Z"?date />
-  <@assertEquals expected=refTime actual="15:30:44.512Z"?time />
-  <@assertEquals expected=refDateTime actual="1998-10-30T15:30:44.512Z"?datetime />
-</#list>
-<#list ['iso', 'iso_nz', 'iso_fz', 'iso m'] as format>
-  <#setting date_format=format>
-  <#setting time_format=format>
-  <#setting datetime_format=format>
-  <@assertEquals expected=refDate actual="1998-10-30"?date />
-  <@assertEquals expected=refDate actual="19981030"?date />
-  <@assertEquals expected=refTime actual="15:30:44,512Z"?time />
-  <@assertEquals expected=refTime actual="153044,512Z"?time />
-  <@assertEquals expected=refDateTime actual="1998-10-30T15:30:44,512Z"?datetime />
-  <@assertEquals expected=refDateTime actual="19981030T153044,512Z"?datetime />
-</#list>
-
-<#setting time_zone="GMT+01:00">
-<#assign refDateTime='1998-10-30T19:30:44.512'?datetime.xs />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512"?datetime.xs />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512"?datetime.iso />
-<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.xs_u />
-<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.iso_u />
-<#setting time_zone="UTC">
-<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.xs />
-<@assertEquals expected=refDateTime actual="1998-10-30T18:30:44.512"?datetime.iso />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01:00"?datetime.xs />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01:00"?datetime.xs_u />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01"?datetime.iso />
-<@assertEquals expected=refDateTime actual="1998-10-30T19:30:44.512+01"?datetime.iso_u />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-object-wrapper.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-object-wrapper.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-object-wrapper.ftl
deleted file mode 100644
index bcf903d..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-object-wrapper.ftl
+++ /dev/null
@@ -1,59 +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.
--->
-<#list array as item>
-${item}
-</#list>
-${array?size}
-${array[0]}
-${array[1]}
-<#list list as item>
-${item}
-</#list>
-${list?size}
-${list?hasContent?then('not empty', 'empty')}
-${list[0]}
-${map.key}
-${map?api.get(objKey)}
-${obj.foo}
-<#if obj.foo?exists>hasfoo<#else>nofoo</#if>
-<#if obj.baz?exists>hasbaz<#else>nobaz</#if>
-${obj.bar[0]}
-${obj.getFoo()}
-${obj.overloaded(1?int)}
-${obj.overloaded("String")}
-${resourceBundle.message}
-${resourceBundle("format", date)}
-<#assign static = statics["org.apache.freemarker.test.templatesuite.models.BeanTestClass"]>
-${static.staticMethod()}
-${static.staticOverloaded(1)}
-${static.staticOverloaded("String")}
-${static.STATIC_FINAL_FIELD}
-${static.STATIC_FIELD}
-<#assign enum = enums["org.apache.freemarker.test.templatesuite.models.EnumTestClass"]>
-${enum.ONE}
-${enum.TWO}
-${enum.THREE}
-${(enum.ONE == enum.ONE)?string("true", "false")}
-${(enum.ONE == enum.TWO)?string("true", "false")}
-${enums["org.apache.freemarker.test.templatesuite.models.BeanTestClass"]?exists?string("true", "false")}
-${obj.something}
-${obj.publicInner.x}
-${obj.publicInner.m()}
-<@assertFails message="obj.privateInner.x">${obj.privateInner.x}</@>
-<@assertFails message="obj.privateInner.m">${obj.privateInner.m()}</@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-xmlns.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-xmlns.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-xmlns.ftl
deleted file mode 100644
index 4f01835..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default-xmlns.ftl
+++ /dev/null
@@ -1,28 +0,0 @@
-<#ftl ns_prefixes={"D" : "http://x.com", "y" : "http://y.com"}>
-<#--
-  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.
--->
-<#assign r = doc.*[0]>
-${r["N:t1"]?default('-')} = No NS
-${r["t2"]?default('-')} = x NS
-${r["y:t3"]?default('-')} = y NS
-${r["./D:t4"]?default('-')} = x NS
-
-<#assign bool = doc["true()"]>
-${bool?string}
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default.ftl
deleted file mode 100644
index 6ecf8b3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/default.ftl
+++ /dev/null
@@ -1,34 +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.
--->
-${UNDEFINED!"foo"}
-
-<#assign duck = (FOO.BAR)!"luck">
-${duck}
-
-<#list UNDEFINED![] as item>
-   ${item}
-</#list>
-
-${UNDEFINED![]?size}
-
-<#if UNDEFINED??>
-   UNDEFINED is defined.
-<#else>
-   UNDEFINED is undefined.
-</#if>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/encoding-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/encoding-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/encoding-builtins.ftl
deleted file mode 100644
index 6ee2a26..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/encoding-builtins.ftl
+++ /dev/null
@@ -1,52 +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.
--->
-FreeMarker: Encoding built-in tests
-
-<#assign x = "&<>\"'{}\\a/">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-rtf:  [${x?rtf}]
-<#assign x = "a&a<a>a\"a'a{a}a\\">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-rtf:  [${x?rtf}]
-<#assign x = "<<<<<">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-<#assign x = "{{{{{">
-rtf:  [${x?rtf}]
-<#assign x = "">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-rtf:  [${x?rtf}]
-<#assign x = "a">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-rtf:  [${x?rtf}]
-<#assign x = "&">
-html: [${x?html}]
-xml:  [${x?xml}]
-xhtml: [${x?xhtml}]
-<#assign x = "{">
-rtf:  [${x?rtf}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/escapes.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/escapes.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/escapes.ftl
deleted file mode 100644
index 20efc67..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/escapes.ftl
+++ /dev/null
@@ -1,79 +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.
--->
-<#assign h=["","a","b","c"]>
-<#assign g={"x":1,"y":2,"z":3}>
-<#escape x as h[x]>
-${1}
-${2}
-${3}
-<#escape x as g[x]>
-${"x"}
-${"y"}
-${"z"}
-<#noescape>${1}</#noescape>
-<#noescape><#noescape>${1}</#noescape></#noescape>
-</#escape>
-${1}
-${2}
-${3}
-</#escape>
-<#escape x as x?html>
-${"<&>"}
-<#escape x as x?xml>
-${"<&>"}
-</#escape>
-${"<&>"}
-</#escape>
----
-<#assign x = "<Mooo>">
-${x} = <Mooo>
-<#escape x as x?upper_case>
-  ${x} = <MOOO>
-  <#escape x as x?html>
-    ${x} = &lt;MOOO&gt;
-    <#noescape>
-      ${x} = <MOOO>
-    </#noescape>
-    ${x} = &lt;MOOO&gt;
-  </#escape>
-  ${x} = <MOOO>
-  <#noescape>
-    ${x} = <Mooo>
-    <#escape x as x?html>
-      ${x} = &lt;Mooo&gt;
-      <#noescape>
-        ${x} = <Mooo>
-      </#noescape>
-      ${x} = &lt;Mooo&gt;
-    </#escape>
-    ${x} = <Mooo>
-  </#noescape>
-  ${x} = <MOOO>
-</#escape>
-<#escape az as ["red", "green", "blue"][az-1]>
-  ${1} ${2} ${3}
-</#escape>
----
-<#assign s = 'A&B'>
-<#escape x as '<' + x?html + '>[' + x?lower_case + '](' + x + ')'>
-  ${s} ${s + 2}
-  <#escape x as '{' + x?lower_case + '}' + x>
-    ${s} ${s + 2}
-  </#escape>
-</#escape>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception.ftl
deleted file mode 100644
index 83ae356..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception.ftl
+++ /dev/null
@@ -1,31 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Exception Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message} <br />
-${test}</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception2.ftl
deleted file mode 100644
index 83ae356..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception2.ftl
+++ /dev/null
@@ -1,31 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Exception Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message} <br />
-${test}</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception3.ftl
deleted file mode 100644
index f386fec..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/exception3.ftl
+++ /dev/null
@@ -1,31 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Exception Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message} <br />
-${%@#$test}</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/existence-operators.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/existence-operators.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/existence-operators.ftl
deleted file mode 100644
index 2f9bdce..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/existence-operators.ftl
+++ /dev/null
@@ -1,141 +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.
--->
-<@isIRE>${v}</@>
-<@isIRE>${w}</@>
-<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
-
-<@assertEquals actual=v!'-' expected='-' />
-<@assertEquals actual=(v)!'-' expected='-' />
-<@assertEquals actual=(v!) expected='' />
-<@assertEquals actual=((v)!) expected='' />
-<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
-<@assertEquals actual=v?? expected=false />
-<@assertEquals actual=(v)?? expected=false />
-<@assertEquals actual=v?default('-') expected='-' />
-<@assertEquals actual=(v)?default('-') expected='-' />
-<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
-<@assertEquals actual=v?exists expected=false />
-<@assertEquals actual=(v)?exists expected=false />
-<@assertEquals actual=v?if_exists expected='' />
-<@assertEquals actual=(v)?if_exists expected='' />
-<@assertEquals actual=v?has_content expected=false />
-<@assertEquals actual=(v)?has_content expected=false />
-
-<@assertEquals actual=v?default(w, '-') expected='-' />
-<@assertEquals actual=v!w!'-' expected='-' />
-<#assign w = 'W'>
-<@assertEquals actual=v?default(w, '-') expected='W' />
-<@assertEquals actual=v!w!'-' expected='W' />
-
-<#list ['V', 1.5] as v>
-	<@assertEquals actual=v!'-' expected=v />
-	<@assertEquals actual=(v)!'-' expected=v />
-	<@assert test=v?? />
-	<@assert test=(v)?? />
-	<@assertEquals actual=v?default('-') expected=v />
-	<@assertEquals actual=(v)?default('-') expected=v />
-	<@assert test=v?exists />
-	<@assert test=(v)?exists />
-	<@assertEquals actual=v?if_exists expected=v />
-	<@assertEquals actual=(v)?if_exists expected=v />
-	<@assert test=v?has_content />
-	<@assert test=(v)?has_content />
-</#list>
-<@assert test=!v?? />
-<@assert test=!v?exists />
-<@isNonFastIRE>${v}</@> <#-- To check that it isn't an IRE.FAST_INSTANCE -->
-
-<@isIRE>${u.v!'-'}</@>
-<@assertEquals actual=(u.v)!'-' expected='-' />
-<@isIRE>${u.v??}</@>
-<@assertEquals actual=(u.v)?? expected=false />
-<@isIRE>${u.v?default('-')}</@>
-<@assertEquals actual=(u.v)?default('-') expected='-' />
-<@isIRE>${u.v?exists}</@>
-<@assertEquals actual=(u.v)?exists expected=false />
-<@isIRE>${u.v?if_exists}</@>
-<@assertEquals actual=(u.v)?if_exists expected='' />
-<@isIRE>${u.v?has_content}</@>
-<@assertEquals actual=(u.v)?has_content expected=false />
-
-<#assign u = { 'x': 'X' } >
-<@assertEquals actual=u.v!'-' expected='-' />
-<@assertEquals actual=(u.v)!'-' expected='-' />
-<@assertEquals actual=u.v?? expected=false />
-<@assertEquals actual=(u.v)?? expected=false />
-<@assertEquals actual=u.v?default('-') expected='-' />
-<@assertEquals actual=(u.v)?default('-') expected='-' />
-<@assertEquals actual=u.v?exists expected=false />
-<@assertEquals actual=(u.v)?exists expected=false />
-<@assertEquals actual=u.v?if_exists expected='' />
-<@assertEquals actual=(u.v)?if_exists expected='' />
-<@assertEquals actual=u.v?has_content expected=false />
-<@assertEquals actual=(u.v)?has_content expected=false />
-
-<#assign u = { 'v': 'V' } >
-<@assertEquals actual=u.v!'-' expected='V' />
-<@assertEquals actual=(u.v)!'-' expected='V' />
-<@assert test=u.v?? />
-<@assert test=(u.v)?? />
-<@assertEquals actual=u.v?default('-') expected='V' />
-<@assertEquals actual=(u.v)?default('-') expected='V' />
-<@assert test=u.v?exists />
-<@assert test=(u.v)?exists />
-<@assertEquals actual=u.v?if_exists expected='V' />
-<@assertEquals actual=(u.v)?if_exists expected='V' />
-<@assert test=u.v?has_content />
-<@assert test=(u.v)?has_content />
-
-<#list 1..4 as i>
-  <#if i == 3><#assign x = 'X'></#if>
-  <@assertEquals actual=((x!'-') == '-') expected=(i < 3) />
-</#list>
-
-<#macro attemptTest>
-  <#attempt>
-    ${fails}
-  <#recover>
-    <@assert test=isNonFastIREMessage(.error) />
-  </#attempt>
-</#macro>
-<@attemptTest />
-${(callMacroFromExpression(attemptTest))!}
-
-<#macro interpretTest><@'$\{fails}'?interpret /></#macro>
-<#attempt>
-  <@interpretTest />
-<#recover>
-  <@assert test=isNonFastIREMessage(.error) />
-</#attempt>
-<#attempt>
-  ${(callMacroFromExpression(interpretTest))!}
-<#recover>
-  <@assert test=isNonFastIREMessage(.error) />
-</#attempt>
-
-<@assertEquals actual='fails'?eval!'-' expected='-' />
-<@assertEquals actual=('fails')?eval!'-' expected='-' />
-
-<#macro isIRE><@assertFails exception="InvalidReferenceException"><#nested></@></#macro>
-<#macro isNonFastIRE><@assertFails exception="InvalidReferenceException" message="Tip:"><#nested></@></#macro>
-<#function isNonFastIREMessage msg><#return msg?contains('Tip:') && msg?contains('null or missing')></#function>
-<#function callMacroFromExpression m>
-  <#local captured><@m /></#local>
-  <#return captured>
-</#function>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashconcat.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashconcat.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashconcat.ftl
deleted file mode 100644
index 127d828..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashconcat.ftl
+++ /dev/null
@@ -1,60 +0,0 @@
-[#ftl]
-[#--
-  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.
---]
-[#assign a = {"a":1, "b":2, "c":3, "X": 4}]
-[#assign b = {"d":10, "e":20, "f":30, "X": 40}]
-
-a:
-[@dump a /]
-
-B:
-[@dump b /]
-
-a + B:
-[@dump a + b /]
-
-B + a:
-[@dump b + a /]
-
-a + a:
-[@dump a + a /]
-
-{} + a:
-[@dump {} + a /]
-
-a + {}:
-[@dump a + {} /]
-
-{} + {}:
-[@dump {} + {} /]
-
-a + b + {} + b + {} + a:
-[@dump a + b + {} + b + {} + a /]
-
-
-[#macro dump s]
-[#list s?keys as k]
-  ${k} = ${s[k]}
-[/#list]
-  ---
-[#list s?values as v]
-  ${v}
-[/#list]
-  ---
-[/#macro]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
deleted file mode 100644
index 0a02a3a..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
+++ /dev/null
@@ -1,100 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Hash Literal Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now perform a hash assignment:</p>
-
-<#assign mymessage = "hello", foo="bar", one="1">
-<#assign test = { "test1": "test23", 
-                 "test45" : message, 
-                  mymessage : "hello all", 
-                  foo: one}>
-
-${test.test1}
-${test.test45}
-${test.hello}
-${test.bar}
-
-<p>Now update the assignment and repeat:</p>
-
-<#assign mymessage = "world">
-
-${test.test1}
-${test.test45}
-${test.hello}
-
-${test.bar}
-
-<p>Now reassign the list and repeat:</p>
-
-<#assign hash= {"temp" : "Temporary"}>
-<#assign test = { "test1" : "test23", 
-                        "test45" : message, 
-                        mymessage : "hello all", 
-                        foo : one, 
-                        "hash" : hash[ "temp" ], 
-                        "true" : hash.temp, 
-                        "newhash" : hash}>
-
-${test.test1}
-${test.test45}
-${test.hello?if_exists}
-
-${test.bar}
-${test.hash}
-${test.true}
-${test.newhash.temp}
-
-<p>Pathological case: zero item hash:</p>
-
-<#assign test = {}>
-${test.test1?if_exists}
-
-<p>Hash of number literals:</p>
-<#assign test = {"1" : 2}>
-${test["1"]}
-
-<p>Hash concatenation:</p>
-<#assign cc = { "a" : 1, "b" : 2 } + { "b" : 3, "c" : 4 }>
-<#list cc?keys?sort as key>
-${key} => ${cc[key]}
-</#list>
-
-<p>Empty hash concatenation:</p>
-${({} + { "a" : "foo" }).a}, ${({ "a" : "bar" } + {}).a}
-
-</body>
-</html>
-<@noOutput>
-
-<#assign m = { 'a': 1, 'b', 2, 'a': 3 }>
-<@assertEquals expected="a, b" actual=m?keys?join(', ') />
-<@assertEquals expected="3, 2" actual=m?values?join(', ') />
-<@assertEquals expected=3 actual=m['a'] />
-<@assertEquals expected=2 actual=m['b'] />
-
-</...@noOutput>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/helloworld.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/helloworld.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/helloworld.ftl
deleted file mode 100644
index 91816f6..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/helloworld.ftl
+++ /dev/null
@@ -1,30 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Exec Model Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-<p>${exec( "java freemarker.test.HelloWorld" )}</p>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-escaping.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-escaping.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-escaping.ftl
deleted file mode 100644
index 9b39235..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-escaping.ftl
+++ /dev/null
@@ -1,81 +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.
--->
-<#macro m\-a data\-color>
-    <#local \.namespace = 123>
-    <a-b>${data\-color}<#nested \.namespace></a-b><#t>
-</#macro>
-<#macro "m-b2"></#macro>
-<#macro "m/b2"></#macro>
-
-<@m\-a data\-color="red"; loop\-var>${loop\-var}</@>
-
-<#function f\-a p\-a>
-    <#return p\-a + " works">
-</#function>
-${f\-a("f-a")}
-
-<#assign \-\-\-\.\: = 'dash-dash-dash etc.'>
-${\-\-\-\.\:}
-${.vars['---.:']}
-<#assign hash = { '--moz-prop': 'propVal' }>
-${hash.\-\-moz\-prop}
-${hash['--moz-prop']}
-
-<#assign ls\:a = 1..3>
-List: <#list ls\:a as \:i>${\:i}</#list>
-
-<#assign sw\-a=1>
-Switch: <#switch sw\-a>
-    <#case 1>OK<#break>
-    <#default>Fails
-</#switch>
-
-<#escape \-x as \-x?upper_case>${'escaped'}</#escape>
-
-<#if false && sw\-a == 1>
-    <#visit x\-y2 using x\-y1>
-    <#recurse x\-y2 using x\-y1>
-    <#import i\-a as i\-b>
-    <#include i\-c>
-</#if>
-
-<#assign @as@_a = 'as1'>
-${@as@_a}
-<#assign 'as-c' = 'as2'>
-${.vars['as-c']}
-<#assign "as/b" = 'as3'>
-${.vars["as/b"]}
-<#assign "as'c" = 'as4'>
-${.vars["as'c"]}
-<#assign 'as"d' = 'as5'>
-${.vars['as"d']}
-
-<#global g\-a=1 g\-b=2 "g-c"=3>
-
-<#macro catchAll x y attrs...>
-<catchAll x=${x} y=${y}<#list attrs?keys?sort as k> ${k}=${attrs[k]}</#list> />
-</#macro>
-<@catchAll x=1 y=2 z=3 data\-foo=4 a\:b\.c=5 />
-
-<#macro dumpNS>
-    <#list .namespace?keys?sort as k>
-        ${k} = <#local v = .namespace[k]><#if v?is_string>${v}<#else>...</#if><#lt>
-    </#list>
-</#macro>
-<@dumpNS />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-non-ascii.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-non-ascii.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-non-ascii.ftl
deleted file mode 100644
index 59a4b0e..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/identifier-non-ascii.ftl
+++ /dev/null
@@ -1,21 +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.
--->
-<#macro árvíztűrőTükörfúrógép טֶקסט>${טֶקסט}</#macro>
-<#assign 한국어_키보드="Korean Keyboard">
-<@árvíztűrőTükörfúrógép 한국어_키보드 />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/if.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/if.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/if.ftl
deleted file mode 100644
index 97c3f4b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/if.ftl
+++ /dev/null
@@ -1,109 +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.
--->
-<#assign x = 1>
-
-- <#if x == 1>good</#if>
-- <#if x == 1></#if>good
-- <#if x == 1>goo${missing!'d'}</#if>
-- <#if x == 0>wrong</#if>good
-
-- <#if x == 1>good<#else>wrong</#if>
-- <#if x == 0>wrong<#else>good</#if>
-
-- <#if x == 1>good<#elseif x == 2>wrong<#else>wrong</#if>
-- <#if x == 1>good<#elseif x == 1>wrong<#else>wrong</#if>
-- <#if x == 0>wrong<#elseif x == 1>good<#else>wrong</#if>
-- <#if x == 0>wrong<#elseif x == 2>wrong<#else>good</#if>
-
-- <#if x == 1>good<#elseif x == 1>wrong</#if>
-- <#if x == 0>wrong<#elseif x == 1>good</#if>
-- <#if x == 0>wrong<#elseif x == 2>wrong</#if>good
-- <#if x == 0>wrong<#elseif x == 1><#else>wrong</#if>good
-
-<#-- Same with pre-calculable results, just in case later the dead code will be optimized out: -->
-- <#if 1 == 1>good</#if>
-- <#if 1 == 0>wrong</#if>good
-- <#if 1 == 1>goo${missing!'d'}</#if>
-- <#if 1 == 0>wrong</#if>good
-
-- <#if 1 == 1>good<#else>wrong</#if>
-- <#if 1 == 0>wrong<#else>good</#if>
-
-- <#if 1 == 1>good<#elseif 1 == 2>wrong<#else>wrong</#if>
-- <#if 1 == 1>good<#elseif 1 == 1>wrong<#else>wrong</#if>
-- <#if 1 == 0>wrong<#elseif 1 == 1>good<#else>wrong</#if>
-- <#if 1 == 0>wrong<#elseif 1 == 2>wrong<#else>good</#if>
-
-- <#if 1 == 1>good<#elseif 1 == 1>wrong</#if>
-- <#if 1 == 0>wrong<#elseif 1 == 1>good</#if>
-- <#if 1 == 0>wrong<#elseif 1 == 2>wrong</#if>good
-- <#if 1 == 0>wrong<#elseif 1 == 1><#else>wrong</#if>good
-
-<#-- Varying branch choice of the same AST nodes: -->
-<#list [1, 2, 3, 4] as x>
-- <#if x == 1>1</#if>
-- <#if x == 2>2</#if>
-- <#if x == 3>3</#if>
-- <#if x == 1>is 1<#else>isn't 1</#if>
-- <#if x == 2>is 2<#else>isn't 2</#if>
-- <#if x == 3>is 3<#else>isn't 3</#if>
-- Finally, it's: <#if x == 1>1<#elseif x == 2>2<#elseif x == 3>3<#else>4</#if>
-</#list>
-
-<#-- nested -->
-<#list [1, 2, 3] as x><#list [1, 2, 3] as y>
-  <#assign y = x * x>
-  <#if x == 1>
-    1:
-    <#if (x > y)>
-      > ${y}
-    <#elseif x == y>
-      == ${y}
-    <#else>
-      <= ${y}
-    </#if>
-  <#elseif x == 2>
-    2:
-    <#if (x > y)>
-      > ${y}
-    <#elseif x == y>
-      == ${y}
-    <#else>
-      <= ${y}
-    </#if>
-  <#else>
-    3:
-    <#if (x > y)>
-      > ${y}
-    <#elseif x == y>
-      == ${y}
-    <#else>
-      <= ${y}
-    </#if>
-    <#if x == 3 && y == 3>
-      End
-    </#if>
-  </#if>
-</#list></#list>
-
-<#-- parsing errors -->
-<@assertFails message="valid #if-#elseif-#else"><@"<#if t><#else><#elseif t2></#if>"?interpret /></@>
-<@assertFails message="valid #if-#elseif-#else"><@"<#if t><#else><#else></#if>"?interpret /></@>
-<@assertFails message="valid #if-#elseif-#else"><@"<#else></#else>"?interpret /></@>
-<@assertFails message="valid #if-#elseif-#else"><@"<#elseif t></#elseif>"?interpret /></@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import.ftl
deleted file mode 100644
index bddd857..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import.ftl
+++ /dev/null
@@ -1,45 +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.
--->
---
-<#-- import "/import_lib.ftl" as my -->
---
-
-<#if mail?exists || test?exists>
-  <#stop "mail or test should not exist">
-</#if>
-
-${my.mail}
-<@my.test foo="bar"/>
-
-<#assign mail="jsmith@other1.com">
-${my.mail}
-<@my.test foo="bar"/>
-
-<#assign mail in my>
-  jsmith@other2.com<#t>
-</#assign>
-${my.mail}
-<@my.test foo="bar"/>
-
-<#import "/import_lib.ftl" as my2>
-${my2.mail}
-<#assign mail="jsmith@other3.com" in my2>
-${my.mail}
-
-${my2.doubleUp("foobar")}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import_lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import_lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import_lib.ftl
deleted file mode 100644
index 3329af9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/import_lib.ftl
+++ /dev/null
@@ -1,31 +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.
--->
-<#macro test foo>
-  Test ${foo}.
-  Email: ${mail}
-  <#if .main.mail?exists>
-    Email in the root: ${.main.mail}
-  </#if>
-</#macro>
-
-<#function doubleUp foo>
-   <#return foo+foo>
-</#function>
-
-<#assign mail = "jsmith@acme.com">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include.ftl
deleted file mode 100644
index 3e997e7..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include.ftl
+++ /dev/null
@@ -1,47 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Include Instruction Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-
-${message}
-
-<#if message?exists>
-	<p>Message exists!
-</#if>
-
-<p>Test normal includes:</p>
-<#include "included.ftl">
-
-${foo}
-${nestedMessage}
-
-<@twice>
-Kilroy
-</...@twice>
-
-<p>Test subdir includes:</p>
-<#include "subdir/include-subdir.ftl">
-</body>
-</html>
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2-included.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2-included.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2-included.ftl
deleted file mode 100644
index db9dfc1..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2-included.ftl
+++ /dev/null
@@ -1,19 +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.
--->
-${'A'} próba

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2.ftl
deleted file mode 100644
index 5f3ccc3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/include2.ftl
+++ /dev/null
@@ -1,32 +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.
--->
-<#include "include2" + "-included.ftl">
-<#assign s = "de">
-<#include "inclu" + s + "2-included.ftl">
-
-<#assign bTrue=true>
-<#assign bFalse=false>
-<#include "include2-included.ftl" ignore_missing=true>
-<#include "include2-included.ftl" ignore_missing=bTrue>
-<#include "include2-included.ftl" ignore_missing=false>
-<#include "include2-included.ftl" ignore_missing=bFalse>
-
-<@assertFails message="not found"><#include "missing.ftl"></@>
-[<#include "missing.ftl" ignore_missing=true>]
-[<#include "missing.ftl" ignore_missing=bTrue>]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/included.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/included.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/included.ftl
deleted file mode 100644
index f711a67..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/included.ftl
+++ /dev/null
@@ -1,30 +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.
--->
-<p>A test of included files:</p>
-
-<#if .globals.message?exists>
-	<p>Message exists!:<br />
-        ${.globals.message}</p>
-<#else>
-        <p>No message :(</p>
-</#if>
-
-<#assign foo="assigning from included template", bar=" Can you see me? ">
-<#macro twice><#nested/>${bar}<#nested/></#macro>
-<#include "nestedinclude.ftl">

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/interpret.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/interpret.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/interpret.ftl
deleted file mode 100644
index 41f8425..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/interpret.ftl
+++ /dev/null
@@ -1,25 +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.
--->
-<#global x=["a", "b", "c"]>
-<#global templateSource = r"<#list x as y>${y}</#list>">
-<@templateSource?interpret>def</@>
-<@[templateSource]?interpret>def</@>
-<@[templateSource,"id"]?interpret>def</@>
-
-<#assign t = '<#macro m>M</#macro>'?interpret><@t /><@m/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/iterators.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/iterators.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/iterators.ftl
deleted file mode 100644
index 389abf3..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/iterators.ftl
+++ /dev/null
@@ -1,71 +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.
--->
-<html>
-<head>
-<title>FreeMarker: List Iterator Test</title>
-</head>
-<body>
-<#assign list= ["one", "two", "three", "four", "five"]>
-<#assign hash = {"key", list}>
-<#assign  hash2 = {"value", hash}>
-
-<p>A simple test follows:</p>
-
-<p>${message}</p>
-
-<p>Now iterate over a list:</p>
-
-<#list list as item>
-<p>${item}</p>
-</#list>
-
-<p>Now iterate again:</p>
-
-<#list list as item>
-<p>${item_index}. ${item}</p>
-</#list>
-
-<p>Iterate over a list in a hash:</p>
-
-<#list hash.key as item>
-<p>${item}</p>
-</#list>
-
-<#list hash.key as item>
-<p>${item}</p>
-</#list>
-
-<#list hash[ "key" ] as item>
-<p>${item}</p>
-</#list>
-
-<#list hash["key"] as item>
-<p>${item}</p>
-</#list>
-
-<#list hash2["value"].key as key>
-<p>${key}</p>
-</#list>
-
-<#list hash2.value.key as az>
-<p>${az}</p>
-</#list>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/lastcharacter.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/lastcharacter.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/lastcharacter.ftl
deleted file mode 100644
index e762356..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/lastcharacter.ftl
+++ /dev/null
@@ -1,31 +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.
--->
-<html>
-<head>
-<title>FreeMarker: Last Character Test</title>
-</head>
-<body>
-
-<p>A simple test follows:</p>
-  
-    #{message?capitalize?length}
-    
-    ${message [1..] ? upper_case}
-    
-    message: ${message ?capitalize[0..10]}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list-bis.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list-bis.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list-bis.ftl
deleted file mode 100644
index e52307f..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list-bis.ftl
+++ /dev/null
@@ -1,48 +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.
--->
-<#list ['a', 'b', 'c'] as x>
-    ${x?index}: ${x} [<#list ['A', 'B', 'C'] as x>${x?index}:${x}<#sep>, </#list>]
-</#list>
-
-<#list ['a', 'b', 'c'] as i>
-    ${i?index}: ${i} <#list ['A', 'B', 'C'] as j>${i?index}${i}/${j?index}${j}<#sep>, </#list>
-</#list>
-
-<#list ['a', 'b', 'c']><#items as x>${x?index}:${x}<#sep>, </#items></#list>
-<#list ['a', 'b', 'c']><#items as x>${x?counter}. ${x};<#sep> </#items></#list>
-
-<#list ['a', 'b', 'c'] as x>${x}<#if x?hasNext>, </#if></#list>
-<#list ['a', 'b', 'c'] as x\-y>${x\-y}<#if x\-y?hasNext>, </#if></#list>
-
-<#list ['a', 'b', 'c'] as x><#if x?isFirst>${x?capFirst}<#else>${x}</#if><#sep>, </#sep><#if x?isLast>.</#if></#list>
-
-<#list ['a', 'b', 'c'] as x>${x?isOddItem?c}/${x?isEvenItem?c}<#sep> </#list>
-
-<#list ['a', 'b', 'c'] as x>
-    <td class="${x?itemParity}Row">${x}</td>
-</#list>
-
-<#list ['a', 'b', 'c'] as x>
-    <td class="row${x?itemParityCap}">${x}</td>
-</#list>
-
-<#list ['a', 'b', 'c', 'd', 'e', 'f', 'g'] as x>
-    <td class="${x?itemCycle('R', 'G', 'B')}">${x}</td>
-</#list>
-<@assertFails message="expects 1"><#list 1..1 as x>${x?itemCycle()}</#list></@>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list.ftl
deleted file mode 100644
index 280491c..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list.ftl
+++ /dev/null
@@ -1,44 +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.
--->
-<@testList ["aardvark", "bear", "cat", "dog"] />
-
-<@testList ["aardvark"] />
-
-<@testList [] />
-
-<@testList listables.list />
-
-<@testList listables.linkedList />
-
-<@testList listables.set />
-
-<@testList listables.iterator />
-
-<@testList listables.emptyList />
-
-<@testList listables.emptyLinkedList />
-
-<@testList listables.emptySet />
-
-<@testList listables.emptyIterator />
-
-<#macro testList seq>
-Size: <#attempt>${seq?size}<#recover>failed</#attempt>
-Items: <#list seq as i>@${i_index} ${i}<#if i_has_next>, <#else>.</#if></#list>
-</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list2.ftl
deleted file mode 100644
index db64a4b..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list2.ftl
+++ /dev/null
@@ -1,90 +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.
--->
-<@testList ["aardvark", "bear", "cat", "dog"] />
-
-<@testList ["aardvark"] />
-
-<@testList [] />
-
-<@testList listables.list />
-
-<@testList listables.set />
-
-<@testList listables.getIterator />
-
-<@testList listables.emptyList />
-
-<@testList listables.emptySet />
-
-<@testList listables.getEmptyIterator />
-
-<#macro testList xs>
-=== [${resolve(xs)?join(", ")}] ===
-<#assign resolveCallCnt = 0>
-
--- List+sep:
-<#list resolve(xs) as x>
-    ${x}<#sep>,</#sep>
-</#list>
--- List+else:
-<#list resolve(xs) as x>
-    ${x}
-<#else>
-    Empty!
-</#list>
--- List+items:
-<#list resolve(xs)>
-    [
-    <#items as x>
-        ${x!'U'}
-    </#items>
-    ]
-</#list>
--- List+items+else:
-<#list resolve(xs)>
-    [
-    <#items as x>
-        ${x!'U'}
-    </#items>
-    ]
-<#else>
-    Empty!
-</#list>
--- List+items+sep+else:
-<#list resolve(xs)>
-    [
-    <#items as x>
-        ${x!'U'}<#sep>,</#sep>
-    </#items>
-    ]
-<#else>
-    Empty!
-</#list>
-<@assertEquals expected=5 actual=resolveCallCnt />
---
-</#macro>
-
-<#function resolve xs>
-    <#assign resolveCallCnt = (resolveCallCnt!0) + 1>
-    <#if xs?isMethod>
-        <#return xs()>
-    <#else>
-        <#return xs>
-    </#if>
-</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list3.ftl
deleted file mode 100644
index d2fcf71..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/list3.ftl
+++ /dev/null
@@ -1,70 +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.
--->
-[
-<#list listables.list as i>
-    [<#list listables.list as j>(${i}@${i_index}, ${j}@${j_index})<#sep>, </#sep></#list>]<#sep>,</#sep>
-</#list>
-]
-
-<#macro hits xs style="">
-    <#list xs>
-        <p>${xs?size} hits:
-        <div class="hits">
-            <#switch style>
-                <#case "hidden">
-                    ...
-                    <#break>
-                <#case "other">
-                    <#items as x>
-                        <div class="hitOther">${x}</div>
-                    </#items>
-                    <#break>
-                <#case "none">
-                <#default>
-                    <#items as x>
-                        <div class="hit">${x}</div>
-                    </#items>
-                    <#break>
-            </#switch>
-        </div>
-    <#else>
-        <p>Nothing.
-    </#list>
-</#macro>
-
-<@hits ['a', 'b'] />
-
-<@hits ['a', 'b'], "other" />
-
-<@hits ['a', 'b'], "hidden" />
-
-<@hits [] />
-
-<#list listables.list as i><#if i_index gt 1>...<#break></#if>${i}<#sep>, </#sep></#list>
-<#list listables.list>[<#items as i><#if i_index gt 1>...<#break></#if>${i}<#sep>, </#sep></#items>]</#list>
-
-<@testAutoClosedSep 1..3 />
-<@testAutoClosedSep [1] />
-<@testAutoClosedSep [] />
-
-<#macro testAutoClosedSep xs>
-<#list xs as x>${x}<#sep>, <#else>Empty</#list>
-<#list xs as x>${x}<#sep><#if x_index == 0> /*first*/, <#else>, </#if><#else>Empty</#list>
-<#list xs>[<#items as x>${x}<#sep>, </#items>]<#else>Empty</#list>
-</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhash.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhash.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhash.ftl
deleted file mode 100644
index 6f22b43..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhash.ftl
+++ /dev/null
@@ -1,70 +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.
--->
-<#setting booleanFormat='Y,N'>
-
-<#macro listings maps>
-  <#list maps as m>
-    Map:
-    
-    [
-    <#list m as k, v>
-      ${k!'null'} = ${v!'null'}
-    </#list>
-    ]
-  
-    [
-    <#list m as k, v>
-      ${k!'null'} = ${v!'null'}<#sep>;</#sep> // @${k?index}=@${v?index}; ${k?itemParity}=${v?itemParity}; ${k?hasNext}=${v?hasNext}
-    <#else>
-      Empty
-    </#list>
-    ]
-  
-    {
-    <#list m>
-      [
-      <#items as k, v>
-        ${k!'null'} = ${v!'null'}<#sep>;</#sep> // @${k?index}=@${v?index}; ${k?itemParity}=${v?itemParity}; ${k?hasNext}=${v?hasNext}
-      </#items>
-      ]
-    <#else>
-      Empty
-    </#list>
-    }
-
-  </#list>
-</#macro>
-
-Non-empty maps:
-
-<@listings listables.hashEx2s />
-<@listings [ listables.hashNonEx2 ] />
-
-Empty maps:
-
-<@listings listables.emptyHashes />
-
-<#list { 'a': { 'aa': 11 }, 'b': { 'ba': 21, 'bb': 22 }, 'c': {} } as k1, v1>
-  ${k1} @ ${k1?index}, ${v1?size}
-  <#list v1 as k2, v2>
-    ${k2} = ${v2}  @ ${k2?index} // inside ${k1} @ ${k1?index}, ${v1?size}
-  </#list>
-  ${k1} @ ${k1?index}, ${v1?size}
-  --
-</#list>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhashliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhashliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhashliteral.ftl
deleted file mode 100644
index 06694c9..0000000
--- a/freemarker-core-test/src/test/resources/org/apache/freemarker/test/templatesuite/templates/listhashliteral.ftl
+++ /dev/null
@@ -1,35 +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.
--->
-<#list [ { "a": 1, "b": 2, "a": 3 }, { } ] as h>
-  KVPs:
-  <#list h as k, v>
-    ${k} = ${v}
-  </#list>
-  
-  Keys:
-  <#list h?keys as k>
-    ${k}
-  </#list>
-  
-  Values:
-  <#list h?values as v>
-    ${v}
-  </#list>
-
-</#list>
\ No newline at end of file


[09/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps.ftl
new file mode 100644
index 0000000..81c0b8f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps.ftl
@@ -0,0 +1,136 @@
+<#--
+  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.
+-->
+${"test"?matches('test')?string} == true
+${"test"?matches('test', '')?string} == true
+
+${"TEST"?matches('test')?string} == false
+${"TEST"?matches('test', 'i')?string} == true
+
+${"test\nfoo"?matches('.*^foo')?string} == false
+${"test\nfoo"?matches(r'.*\n^foo', 'm')?string} == true
+
+${"test\nfoo"?matches('test.foo')?string} == false
+${"test\nfoo"?matches('test.foo', 's')?string} == true
+
+${"test\nFoo"?matches('.*foo', 's')?string} == false
+${"test\nFoo"?matches('.*foo', 'i')?string} == false
+${"test\nFoo"?matches('.*foo', 'im')?string} == false
+${"test\nFoo"?matches('.*foo', 'si')?string} == true
+${"test\nFoo"?matches('.*foo', 'is')?string} == true
+${"test\nFoo"?matches('.*foo', 'mis')?string} == true
+
+${"test\nFoo"?matches('.*\n^foo', 'm')?string} == false
+${"test\nFoo"?matches('.*\n^foo', 'i')?string} == false
+${"test\nFoo"?matches('.*\n^foo', 'im')?string} == true
+${"test\nFoo"?matches('.*\n^foo', 'mi')?string} == true
+${"test\nFoo"?matches('.*^foo', 'ism')?string} == true
+${"test\nFoo"?matches('.*^foo', 'smi')?string} == true
+<#setting boolean_format="True,False">
+<@assert test=false?matches('[eslaF]+') />
+<@assert test='False'?matches('[eslaF]+') />
+
+<#assign s = "Code without test coverage\nis considered to be BROKEN">
+
+Lower 'c'-words:
+<#list s?matches('c[a-z]*') as m>
+- ${m}
+</#list>
+
+Any 'c'-words:
+<#list s?matches('c[a-z]*', 'i') as m>
+- ${m}
+</#list>  
+
+Lower line-last words:
+<#list s?matches('[a-z]+$', 'm') as m>
+- ${m}
+</#list>  
+
+Any line-last words:
+<#list s?matches('[a-z]+$', 'mi') as m>
+- ${m}
+</#list>
+
+Any last words:
+<#list s?matches('[a-z]+$', 'i') as m>
+- ${m}
+</#list>
+
+c-word with follower:
+<#list s?matches('(c[a-z]*+).([a-z]++)', 'is') as m>
+- "${m?j_string}"
+  Groups: <#list m?groups as g>"${g?j_string}"<#if g_has_next>, </#if></#list>
+</#list>
+
+c-word with follower in the same line:
+<#list s?matches('c[a-z]*+.[a-z]++', 'i') as m>
+- ${m}
+</#list>
+
+Lower c-word with follower in the same line:
+<#list s?matches('c[a-z]*+.[a-z]++', '') as m>
+- ${m}
+</#list>
+
+<#attempt>
+  Ignored but logged in 2.3: ${s?matches('broken', 'I')?string} == False
+<#recover>
+  Fails in 2.4
+</#attempt>
+<#attempt>
+  Ignored but logged in 2.3: ${s?matches('broken', 'f')?string} == False
+<#recover>
+  Fails in 2.4
+</#attempt>
+
+${"foobar"?replace("foo", "FOO")} == FOObar
+${"Foobar"?replace("foo", "FOO", "")} == Foobar
+${"Foobar"?replace("foo", "FOO", "i")} == FOObar
+${"FoobarfOO"?replace("foo", "FOO", "i")} == FOObarFOO
+${"FoobarfOO"?replace("foo", "FOO", "if")} == FOObarfOO
+${"FoobarfOO"?replace("foo", "FOO", "fi")} == FOObarfOO
+${"Foobar"?replace("foo", "FOO", "r")} == Foobar
+${"Foobar"?replace("foo", "FOO", "ri")} == FOObar
+${"FoobarfOO"?replace("foo", "FOO", "ri")} == FOObarFOO
+${"FoobarfOO"?replace("foo", "FOO", "rif")} == FOObarfOO
+${"FoobarfOO"?replace("foo", "FOO", "fri")} == FOObarfOO
+${"foobar"?replace("fo+", "FOO")} == foobar
+${"foobar"?replace("fo+", "FOO", "")} == foobar
+${"foobar"?replace("fo+", "FOO", "r")} == FOObar
+${"foobarfOo"?replace("fo+", "FOO", "ri")} == FOObarFOO
+${"foobarfOo"?replace("fo+", "FOO", "rif")} == FOObarfOo
+${false?replace('a', 'A')} == FAlse
+${false?replace('[abc]', 'A', 'r')} == FAlse
+
+<#attempt>
+  Ignored but logged in 2.3: ${"foobar"?replace("foo", "FOO", "c")}
+<#recover>
+  Fails in 2.4
+</#attempt>
+
+<#macro dumpList xs>[<#list xs as x>${x}<#if x_has_next>, </#if></#list>]</#macro>
+<@dumpList "fooXbarxbaaz"?split("X") /> == [foo, barxbaaz]
+<@dumpList "fooXbarxbaaz"?split("X", "") /> == [foo, barxbaaz]
+<@dumpList "fooXbarxbaaz"?split("X", "i") /> == [foo, bar, baaz]
+<@dumpList "fooXbarxbaaz"?split("X", "r") /> == [foo, barxbaaz]
+<@dumpList "fooXbarxbaaz"?split("X", "ri") /> == [foo, bar, baaz]
+<@dumpList "fooXXbarxxbaaz"?split("X+", "i") /> == [fooXXbarxxbaaz]
+<@dumpList "fooXXbarxxbaaz"?split("X+", "ri") /> == [foo, bar, baaz]
+<@dumpList false?split("[ae]", "r") /> == [F, ls]
+<@dumpList false?split("e") /> == [Fals, ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins1.ftl
new file mode 100644
index 0000000..cd7f061
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins1.ftl
@@ -0,0 +1,129 @@
+<#--
+  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.
+-->
+FreeMarker: Encoding string built-in tests
+
+<#assign x = r'  dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case}  '>
+  
+cap_first:  ${x?cap_first}
+uncap_first:${x?uncap_first}
+uncap_first:${"Blah"?uncap_first}
+capitalize: ${x?capitalize}
+html:       ${x?html}
+length:     ${x?length}
+lower_case: ${x?lower_case}
+rtf:        ${x?rtf}
+trim:       ${x?trim}
+trim2:      ${"foo bar"?trim}
+trim3:      ${" foo bar"?trim}
+trim4:      ${"foo bar "?trim}
+upper_case: ${x?upper_case}
+xml:        ${x?xml}
+xhtml:      ${"\"Blah's is > 1 & < 2\""?xhtml}
+<@assertEquals actual="'"?html expected="&#39;" />
+<@assertEquals actual="'"?xhtml expected="&#39;" />
+<@assertEquals actual="'"?xml expected="&apos;" />
+<#-- ?substring: -->
+<@assertEquals actual="ab"?substring(0) expected="ab" />
+<@assertEquals actual="ab"?substring(1) expected="b" />
+<@assertEquals actual="ab"?substring(2) expected="" />
+<@assertFails message="at least 0">${"ab"?substring(-1)}</@><#t>
+<@assertFails message="greater than the length of the string">${"ab"?substring(3)}</@><#t>
+<@assertEquals actual="ab"?substring(0, 0) expected="" />
+<@assertEquals actual="ab"?substring(0, 1) expected="a" />
+<@assertEquals actual="ab"?substring(0, 2) expected="ab" />
+<@assertFails message="at least 0">${"ab"?substring(0, -1)}</@><#t>
+<@assertFails message="greater than the length of the string">${"ab"?substring(0, 3)}</@><#t>
+<@assertEquals actual="ab"?substring(1, 1) expected="" />
+<@assertEquals actual="ab"?substring(1, 2) expected="b" />
+<@assertFails message="at least 0">${"ab"?substring(1, -1)}</@><#t>
+<@assertFails message="greater than the length of the string">${"ab"?substring(1, 3)}</@><#t>
+<@assertFails message="shouldn't be greater than the end index">${"ab"?substring(1, 0)}</@><#t>
+
+word_list:
+<#global words = x?word_list>
+<#list words as w>- ${w}
+</#list>
+
+<#global canufeelitbabe = x?interpret>
+interpret: <@canufeelitbabe></@>
+<#setting locale="es_ES">number: ${"-123.45"?number + 1.1}
+${"1.5e3"?number?c}
+${"0005"?number?c}
+${"+0"?number?c}
+${"-0"?number?c}
+${"NaN"?number?is_nan?c}
+${("INF"?number?is_infinite && "INF"?number > 0)?c}
+${("-INF"?number?is_infinite && "-INF"?number < 0)?c}
+${("Infinity"?number?is_infinite && "Infinity"?number > 0)?c}
+${("-Infinity"?number?is_infinite && "-Infinity"?number < 0)?c}
+
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new()}
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new(1)}
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("xxx")}
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("xxx", "yyy")}
+
+<#assign x = "In the beginning, God created the Heavens and The Earth.">
+
+${x?replace("the", "The Sacred, Holy", "i")} <#-- case insensitive replacement -->
+${x?replace("the", "the very", "f")} <#-- replace only the first one -->
+${x?replace("", "|")} <#-- replace empry string -->
+${x?replace("", "|", "f")} <#-- replace first empty string -->
+
+${x?replace("the H[a-z]+", "the sky", "r")} <#-- regexp replacement -->
+
+<#if x?matches(".*Heav..s.*")>matches<#else>Really?</#if>
+
+<#list x?matches("(the) ([a-z]+)", "i") as match>
+  ${match}
+  ${match?groups[1]} sacred ${match?groups[2]}
+</#list>  
+
+<#assign matches = x?matches("In the ([a-z]+), God created (.*)")>
+${matches?groups[0]}
+${matches?groups[1]}
+${matches?groups[2]}
+
+<#assign x="foo, bar;baz,     foobar">
+<#list x?split("[,;] ?", "r") as word>
+   ${word}
+</#list>
+
+
+<#assign a = "foo", b="bar", c="(a+b)?upper_case">
+${c?eval}
+
+[${"a"?j_string}] = [a]
+[${"a\\'x'\nb"?j_string}] = [a\\'x'\nb]
+[${"\x1\x1A\x20"?j_string}] = [\u0001\u001a ]
+
+[${"a"?js_string}] = [a]
+[${"a\\'x'\nb"?js_string}] = [a\\\'x\'\nb]
+[${"\x1\x1A\x20"?js_string}] = [\x01\x1A ]
+[${"<![CDATA["?js_string}] = [\x3C![CDATA[]
+[${"]]>"?js_string}] = []]\>]
+
+[${"a"?json_string}] = [a]
+[${"a\\'x'\nb"?json_string}] = [a\\'x'\nb]
+[${"\x1\x1A\x20"?json_string}] = [\u0001\u001A ]
+[${"\n\r\t\f\b\""?json_string}] = [\n\r\t\f\b\"]
+[${"/"?json_string}] = [\/]
+[${"a/b"?json_string}] = [a/b]
+[${"</script>"?json_string}] = [<\/script>]
+[${"<![CDATA["?json_string}] = [\u003C![CDATA[]
+[${"]]>"?json_string}] = []]\u003E]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins2.ftl
new file mode 100644
index 0000000..c9294fa
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins2.ftl
@@ -0,0 +1,135 @@
+<#--
+  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.
+-->
+--
+<#assign s = "abbcdbb">
+${s?index_of("bb")} = 1
+${s?index_of("bb", 2)} = 5
+${s?index_of("")} = 0
+--
+${s?last_index_of("bb")} = 5
+${s?last_index_of("bb", 4)} = 1
+${s?last_index_of("")} = ${s?length}
+--
+${s?starts_with("abb")?string} = true
+${s?starts_with("bb")?string} = false
+${s?starts_with("")?string} = true
+--
+${s?ends_with("dbb")?string} = true
+${s?ends_with("cbb")?string} = false
+${s?ends_with("")?string} = true
+--
+${s?contains("abb")?string} = true
+${s?contains("bcd")?string} = true
+${s?contains("dbb")?string} = true
+${s?contains("bbx")?string} = false
+${s?contains("")?string} = true
+--
+[${s?chop_linebreak}] = [abbcdbb]
+[${"qwe\n"?chop_linebreak}] = [qwe]
+[${"qwe\r"?chop_linebreak}] = [qwe]
+[${"qwe\r\n"?chop_linebreak}] = [qwe]
+[${"qwe\r\n\r\n"?chop_linebreak}] = [qwe
+]
+[${"qwe\n\n"?chop_linebreak}] = [qwe
+]
+--
+[${s?replace("A", "-")}] = [abbcdbb]
+[${s?replace("c", "-")}] = [abb-dbb]
+[${s?replace("bb", "-=*")}] = [a-=*cd-=*]
+--
+<#assign ls = s?split("b")>
+<#list ls as i>[${i}]</#list> == [a][][cd][][]
+<#list "--die--maggots--!"?split("--") as i>[${i}]</#list> == [][die][maggots][!]
+<#list "Die maggots!"?split("--") as i>[${i}]</#list> == [Die maggots!]
+--
+[${""?left_pad(5)}]
+[${"a"?left_pad(5)}]
+[${"ab"?left_pad(5)}]
+[${"abc"?left_pad(5)}]
+[${"abcd"?left_pad(5)}]
+[${"abcde"?left_pad(5)}]
+[${"abcdef"?left_pad(5)}]
+[${"abcdefg"?left_pad(5)}]
+[${"abcdefgh"?left_pad(5)}]
+[${""?left_pad(5, "-")}]
+[${"a"?left_pad(5, "-")}]
+[${"ab"?left_pad(5, "-")}]
+[${"abc"?left_pad(5, "-")}]
+[${"abcd"?left_pad(5, "-")}]
+[${"abcde"?left_pad(5, "-")}]
+[${"abcdef"?left_pad(5, "-")}]
+[${"abcdefg"?left_pad(5, "-")}]
+[${"abcdefgh"?left_pad(5, "-")}]
+[${""?left_pad(8, ".oO")}]
+[${"a"?left_pad(8, ".oO")}]
+[${"ab"?left_pad(8, ".oO")}]
+[${"abc"?left_pad(8, ".oO")}]
+[${"abcd"?left_pad(8, ".oO")}]
+[${"abcde"?left_pad(8, ".oO")}]
+[${"abcdef"?left_pad(8, ".oO")}]
+[${"abcdefg"?left_pad(8, ".oO")}]
+[${"abcdefgh"?left_pad(8, ".oO")}]
+[${"abcdefghi"?left_pad(8, ".oO")}]
+[${"abcdefghij"?left_pad(8, ".oO")}]
+[${""?left_pad(0, r"/\_")}]
+[${""?left_pad(1, r"/\_")}]
+[${""?left_pad(2, r"/\_")}]
+[${""?left_pad(3, r"/\_")}]
+[${""?left_pad(4, r"/\_")}]
+[${""?left_pad(5, r"/\_")}]
+[${""?left_pad(6, r"/\_")}]
+[${""?left_pad(7, r"/\_")}]
+--
+[${""?right_pad(5)}]
+[${"a"?right_pad(5)}]
+[${"ab"?right_pad(5)}]
+[${"abc"?right_pad(5)}]
+[${"abcd"?right_pad(5)}]
+[${"abcde"?right_pad(5)}]
+[${"abcdef"?right_pad(5)}]
+[${"abcdefg"?right_pad(5)}]
+[${"abcdefgh"?right_pad(5)}]
+[${""?right_pad(5, "-")}]
+[${"a"?right_pad(5, "-")}]
+[${"ab"?right_pad(5, "-")}]
+[${"abc"?right_pad(5, "-")}]
+[${"abcd"?right_pad(5, "-")}]
+[${"abcde"?right_pad(5, "-")}]
+[${"abcdef"?right_pad(5, "-")}]
+[${"abcdefg"?right_pad(5, "-")}]
+[${"abcdefgh"?right_pad(5, "-")}]
+[${""?right_pad(8, ".oO")}]
+[${"a"?right_pad(8, ".oO")}]
+[${"ab"?right_pad(8, ".oO")}]
+[${"abc"?right_pad(8, ".oO")}]
+[${"abcd"?right_pad(8, ".oO")}]
+[${"abcde"?right_pad(8, ".oO")}]
+[${"abcdef"?right_pad(8, ".oO")}]
+[${"abcdefg"?right_pad(8, ".oO")}]
+[${"abcdefgh"?right_pad(8, ".oO")}]
+[${"abcdefghi"?right_pad(8, ".oO")}]
+[${"abcdefghij"?right_pad(8, ".oO")}]
+[${""?right_pad(0, r"/\_")}]
+[${""?right_pad(1, r"/\_")}]
+[${""?right_pad(2, r"/\_")}]
+[${""?right_pad(3, r"/\_")}]
+[${""?right_pad(4, r"/\_")}]
+[${""?right_pad(5, r"/\_")}]
+[${""?right_pad(6, r"/\_")}]
+[${""?right_pad(7, r"/\_")}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins3.ftl
new file mode 100644
index 0000000..77389fa
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins3.ftl
@@ -0,0 +1,225 @@
+<#--
+  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.
+-->
+<@assertEquals expected='foo' actual='foo'?keep_before('x') />
+<@assertEquals expected='f' actual='foo'?keep_before('o') />
+<@assertEquals expected='' actual='foo'?keep_before('f') />
+<@assertEquals expected='fo' actual='foobar'?keep_before('ob') />
+<@assertEquals expected='foob' actual='foobar'?keep_before('ar') />
+<@assertEquals expected='' actual='foobar'?keep_before('foobar') />
+<@assertEquals expected='' actual='foobar'?keep_before('') />
+<@assertEquals expected='' actual='foobar'?keep_before('', 'r') />
+<@assertEquals expected='FOO' actual='FOO'?keep_before('o') />
+<@assertEquals expected='F' actual='FOO'?keep_before('o', 'i') />
+<@assertEquals expected='fo' actual='fo.o'?keep_before('.') />
+<@assertEquals expected='' actual='fo.o'?keep_before('.', 'r') />
+<@assertEquals expected='FOOb' actual='FOObaar'?keep_before(r'([a-z])\1', 'r') />
+<@assertEquals expected='F' actual='FOObaar'?keep_before(r'([a-z])\1', 'ri') />
+<@assertEquals expected='foo' actual="foo : bar"?keep_before(r"\s*:\s*", "r") />
+<@assertEquals expected='foo' actual="foo:bar"?keep_before(r"\s*:\s*", "r") />
+<@assertFails message='"m" flag'>
+    ${'x'?keep_before('x', 'm')}
+</...@assertFails>
+<@assertFails message='3'>
+    ${'x'?keep_before('x', 'i', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?keep_before()}
+</...@assertFails>
+
+<@assertEquals expected='' actual=''?keep_before_last('f') />
+<@assertEquals expected='ff' actual='fff'?keep_before_last('f') />
+<@assertEquals expected='' actual='foo'?keep_before_last('f') />
+<@assertEquals expected='' actual='f'?keep_before_last('f') />
+<@assertEquals expected='a.b' actual='a.b.txt'?keep_before_last('.') />
+<@assertEquals expected='ab' actual='ab'?keep_before_last('.') />
+<@assertEquals expected='a' actual='ab'?keep_before_last('.', 'r') />
+<@assertEquals expected='ab' actual='ab'?keep_before_last(r'\.', 'r') />
+<@assertEquals expected='af' actual='afFf'?keep_before_last('F') />
+<@assertEquals expected='afF' actual='afFf'?keep_before_last('F', 'i') />
+<@assertEquals expected='1a2' actual='1a2b3'?keep_before_last('[ab]', 'r') />
+<@assertEquals expected='aa' actual='aaabb'?keep_before_last('[ab]{3}', 'r') />
+<@assertEquals expected='aaabbx' actual='aaabbxbabe'?keep_before_last('[ab]{3}', 'r') />
+<@assertEquals expected='xxxaa' actual='xxxaaayyy'?keep_before_last('a+', 'r') />
+<@assertEquals expected='foobar' actual='foobar'?keep_before_last('') />
+<@assertEquals expected='foobar' actual='foobar'?keep_before_last('', 'r') />
+<@assertFails message='"m" flag'>
+    ${'x'?keep_before_last('x', 'm')}
+</...@assertFails>
+<@assertFails message='3'>
+    ${'x'?keep_before_last('x', 'i', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?keep_before_last()}
+</...@assertFails>
+
+<@assertEquals expected='' actual='foo'?keep_after('x') />
+<@assertEquals expected='o' actual='foo'?keep_after('o') />
+<@assertEquals expected='oo' actual='foo'?keep_after('f') />
+<@assertEquals expected='ar' actual='foobar'?keep_after('ob') />
+<@assertEquals expected='' actual='foobar'?keep_after('ar') />
+<@assertEquals expected='' actual='foobar'?keep_after('foobar') />
+<@assertEquals expected='foobar' actual='foobar'?keep_after('') />
+<@assertEquals expected='foobar' actual='foobar'?keep_after('', 'r') />
+<@assertEquals expected='' actual='FOO'?keep_after('o') />
+<@assertEquals expected='O' actual='FOO'?keep_after('o', 'i') />
+<@assertEquals expected='o' actual='fo.o'?keep_after('.') />
+<@assertEquals expected='o.o' actual='fo.o'?keep_after('.', 'r') />
+<@assertEquals expected='r' actual='FOObaar'?keep_after(r'([a-z])\1', 'r') />
+<@assertEquals expected='baar' actual='FOObaar'?keep_after(r'([a-z])\1', 'ri') />
+<@assertEquals expected='bar' actual="foo : bar"?keep_after(r"\s*:\s*", "r") />
+<@assertEquals expected='bar' actual="foo:bar"?keep_after(r"\s*:\s*", "r") />
+<@assertFails message='"m" flag'>
+    ${'x'?keep_after('x', 'm')}
+</...@assertFails>
+<@assertFails message='3'>
+    ${'x'?keep_after('x', 'i', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?keep_after()}
+</...@assertFails>
+
+<@assertEquals expected='' actual=''?keep_after_last('f') />
+<@assertEquals expected='' actual='fff'?keep_after_last('f') />
+<@assertEquals expected='' actual='oof'?keep_after_last('f') />
+<@assertEquals expected='' actual='f'?keep_after_last('f') />
+<@assertEquals expected='txt' actual='a.b.txt'?keep_after_last('.') />
+<@assertEquals expected='' actual='ab'?keep_after_last('.') />
+<@assertEquals expected='' actual='ab'?keep_after_last('.', 'r') />
+<@assertEquals expected='' actual='ab'?keep_after_last(r'\.', 'r') />
+<@assertEquals expected='fa' actual='fFfa'?keep_after_last('F') />
+<@assertEquals expected='a' actual='fFfa'?keep_after_last('F', 'i') />
+<@assertEquals expected='3' actual='1a2b3'?keep_after_last('[ab]', 'r') />
+<@assertEquals expected='' actual='aaabb'?keep_after_last('[ab]{3}', 'r') />
+<@assertEquals expected='x' actual='aaabbx'?keep_after_last('[ab]{3}', 'r') />
+<@assertEquals expected='e' actual='aaabbxbabe'?keep_after_last('[ab]{3}', 'r') />
+<@assertEquals expected='12345' actual='aaabb12345'?keep_after_last('[ab]{3}', 'r') />
+<@assertEquals expected='yyy' actual='xxxaaayyy'?keep_after_last('a+', 'r') />
+<@assertEquals expected='' actual='foobar'?keep_after_last('') />
+<@assertEquals expected='' actual='foobar'?keep_after_last('', 'r') />
+<@assertFails message='"m" flag'>
+    ${'x'?keep_after_last('x', 'm')}
+</...@assertFails>
+<@assertFails message='3'>
+    ${'x'?keep_after_last('x', 'i', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?keep_after_last()}
+</...@assertFails>
+
+<@assertEquals expected='foo' actual='foo'?remove_beginning('x') />
+<@assertEquals expected='foo' actual='foo'?remove_beginning('o') />
+<@assertEquals expected='foo' actual='foo'?remove_beginning('fooo') />
+<@assertEquals expected='oo' actual='foo'?remove_beginning('f') />
+<@assertEquals expected='o' actual='foo'?remove_beginning('fo') />
+<@assertEquals expected='' actual='foo'?remove_beginning('foo') />
+<@assertEquals expected='foo' actual='foo'?remove_beginning('') />
+<@assertFails message='2'>
+    ${'x'?remove_beginning('x', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?remove_beginning()}
+</...@assertFails>
+
+<@assertEquals expected='bar' actual='bar'?remove_ending('x') />
+<@assertEquals expected='bar' actual='bar'?remove_ending('a') />
+<@assertEquals expected='bar' actual='bar'?remove_ending('barr') />
+<@assertEquals expected='ba' actual='bar'?remove_ending('r') />
+<@assertEquals expected='b' actual='bar'?remove_ending('ar') />
+<@assertEquals expected='' actual='bar'?remove_ending('bar') />
+<@assertEquals expected='bar' actual='bar'?remove_ending('') />
+<@assertFails message='2'>
+    ${'x'?remove_ending('x', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?remove_ending()}
+</...@assertFails>
+
+<@assertEquals expected='xfoo' actual='foo'?ensure_starts_with('x') />
+<@assertEquals expected='foo' actual='foo'?ensure_starts_with('f') />
+<@assertEquals expected='foo' actual='foo'?ensure_starts_with('foo') />
+<@assertEquals expected='fooofoo' actual='foo'?ensure_starts_with('fooo') />
+<@assertEquals expected='foo' actual='foo'?ensure_starts_with('') />
+<@assertEquals expected='x' actual=''?ensure_starts_with('x') />
+<@assertEquals expected='' actual=''?ensure_starts_with('') />
+<@assertEquals expected='bacdef' actual="bacdef"?ensure_starts_with("[ab]{2}", "ab") />
+<@assertEquals expected='bacdef' actual="bacdef"?ensure_starts_with("^[ab]{2}", "ab") />
+<@assertEquals expected='abcacdef' actual="cacdef"?ensure_starts_with("[ab]{2}", "ab") />
+<@assertEquals expected='abcacdef' actual="cacdef"?ensure_starts_with("^[ab]{2}", "ab") />
+<@assertEquals expected='ab!cdef' actual="cdef"?ensure_starts_with("ab", "ab!") />
+<@assertEquals expected='ab!ABcdef' actual="ABcdef"?ensure_starts_with("ab", "ab!") />
+<@assertEquals expected='ABcdef' actual="ABcdef"?ensure_starts_with("ab", "ab!", 'i') />
+<@assertEquals expected='abABcdef' actual="ABcdef"?ensure_starts_with(".b", "ab", 'i') />
+<@assertEquals expected='ABcdef' actual="ABcdef"?ensure_starts_with(".b", "ab", 'ri') />
+<@assertEquals expected='http://example.com' actual="example.com"?ensure_starts_with("[a-z]+://", "http://") />
+<@assertEquals expected='http://example.com' actual="http://example.com"?ensure_starts_with("[a-z]+://", "http://") />
+<@assertEquals expected='https://example.com' actual="https://example.com"?ensure_starts_with("[a-z]+://", "http://") />
+<@assertEquals expected='http://HTTP://example.com' actual="HTTP://example.com"?ensure_starts_with("[a-z]+://", "http://") />
+<@assertEquals expected='HTTP://example.com' actual="HTTP://example.com"?ensure_starts_with("[a-z]+://", "http://", "ir") />
+<@assertFails message='4'>
+    ${'x'?ensure_starts_with('x', 'x', 'x', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?ensure_starts_with()}
+</...@assertFails>
+
+<@assertEquals expected='foox' actual='foo'?ensure_ends_with('x') />
+<@assertEquals expected='foo' actual='foo'?ensure_ends_with('o') />
+<@assertEquals expected='foo' actual='foo'?ensure_ends_with('foo') />
+<@assertEquals expected='foofooo' actual='foo'?ensure_ends_with('fooo') />
+<@assertEquals expected='foo' actual='foo'?ensure_ends_with('') />
+<@assertEquals expected='x' actual=''?ensure_ends_with('x') />
+<@assertEquals expected='' actual=''?ensure_ends_with('') />
+<@assertFails message='2'>
+    ${'x'?ensure_ends_with('x', 'x')}
+</...@assertFails>
+<@assertFails message='none'>
+    ${'x'?ensure_ends_with()}
+</...@assertFails>
+
+<@assertEquals expected='a' actual=1?lower_abc />
+<@assertEquals expected='b' actual=2?lower_abc />
+<@assertEquals expected='z' actual=26?lower_abc />
+<@assertEquals expected='aa' actual=27?lower_abc />
+<@assertEquals expected='ab' actual=28?lower_abc />
+<@assertEquals expected='cv' actual=100?lower_abc />
+<@assertFails messageRegexp='0|at least 1']>
+    ${0?lower_abc}
+</...@assertFails>
+<@assertFails messageRegexp='0|at least 1'>
+    ${-1?lower_abc}
+</...@assertFails>
+<@assertFails messageRegexp='1.00001|integer'>
+    ${1.00001?lower_abc}
+</...@assertFails>
+
+<@assertEquals expected='A' actual=1?upper_abc />
+<@assertEquals expected='B' actual=2?upper_abc />
+<@assertEquals expected='Z' actual=26?upper_abc />
+<@assertEquals expected='AA' actual=27?upper_abc />
+<@assertEquals expected='AB' actual=28?upper_abc />
+<@assertEquals expected='CV' actual=100?upper_abc />
+<@assertFails messageRegexp='0|at least 1']>
+    ${0?upper_abc}
+</...@assertFails>
+<@assertFails messageRegexp='0|at least 1'>
+    ${-1?upper_abc}
+</...@assertFails>
+<@assertFails messageRegexp='1.00001|integer'>
+    ${1.00001?upper_abc}
+</...@assertFails>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringbimethods.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringbimethods.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringbimethods.ftl
new file mode 100644
index 0000000..1d31c44
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringbimethods.ftl
@@ -0,0 +1,36 @@
+<#--
+  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.
+-->
+<#setting locale="en_US">
+<#assign x = 3>
+${x?string["0.00"]}
+${x?string("0.00")}
+${'01:02:03'?time.iso?string["iso ms nz"]}
+${'01:02:03'?time.iso?string("iso ms nz")}
+---
+${multi}
+<#assign a = true>
+<#assign b = false>
+${a?string} ${b?string}
+${a?string("yes", "no")} ${b?string("yes", "no")}
+<#setting boolean_format="igen,nem"/>
+${a?string} ${b?string}
+<#setting number_format="0.0">
+${a?string(0, 1)} ${b?string(0, 1)}
+<#setting boolean_format="true,false"/>
+${a?string(0, 1)?is_string?string} ${b?string(0, 1)?is_string?string}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringliteral.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringliteral.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringliteral.ftl
new file mode 100644
index 0000000..436c632
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/stringliteral.ftl
@@ -0,0 +1,69 @@
+<#--
+  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.
+-->
+<html>
+<head>
+  <title>FreeMarker: String literal test</title>
+  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<#assign x = "Hello", y = "World">
+<#assign message = "${x}, ${y}!">
+
+${message}
+
+<p>
+[${""}] = []<br>
+[${"a"}] = [a]<br>
+[${"abcdef"}] = [abcdef]<br>
+[${"\""}] = ["]<br>
+[${"\"\"\""}] = ["""]<br>
+[${"a\""}] = [a"]<br>
+[${"\"a"}] = ["a]<br>
+[${"a\"b"}] = [a"b]<br>
+[${"a\nb"}] = [a
+b]<br>
+[${"'"}] = [']<br>
+[${"a'a"}] = [a'a]<br>
+[${"\"\'\n\r\f\b\t\l\a\g"}]<br>
+[${"\xA\x0A\x00A\x000A\x0000A"}]<br>
+[${"\x15Bz\x15b"}]<br>
+[${"\x010Cz\x010c"}]<br>
+
+<p>
+[${''}] = []<br>
+[${'a'}] = [a]<br>
+[${'abcdef'}] = [abcdef]<br>
+[${'"'}] = ["]<br>
+[${'"""'}] = ["""]<br>
+[${'a"'}] = [a"]<br>
+[${'"a'}] = ["a]<br>
+[${'a"b'}] = [a"b]<br>
+[${'a\nb'}] = [a
+b]<br>
+[${'\''}] = [']<br>
+[${'a\'a'}] = [a'a]<br>
+[${'\"\'\n\r\f\b\t\l\a\g'}]<br>
+[${'\xA\x0A\x00A\x000A\x0000A'}]<br>
+[${'\x15Bz\x15b'}]<br>
+[${'\x010Cz\x010c'}]<br>
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir.ftl
new file mode 100644
index 0000000..cd24873
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir.ftl
@@ -0,0 +1,27 @@
+<#--
+  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.
+-->
+<p>This is include-subdir.ftl</p>
+<p>Testing including from same directory</p>
+<#include "include-subdir2.ftl">
+<p>Testing including from relative parent</p>
+<#include "../included.ftl">
+<p>Testing including from loader root</p>
+<#include "/included.ftl">
+<p>Testing including through acquisition</p>
+<#include "*/subdir/include-subdir2.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir2.ftl
new file mode 100644
index 0000000..356fcb2
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/include-subdir2.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+<p>This is include-subdir2.ftl</p>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin-2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin-2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin-2.ftl
new file mode 100644
index 0000000..fafe593
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin-2.ftl
@@ -0,0 +1,24 @@
+<#--
+  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.
+-->
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("works")}
+<#attempt>
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel2"?new("works")}
+<#recover>
+fails
+</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin.ftl
new file mode 100644
index 0000000..cc37004
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/new-optin.ftl
@@ -0,0 +1,26 @@
+<#--
+  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.
+-->
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("works")}
+<#attempt>
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel2"?new("works")}
+<#recover>
+fails
+</#attempt>
+
+<#include "new-optin-2.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/subsub/new-optin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/subsub/new-optin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/subsub/new-optin.ftl
new file mode 100644
index 0000000..fafe593
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/subdir/subsub/new-optin.ftl
@@ -0,0 +1,24 @@
+<#--
+  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.
+-->
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel"?new("works")}
+<#attempt>
+${"org.apache.freemarker.core.templatesuite.models.NewTestModel2"?new("works")}
+<#recover>
+fails
+</#attempt>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch-builtin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch-builtin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch-builtin.ftl
new file mode 100644
index 0000000..7441733
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch-builtin.ftl
@@ -0,0 +1,54 @@
+<#--
+  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.
+-->
+<@assertEquals expected="A" actual="a"?switch("a", "A") />
+<@assertFails message="didn't match">${"b"?switch("a", "A")}</@>
+<@assertEquals expected="D" actual="b"?switch("a", "A", "D") />
+<@assertEquals expected="B" actual="b"?switch("a", "A", "b", "B") />
+<@assertFails message="didn't match">${"c"?switch("a", "A", "b", "B")}</@>
+<@assertEquals expected="D" actual="c"?switch("a", "A", "b", "B", "D") />
+
+<#assign out = "">
+<#assign fInvocationCnt = 0>
+<#list 0..5 as x>
+  <#assign out += x?switch(1, f("one"), 2, f("two"), 3, f("three"), f("default")) + ";">
+</#list>
+<@assertEquals expected="default;one;two;three;default;default;" actual=out />
+<@assertEquals expected=6 actual=fInvocationCnt />
+
+<#assign out = "">
+<#list 0..5 as x>
+  <#assign out += true?switch(x <= 1, "low", x == 2 || x == 3, "medium", x >= 3, "high") + ";">
+</#list>
+<@assertEquals expected="low;low;medium;medium;high;high;" actual=out />
+
+<#function f x>
+  <#assign fInvocationCnt++>
+  <#return x>
+</#function>
+
+<@assertFails message="noSuchVar1">${1?switch(noSuchVar1, noSuchVar2)}</@>
+<@assertFails message="noSuchVar2">${1?switch(1, noSuchVar2)}</@>
+<@assertFails message="noSuchVar3">${noSuchVar3?switch(1, 1)}</@>
+
+<@assertEquals expected="one" actual=1?switch(1, "one", "2", "two") />
+<@assertFails messageRegexp="Can't compare.+number.+string">${2?switch(1, "one", "2", "two")}</@>
+<@assertFails messageRegexp="Can't compare.+number.+string">${2?switch(1, "one", "2", "two", "default")}</@>
+
+<#assign out><#escape x as x?switch(2 * x, "zero", 1, "one", x, x?string("0.0"))>${0} ${1} ${2}</#escape></#assign>
+<@assertEquals expected="zero one 2.0" actual=out />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch.ftl
new file mode 100644
index 0000000..6bbab3c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/switch.ftl
@@ -0,0 +1,139 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Switch-Case Test</title>
+</head>
+<body>
+
+<p>Here we iterate over a list of animals.</p>
+<#assign animalList = [ "aardvark", "kiwi", "gecko", "cat", "dog", "elephant",
+    "squirrel", "zebra" ]>
+<#assign favoriteAnimal = "kiwi">
+
+<#list animalList as animal>
+<p>Animal is: ${animal}.<br />
+<#switch animal>
+    <#case "zebra">
+        This is the HTML for a large stripey animal.
+    <#case "elephant">
+    <#case "rhinocerous">
+        This is the HTML for large animals.
+        <#break>
+    <#case "squirrel">
+    <#case "gecko">
+        This is the HTML for small animals.
+        <#break>
+    <#case favoriteAnimal>
+        This is the HTML for the user's favorite animal.
+        <#break>
+    <#default>
+        This is the HTML for other animals.
+        <#break>
+</#switch>
+</p>
+</#list>
+
+<#-- Nesting and no-match -->
+<#list [ 1, 2, 3 ] as x>
+  <#switch x>
+    <#case 1>
+      1
+      <#switch x*2>
+        <#case 1>
+          i1
+          <#break>
+        <#case 2>
+          i2
+          <#break>
+        <#case 3>
+          i3
+          <#break>
+        <#case 4>
+          i4
+          <#break>
+        <#case 6>
+          i6
+          <#break>
+      </#switch>
+      <#break>     
+    <#case 2>
+      2
+      <#switch x*2>
+        <#case 1>
+          i1
+          <#break>
+        <#case 2>
+          i2
+          <#break>
+        <#case 3>
+          i3
+          <#break>
+        <#case 4>
+          i4
+          <#-- falls through -->
+        <#case 5>
+          ft
+          <#-- falls through -->
+      </#switch>
+      ft
+      <#-- falls through -->     
+    <#case 3>
+      3
+      <#switch x*2>
+        <#case 1>
+          i1
+          <#break>
+        <#case 2>
+          i2
+          <#break>
+        <#case 3>
+          i3
+          <#break>
+        <#case 4>
+          i4
+          <#break>
+        <#case 6>
+          i6
+          <#break>
+      </#switch>
+      <#break>     
+  </#switch>
+</#list>
+
+<#-- No match -->
+[<#switch 213>
+  <#case 1>sadas
+</#switch>]
+
+<#-- Fall-through -->
+<#list [ 0, 1, 2, 3, 4 ] as x>
+  "<#switch x><#case 1>1<#case 2>2<#case 3>3<#case 4>4</#switch>"
+</#list>
+
+<#-- Legacy parser bug: #default might not be the last, but it doesn't fall through if called directly -->
+<#list [1, 2, 3, 4, 5] as x>
+  "<#switch x><#case 1>1<#case 2>2<#default>default<#case 4>4<#case 5>5</#switch>"
+</#list>
+
+<#-- two #default-s are parsing error -->
+<@assertFails message="can only have one default"><@"<#switch 1><#case 1><#default><#default></#switch>"?interpret /></@>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/then-builtin.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/then-builtin.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/then-builtin.ftl
new file mode 100644
index 0000000..de809e1
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/then-builtin.ftl
@@ -0,0 +1,53 @@
+<#--
+  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.
+-->
+<#assign f1InvocationCnt = 0>
+<#assign f2InvocationCnt = 0>
+
+<@assertEquals expected="f1 1" actual=true?then(f1(), f2()) />
+<@assertEquals expected="f2 1" actual=false?then(f1(), f2()) />
+<@assertEquals expected="f1 2" actual=true?then(f1(), f2()) />
+<@assertEquals expected="f2 2" actual=false?then(f1(), f2()) />
+<@assertEquals expected=2 actual=f1InvocationCnt />
+<@assertEquals expected=2 actual=f2InvocationCnt />
+
+<#function f1>
+  <#assign f1InvocationCnt++>
+  <#return "f1 " + f1InvocationCnt>
+</#function>
+
+<#function f2>
+  <#assign f2InvocationCnt++>
+  <#return "f2 " + f2InvocationCnt>
+</#function>
+
+<#assign x = 1>
+<@assertEquals expected='Y' actual=(x < 2 * x)?then(-x < x, false)?then('Y', 'N') />
+
+<@assertEquals expected=1 actual=true?then(x, noSuchVar) />
+<@assertEquals expected=1 actual=false?then(noSuchVar, x) />
+
+<@assertFails message="noSuchVar1">${true?then(noSuchVar1, noSuchVar2)}</@>
+<@assertFails message="noSuchVar2">${false?then(noSuchVar1, noSuchVar2)}</@>
+<@assertFails message="noSuchVar3">${noSuchVar3?then(noSuchVar1, noSuchVar2)}</@>
+
+<#assign out><#escape x as x?then(1, 0)>${false} ${true}</#escape></#assign>
+<@assertEquals expected="0 1" actual=out />
+
+<#assign out><#escape x as (x < 0)?then(-x * 3, x * 2)>${-1} ${1}</#escape></#assign>
+<@assertEquals expected="3 2" actual=out />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/transforms.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/transforms.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/transforms.ftl
new file mode 100644
index 0000000..9b1e55a
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/transforms.ftl
@@ -0,0 +1,100 @@
+<#--
+  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.
+-->
+<#assign htmlEscape = "org.apache.freemarker.core.util.HtmlEscape"?new(),
+         utility = "org.apache.freemarker.core.templatesuite.models.TransformHashWrapper"?new()>
+<html>
+<head>
+<title>FreeMarker: Transformation Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<@htmlEscape>
+<p>${message}</p>
+</...@htmlEscape>
+
+<P>Now try the Utility package:</p>
+<p>${utility}</p>
+
+<@utility.htmlEscape>
+<p>${utility}</p>
+</@>
+
+<p>Now some nested transforms:</p>
+<@utility.compress>
+<p    >This tests the compress transformation</p >
+</@>
+<@utility.compress>
+<@utility.htmlEscape>
+<p    >This tests the compress transformation</p >
+</@>
+</...@utility.compress>
+<#assign html_transform = "org.apache.freemarker.core.util.HtmlEscape"?new() />
+<@html_transform><#--Using the transform via an instantiation -->
+<@utility.compress>
+<p    >This tests the compress transformation</p >
+</@>
+</@>
+
+<p>Now try method and transform interactions:</p>
+<@utility.escape("xml")>
+<p>This isn't a valid XML string.</p>
+</@>
+<@utility.escape("html")>
+<p>This isn't a valid HTML string.</p>
+</@>
+
+<p>A more advanced interaction involves getting a TemplateMethodModel
+to initialise a TemplateTransformModel, as follow:</p>
+
+<@utility.special("This is a comment")>
+Comment: *
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+</@>
+
+<@utility.special("This is a second comment", "quote")>
+Comment: *
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+</@>
+<@utility.special("This is a third comment", "ampersand", "quote")>
+Comment: *
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+</@>
+<@utility.special("tag", utility)>
+Comment: *
+
+A test string containing quotes: "This isn't a test".
+A test string containing amps: Fish & Chips.
+A test string containing tags: <p>Fish &amp; Chips.</p>
+</@>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/type-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/type-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/type-builtins.ftl
new file mode 100644
index 0000000..cb0f576
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/type-builtins.ftl
@@ -0,0 +1,44 @@
+<#--
+  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.
+-->
+<#setting boolean_format="1,0">
+StNuBoMeTaMaHaHxSeCoCxEnInDiNo
+<#list [
+  "a", 1, false,
+  testmethod, testmacro, html_escape,
+  {"a":1}, [1], testcollection, testcollectionEx,
+  testnode,
+  bean, bean.m, bean.mOverloaded
+] as x>
+  ${x?is_string} <#t>
+  ${x?is_number} <#t>
+  ${x?is_boolean} <#t>
+  ${x?is_method} <#t>
+  ${x?is_macro} <#t>
+  ${x?is_transform} <#t>
+  ${x?is_hash} <#t>
+  ${x?is_hash_ex} <#t>
+  ${x?is_sequence} <#t>
+  ${x?is_collection} <#t>
+  ${x?is_collection_ex} <#t>
+  ${x?is_enumerable} <#t>
+  ${x?is_indexable} <#t>
+  ${x?is_directive} <#t>
+  ${x?is_node}<#lt>
+</#list>
+<#macro testmacro></#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/undefined.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/undefined.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/undefined.ftl
new file mode 100644
index 0000000..2ca96ac
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/undefined.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+${undefined_variable}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/url.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/url.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/url.ftl
new file mode 100644
index 0000000..814de80
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/url.ftl
@@ -0,0 +1,24 @@
+<#--
+  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.
+-->
+<#setting url_escaping_charset="utf-8">
+<#assign s = 'a/báb?c/x;y=1' />
+<@assertEquals expected='a%2Fb%E1b%3Fc%2Fx%3By%3D1' actual=s?url('ISO-8859-1') />
+<@assertEquals expected='a%2Fb%C3%A1b%3Fc%2Fx%3By%3D1' actual=s?url />
+<@assertEquals expected='a/b%E1b%3Fc/x%3By%3D1' actual=s?url_path('ISO-8859-1') />
+<@assertEquals expected='a/b%C3%A1b%3Fc/x%3By%3D1' actual=s?url_path />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/var-layers.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/var-layers.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/var-layers.ftl
new file mode 100644
index 0000000..25333de
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/var-layers.ftl
@@ -0,0 +1,39 @@
+<#--
+  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.
+-->
+<#import "varlayers_lib.ftl" as lib>
+<@foo 1/>
+${x} = ${.data_model.x} = ${.globals.x}
+<#assign x = 5>
+${x} = ${.main.x} = ${.namespace.x}
+<#global x = 6>
+${.globals.x} but ${.data_model.x} = 4
+${y} = ${.globals.y} = ${.data_model.y?default("ERROR")}
+Invisiblity test 1.: <#if .main.y?exists || .namespace.y?exists>failed<#else>passed</#if>
+Invisiblity test 2.: <#if .main.z?exists || .namespace.z?exists>failed<#else>passed</#if>
+Invisiblity test 3.: <#global q = 1><#if .main.q?exists || .namespace.q?exists || .data_model.q?exists>failed<#else>passed</#if>
+--
+<@lib.foo/>
+--
+<#macro foo x>
+  ${x} = ${.locals.x}
+  <#local x = 2>
+  ${x} = ${.locals.x}
+  <#local y = 3>
+  ${y} = ${.locals.y}
+</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varargs.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varargs.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varargs.ftl
new file mode 100644
index 0000000..5e79aa7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varargs.ftl
@@ -0,0 +1,45 @@
+<#--
+  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.
+-->
+<#setting number_format="#">
+
+${m.bar()} == 0
+${m.bar([])} == 0
+${m.bar(11)} == 11
+${m.bar(null, 11)} == 11
+${m.bar(11, 22)} == 1122
+${m.bar(11.6, 22.4)} == 1122
+${m.bar(11, 22, 33)} == 112233
+${m.bar([11, 22, 33])} == 112233
+
+${m.bar2(11, [22, 33, 44])} == -22334411
+${m.bar2(11, 22, 33)} == -223311
+${m.bar2(11, 22)} == -2211
+${m.bar2(11)} == -11
+
+${m.overloaded()} == 0
+${m.overloaded(11)} == -11
+${m.overloaded(11, 22)} == 1122
+${m.overloaded(11, 22, 33)} == -112233
+${m.overloaded(11, 22, 33, 44)} == -11223344
+${m.overloaded([11, 22, 33, 44, 55])} == -1122334455
+
+${m.overloaded(11, 22)} == 1122
+${m.overloaded([11, 22])} == -1122
+
+${m.noVarArgs("string", true, 123, 1000000?number_to_date)} == string, true, 123, 1000000

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/variables.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/variables.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/variables.ftl
new file mode 100644
index 0000000..b927381
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/variables.ftl
@@ -0,0 +1,70 @@
+[#ftl]
+[#--
+  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.
+--]
+<html>
+<head>
+<title>FreeMarker: Variable Test</title>
+</head>
+<body>
+[#assign list = ["one", "two", "three", "four", "five"]]
+[#assign hash = {"output" : "My message.", "key" : list}]
+[#assign hash2 = {"value" : hash}]
+[#assign items = {"mykey" : "key", "_test", "out"}]
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Now get into variable nesting:</p>
+
+<p>${hash.output}</p>
+<p>${hash["output"]}</p>
+<p>${hash. output}</p>
+<p>${hash .output}</p>
+<p>${hash 
+    .output}</p>
+<p>${hash 
+    . output}</p>
+<p>${hash ["output"]}</p>
+<p>${hash
+    [ "output" ]}</p>
+
+<p>More deep nesting...</p>
+
+<p>${hash2.value.output}</p>
+<p>${hash2.value.key[0]}</p>
+<p>${hash2["value"]["key"][0]}</p>
+
+
+<p>Nesting inside nesting...</p>
+
+<p>${hash2.value[ items.mykey ][ 1 ]}</p>
+<p>${hash2.value[ items[ "mykey" ]][ 1 ]}</p>
+<p>${hash2.value[ items[ "my" + items.mykey ]][ 1 ]}</p>
+<p>${hash2.value[ items[ "my" + items["mykey"] ]][ 1 ]}</p>
+
+<p>Test underscores...</p>
+
+<p>${items[ "_test" ]}</p>
+<p>${items._test}</p>
+
+${"God save the queen."?word_list[1]?upper_case}
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varlayers_lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varlayers_lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varlayers_lib.ftl
new file mode 100644
index 0000000..9a1a471
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/varlayers_lib.ftl
@@ -0,0 +1,28 @@
+<#--
+  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.
+-->
+<#assign x1 = .data_model.x>
+<#assign x2 = x>
+<#assign z2 = z>
+<#macro foo>
+<@.main.foo 1/>
+  ${z} = ${z2} = ${x1} = ${.data_model.x}
+  5
+  ${x} == ${.globals.x}
+  ${y} == ${.globals.y} == ${.data_model.y?default("ERROR")}
+</#macro>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/whitespace-trim.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/whitespace-trim.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/whitespace-trim.ftl
new file mode 100644
index 0000000..9c10dd9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/whitespace-trim.ftl
@@ -0,0 +1,102 @@
+<#--
+  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.
+-->
+  LB<#lt>
+  LB<#lt>
+	LB<#lt>
+LB<#lt>
+  IB
+  IC1<#rt>
+  IC2<#rt>
+C1<#rt>
+C2<#rt>
+  ICS <#rt>
+CS1 <#rt>
+  CS2 <#t>
+  C3<#t>
+  C1<#t>
+C2
+B
+B
+  C1<#t>
+CB
+C1
+  C2<#t>
+  ICB
+  IC<#rt>
+  ICB
+  IC<#rt>
+  CB<#lt>
+--
+<#macro x t>${t}</#macro>
+  ${""}<@x t="LB"/><#lt>
+  <@x t="LB"/><#lt>${""}
+	<@x t="LB"/><#lt>${""}
+<@x t="LB"/><#lt>${""}
+  <@x t="IB"/>${""}
+${""}  <@x t="IC1"/><#rt>
+  <@x t="IC2"/><#rt>${""}
+${""}<@x t="C1"/><#rt>
+<@x t="C2"/><#rt>${""}
+  <@x t="ICS"/> <#rt>${""}
+<@x t="CS1"/> <#rt>${""}
+  <@x t="CS2"/> <#t>${""}
+  <@x t="C3"/><#t>
+  <@x t="C1"/><#t>
+<@x t="C2"/>${""}
+<#nt><@x t="B"/>
+<@x t="B"/><#nt>
+  <@x t="C1"/><#t>
+<@x t="CB"/>${""}
+<@x t="C1"/>${""}
+  <@x t="C2"/><#t>${""}
+  <@x t="ICB"/>${""}
+  ${""}<@x t="IC"/><#rt>
+  <@x t="ICB"/>${""}
+${""}  <@x t="IC"/><#rt>
+  <@x t="CB"/>${""}<#lt>
+--
+   <#lt>  IB
+  IC1<#rt>
+  <#assign x = 1> <#-- just a comment -->
+  C2<#t>
+  <#assign x = 1>
+  IB
+1<#t>
+  <#assign x = 1>
+2
+---
+<#t>1
+  <#t> 2
+  <#lt>3
+  4
+  <#rt>5
+  6
+---
+a
+  <#assign x = 1><#t>
+b<#t>  
+c
+---
+  <#if true>
+    <#t>foo
+  </#if>
+---
+  <#if true><#-- just a comment -->
+    foo<#t>
+  </#if>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wsstripinheader_inc.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wsstripinheader_inc.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wsstripinheader_inc.ftl
new file mode 100644
index 0000000..03cbfbe
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wsstripinheader_inc.ftl
@@ -0,0 +1,22 @@
+<#ftl strip_whitespace="yes">
+<#--
+  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.
+-->
+a
+<#assign x = 1>
+b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wstrip-in-header.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wstrip-in-header.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wstrip-in-header.ftl
new file mode 100644
index 0000000..0dce83c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/wstrip-in-header.ftl
@@ -0,0 +1,26 @@
+
+  
+
+  <#ftl strip_whitespace="no">
+<#--
+  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.
+-->
+a
+<#assign x = 1>
+b
+<#include "wsstripinheader_inc.ftl">
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-fragment.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-fragment.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-fragment.ftl
new file mode 100644
index 0000000..226215b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-fragment.ftl
@@ -0,0 +1,26 @@
+<#ftl ns_prefixes = {"n" : "http://x"}>
+<#--
+  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.
+-->
+${node?node_name} = b
+${node?root?node_name} = @document
+${node['/']?node_name} = @document
+
+${node['n:c']} = C<>&"']]>
+
+${node?root.@@markup}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-lib.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
new file mode 100644
index 0000000..0f0bde2
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-lib.ftl
@@ -0,0 +1,23 @@
+<#ftl ns_prefixes={ "n": "http://freemarker.org/test/bar", "D": "http://freemarker.org/test/namespace-test" }>
+<#--
+  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.
+-->
+<#global libResult>//n:e: ${doc['//n:e']}, ${doc.root['n:e']}</#global>
+<#macro m>
+//n:e: ${doc['//n:e']}, ${doc.root['n:e']}
+</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-main.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-main.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-main.ftl
new file mode 100644
index 0000000..5b7ce24
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml-ns_prefix-scope-main.ftl
@@ -0,0 +1,36 @@
+<#ftl ns_prefixes={
+    "D": "http://freemarker.org/test/namespace-test",
+    "n": "http://freemarker.org/test/foo",
+    "bar": "http://freemarker.org/test/bar"
+}>
+<#--
+  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.
+-->
+//e: ${doc['//D:e']}, ${doc.root.e}
+//n:e: ${doc['//n:e']}, ${doc.root['n:e']}
+//bar:e: ${doc['//bar:e']}, ${doc.root['bar:e']}
+
+Included:
+<#include "xml-ns_prefix-scope-lib.ftl">
+${libResult}
+<@m />
+
+Imported:
+<#import "xml-ns_prefix-scope-lib.ftl" as lib>
+${libResult}
+<@lib.m />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml.ftl
new file mode 100644
index 0000000..b85fc03
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xml.ftl
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<#-- test processing instructions -->
+<#global PIs = doc._content._ftype("p")>
+<#list PIs as pi>
+  ${pi}
+  ${pi["@target"]._text}
+  ${pi["@data"]._text}
+</#list>
+${PIs?size}
+<#global firstPi = PIs[0]>
+${firstPi._type}
+${firstPi["@customKey"]}
+${doc._registerNamespace("ns", "http://www.foo.com/ns1/")}
+${doc._descendant["ns:e11"]}
+${doc._descendant["ns:e12"]}
+<#global docRoot = doc["ns:root"]>
+${docRoot["ns:e1"]}
+${doc("//ns:e11")}
+${docRoot["ns:e1"]["@a1"]._name}
+${docRoot["ns:e1"]["@a2"]._text}
+${docRoot._children._parent._name}
+${docRoot._children._parent._unique._name}
+<#list doc._descendant as d>
+  ${d._name}
+</#list>
+<#list doc._descendant._ancestorOrSelf as d>
+  ${d._name}
+</#list>
+${docRoot["ns:e2"]["ns:e12"]._text}
+${docRoot["ns:e2"]["ns:e12"]._plaintext}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns1.ftl
new file mode 100644
index 0000000..8aa893e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns1.ftl
@@ -0,0 +1,53 @@
+<#ftl ns_prefixes = {"D" : "http://example.com/eBook"}>
+<#--
+  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.
+-->
+
+${doc.@@markup}
+
+<#recurse doc >
+
+<#macro book>
+  <html>
+    <head>
+      <title><#recurse .node.title></title>
+    </head>
+    <body>
+      <h1><#recurse .node.title></h1>
+      <#recurse>
+    </body>
+  </html>
+</#macro>
+
+<#macro chapter>
+  <h2><#recurse .node.title></h2>
+  <#recurse>
+</#macro>
+
+<#macro para>
+  <p><#recurse>
+</#macro>
+
+<#macro title>
+  <#--
+    We have handled this element imperatively,
+    so we do nothing here.
+  -->
+</#macro>
+
+<#macro @text>${.node?html}</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns3.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns3.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns3.ftl
new file mode 100644
index 0000000..c84ec69
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/xmlns3.ftl
@@ -0,0 +1,70 @@
+<#ftl ns_prefixes = {"x" : "http://x", "y" : "http://y"}>
+<#--
+  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.
+-->
+<#recurse doc >
+
+<#macro book>
+  <html>
+    <head>
+      <title><#recurse .node["x:title"]></title>
+    </head>
+    <body>
+      <h1><#recurse .node["x:title"]></h1>
+      <#recurse>
+    </body>
+  </html>
+</#macro>
+
+<#macro chapter>
+  <h2><#recurse .node["y:title"]></h2>
+  <#recurse>
+</#macro>
+
+<#macro "x:chapter">
+  <h2><#recurse .node["y:title"]></h2>
+  <#recurse>
+</#macro>
+
+<#macro para>
+  <p><#recurse>
+</#macro>
+
+<#macro "x:para">
+  <p><#recurse>
+</#macro>
+
+<#macro "y:para">
+  <p><#recurse>
+</#macro>
+
+<#macro "x:title">
+  <#--
+    We have handled this element imperatively,
+    so we do nothing here.
+  -->
+</#macro>
+
+<#macro "y:title">
+  <#--
+    We have handled this element imperatively,
+    so we do nothing here.
+  -->
+</#macro>
+
+<#macro @text>${.node?html}</#macro>
\ No newline at end of file



[17/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper1.java
new file mode 100644
index 0000000..0fc9205
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper1.java
@@ -0,0 +1,49 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.List;
+
+import org.apache.freemarker.core.model.TemplateMethodModel;
+import org.apache.freemarker.core.util.HtmlEscape;
+import org.apache.freemarker.core.util.XmlEscape;
+
+/**
+ * Simple test of the interaction between MethodModels and TransformModels.
+ */
+public class TransformMethodWrapper1 implements TemplateMethodModel {
+
+    /**
+     * Executes a method call.
+     *
+     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
+     * the values of the arguments passed to the method.
+     * @return the <tt>TemplateModel</tt> produced by the method, or null.
+     */
+    @Override
+    public Object exec(List arguments) {
+
+        if (( arguments.size() > 0 ) && ( arguments.get( 0 ).toString().equals( "xml" ))) {
+            return new XmlEscape();
+        } else {
+            return new HtmlEscape();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper2.java
new file mode 100644
index 0000000..75a5b68
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformMethodWrapper2.java
@@ -0,0 +1,64 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.freemarker.core.model.TemplateMethodModel;
+
+/**
+ * Another test of the interaction between MethodModels and TransformModels.
+ */
+public class TransformMethodWrapper2 implements TemplateMethodModel {
+
+    /**
+     * Executes a method call.
+     *
+     * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing
+     * the values of the arguments passed to the method.
+     * @return the <tt>TemplateModel</tt> produced by the method, or null.
+     */
+    @Override
+    public Object exec(List arguments) {
+        TransformModel1 cTransformer = new TransformModel1();
+        Iterator    iArgument = arguments.iterator();
+
+        // Sets up properties of the Transform model based on the arguments
+        // passed into this method
+
+        while ( iArgument.hasNext() ) {
+            String  aArgument = (String) iArgument.next();
+
+            if ( aArgument.equals( "quote" )) {
+                cTransformer.setQuotes( true );
+            } else if ( aArgument.equals( "tag" )) {
+                cTransformer.setTags( true );
+            } else if ( aArgument.equals( "ampersand" )) {
+                cTransformer.setAmpersands( true );
+            } else {
+                cTransformer.setComment( aArgument );
+            }
+        }
+
+        // Now return the transform class.
+        return cTransformer;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformModel1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformModel1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformModel1.java
new file mode 100644
index 0000000..2fac758
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/TransformModel1.java
@@ -0,0 +1,175 @@
+/*
+ * 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.templatesuite.models;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Map;
+
+import org.apache.freemarker.core.model.TemplateTransformModel;
+
+/**
+ * A TemplateTransformModel that includes properties. These properties can be
+ * set at model construction time, or, for the purposes of this demonstration,
+ * can be passed in from a wrapper TemplateMethodModel.
+ */
+public class TransformModel1 implements TemplateTransformModel {
+
+    private boolean m_bAmpersands = false;
+    private boolean m_bQuotes = false;
+    private boolean m_bTags = false;
+    private String  m_aComment = "";
+
+    private static final int READER_BUFFER_SIZE = 4096;
+
+    @Override
+    public Writer getWriter(final Writer out,
+                            final Map args) {
+        final StringBuilder buf = new StringBuilder();
+        return new Writer(out) {
+            @Override
+            public void write(char cbuf[], int off, int len) {
+                buf.append(cbuf, off, len);
+            }
+
+            @Override
+            public void flush() {
+            }
+
+            @Override
+            public void close() throws IOException {
+                StringReader sr = new StringReader(buf.toString());
+                StringWriter sw = new StringWriter();
+                transform(sr, sw);
+                out.write(sw.toString());
+            }
+        };
+    }
+
+
+    /**
+     * Indicates whether we escape ampersands. This property can be set either
+     * while the model is being constructed, or via a property passed in through
+     * a <code>TemplateMethodModel</code>.
+     */
+    public void setAmpersands( boolean bAmpersands ) {
+        m_bAmpersands = bAmpersands;
+    }
+
+    /**
+     * Indicates whether we escape quotes. This property can be set either
+     * while the model is being constructed, or via a property passed in through
+     * a <code>TemplateMethodModel</code>.
+     */
+    public void setQuotes( boolean bQuotes ) {
+        m_bQuotes = bQuotes;
+    }
+
+    /**
+     * Indicates whether we escape tags. This property can be set either
+     * while the model is being constructed, or via a property passed in through
+     * a <code>TemplateMethodModel</code>.
+     */
+    public void setTags( boolean bTags ) {
+        m_bTags = bTags;
+    }
+
+    /**
+     * Sets a comment for this transformation. This property can be set either
+     * while the model is being constructed, or via a property passed in through
+     * a <code>TemplateMethodModel</code>.
+     */
+    public void setComment( String aComment ) {
+        m_aComment = aComment;
+    }
+
+    /**
+     * Performs a transformation/filter on FreeMarker output.
+     *
+     * @param source the input to be transformed
+     * @param output the destination of the transformation
+     */
+    public void transform(Reader source, Writer output)
+    throws IOException {
+        // Output the source, converting unsafe certain characters to their
+        // equivalent entities.
+        int n = 0;
+        boolean bCommentSent = false;
+        char[]  aBuffer = new char[ READER_BUFFER_SIZE ];
+        int i = source.read( aBuffer );
+        while (i >= 0) {
+            for ( int j = 0; j < i; j++ ) {
+                char c = aBuffer[j];
+                switch (c) {
+                    case '&':
+                        if ( m_bAmpersands ) {
+                            output.write("&amp;");
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    case '<':
+                        if ( m_bTags ) {
+                            output.write("&lt;");
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    case '>':
+                        if ( m_bTags ) {
+                            output.write("&gt;");
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    case '"':
+                        if ( m_bQuotes ) {
+                            output.write("&quot;");
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    case '\'':
+                        if ( m_bQuotes ) {
+                            output.write("&apos;");
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    case '*':
+                        if ( ! bCommentSent ) {
+                            output.write( m_aComment );
+                            bCommentSent = true;
+                        } else {
+                            output.write( c );
+                        }
+                        break;
+                    default:
+                        output.write(c);
+                }
+                n++;
+            }
+            i = source.read( aBuffer );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/VarArgTestModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/VarArgTestModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/VarArgTestModel.java
new file mode 100644
index 0000000..9693733
--- /dev/null
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templatesuite/models/VarArgTestModel.java
@@ -0,0 +1,63 @@
+/*
+ * 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.templatesuite.models;
+
+import java.util.Date;
+
+public class VarArgTestModel {
+
+    public int bar(Integer... xs) {
+        int sum = 0;
+        for (Integer x : xs) {
+            if (x != null) {
+                sum *= 100;
+                sum += x;
+            }
+        }
+        return sum;
+    }
+
+    public int bar2(int first, int... xs) {
+        int sum = 0;
+        for (int x : xs) {
+            sum *= 100;
+            sum += x;
+        }
+        return -(sum * 100 + first);
+    }
+    
+    public int overloaded(int x, int y) {
+        return x * 100 + y;
+    }
+
+    public int overloaded(int... xs) {
+        int sum = 0;
+        for (int x : xs) {
+            sum *= 100;
+            sum += x;
+        }
+        return -sum;
+    }
+    
+    public String noVarArgs(String s, boolean b, int i, Date d) {
+        return s + ", " + b + ", " + i + ", " + d.getTime();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
deleted file mode 100644
index cf3c0f7..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
+++ /dev/null
@@ -1,515 +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.test.templatesuite;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.TreeSet;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.freemarker.core.ASTPrinter;
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.ConfigurationException;
-import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateDateModel;
-import org.apache.freemarker.core.model.TemplateMethodModel;
-import org.apache.freemarker.core.model.TemplateNodeModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.DefaultNonListCollectionAdapter;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.ResourceBundleModel;
-import org.apache.freemarker.core.model.impl.SimpleCollection;
-import org.apache.freemarker.core.model.impl.SimpleDate;
-import org.apache.freemarker.core.model.impl.SimpleNumber;
-import org.apache.freemarker.core.templateresolver.impl.ClassTemplateLoader;
-import org.apache.freemarker.core.util._NullArgumentException;
-import org.apache.freemarker.core.util._NullWriter;
-import org.apache.freemarker.core.util._StringUtil;
-import org.apache.freemarker.dom.NodeModel;
-import org.apache.freemarker.test.CopyrightCommentRemoverTemplateLoader;
-import org.apache.freemarker.test.TestConfigurationBuilder;
-import org.apache.freemarker.test.templatesuite.models.BooleanAndStringTemplateModel;
-import org.apache.freemarker.test.templatesuite.models.BooleanHash1;
-import org.apache.freemarker.test.templatesuite.models.BooleanHash2;
-import org.apache.freemarker.test.templatesuite.models.BooleanList1;
-import org.apache.freemarker.test.templatesuite.models.BooleanList2;
-import org.apache.freemarker.test.templatesuite.models.BooleanVsStringMethods;
-import org.apache.freemarker.test.templatesuite.models.JavaObjectInfo;
-import org.apache.freemarker.test.templatesuite.models.Listables;
-import org.apache.freemarker.test.templatesuite.models.MultiModel1;
-import org.apache.freemarker.test.templatesuite.models.OverloadedMethods2;
-import org.apache.freemarker.test.templatesuite.models.VarArgTestModel;
-import org.apache.freemarker.test.templateutil.AssertDirective;
-import org.apache.freemarker.test.templateutil.AssertEqualsDirective;
-import org.apache.freemarker.test.templateutil.AssertFailsDirective;
-import org.apache.freemarker.test.FileTestCase;
-import org.apache.freemarker.test.templateutil.NoOutputDirective;
-import org.apache.freemarker.test.XMLLoader;
-import org.junit.Ignore;
-import org.xml.sax.InputSource;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-import junit.framework.AssertionFailedError;
-
-/**
- * Instances of this are created and called by {@link TemplateTestSuite}. (It's on "Ignore" so that Eclipse doesn't try
- * to run this alone.) 
- */
-@Ignore
-public class TemplateTestCase extends FileTestCase {
-    
-    // Name of variables exposed to all test FTL-s:
-    private static final String ICI_INT_VALUE_VAR_NAME = "iciIntValue";
-    private static final String TEST_NAME_VAR_NAME = "testName";
-    private static final String JAVA_OBJECT_INFO_VAR_NAME = "javaObjectInfo";
-    private static final String NO_OUTPUT_VAR_NAME = "noOutput";
-    private static final String ASSERT_FAILS_VAR_NAME = "assertFails";
-    private static final String ASSERT_EQUALS_VAR_NAME = "assertEquals";
-    private static final String ASSERT_VAR_NAME = "assert";
-    
-    private final String simpleTestName;
-    private final String templateName;
-    private final String expectedFileName;
-    private final boolean noOutput;
-    
-    private final Configuration.ExtendableBuilder confB;
-    private final HashMap<String, Object> dataModel = new HashMap<>();
-    
-    public TemplateTestCase(String testName, String simpleTestName, String templateName, String expectedFileName, boolean noOutput,
-            Version incompatibleImprovements) {
-        super(testName);
-        _NullArgumentException.check("testName", testName);
-        
-        _NullArgumentException.check("simpleTestName", simpleTestName);
-        this.simpleTestName = simpleTestName;
-        
-        _NullArgumentException.check("templateName", templateName);
-        this.templateName = templateName;
-        
-        _NullArgumentException.check("expectedFileName", expectedFileName);
-        this.expectedFileName = expectedFileName;
-        
-        this.noOutput = noOutput;
-
-        confB = new TestConfigurationBuilder(incompatibleImprovements);
-    }
-    
-    public void setSetting(String param, String value) throws IOException {
-        if ("auto_import".equals(param)) {
-            StringTokenizer st = new StringTokenizer(value);
-            if (!st.hasMoreTokens()) fail("Expecting libname");
-            String libname = st.nextToken();
-            if (!st.hasMoreTokens()) fail("Expecting 'as <alias>' in autoimport");
-            String as = st.nextToken();
-            if (!as.equals("as")) fail("Expecting 'as <alias>' in autoimport");
-            if (!st.hasMoreTokens()) fail("Expecting alias after 'as' in autoimport");
-            String alias = st.nextToken();
-            confB.addAutoImport(alias, libname);
-        } else if ("source_encoding".equals(param)) {
-            confB.setSourceEncoding(Charset.forName(value));
-        // INCOMPATIBLE_IMPROVEMENTS is a list here, and was already set in the constructor.
-        } else if (!Configuration.ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY.equals(param)) {
-            try {
-                confB.setSetting(param, value);
-            } catch (ConfigurationException e) {
-                throw new RuntimeException(
-                        "Failed to set setting " +
-                        _StringUtil.jQuote(param) + " to " +
-                        _StringUtil.jQuote(value) + "; see cause exception.",
-                        e);
-            }
-        }
-    }
-    
-    /*
-     * This method just contains all the code to seed the data model 
-     * ported over from the individual classes. This seems ugly and unnecessary.
-     * We really might as well just expose pretty much 
-     * the same tree to all our tests. (JR)
-     */
-    @Override
-    @SuppressWarnings("boxing")
-    public void setUp() throws Exception {
-        confB.setTemplateLoader(
-                new CopyrightCommentRemoverTemplateLoader(
-                        new ClassTemplateLoader(TemplateTestCase.class, "templates")));
-        
-        DefaultObjectWrapper dow = new DefaultObjectWrapper.Builder(Configuration.VERSION_3_0_0).build();
-        
-        dataModel.put(ASSERT_VAR_NAME, AssertDirective.INSTANCE);
-        dataModel.put(ASSERT_EQUALS_VAR_NAME, AssertEqualsDirective.INSTANCE);
-        dataModel.put(ASSERT_FAILS_VAR_NAME, AssertFailsDirective.INSTANCE);
-        dataModel.put(NO_OUTPUT_VAR_NAME, NoOutputDirective.INSTANCE);
-
-        dataModel.put(JAVA_OBJECT_INFO_VAR_NAME, JavaObjectInfo.INSTANCE);
-        dataModel.put(TEST_NAME_VAR_NAME, simpleTestName);
-        dataModel.put(ICI_INT_VALUE_VAR_NAME, confB.getIncompatibleImprovements().intValue());
-        
-        dataModel.put("message", "Hello, world!");
-
-        if (simpleTestName.startsWith("api-builtin")) {
-            dataModel.put("map", ImmutableMap.of(1, "a", 2, "b", 3, "c"));
-            dataModel.put("list", ImmutableList.of(1, 2, 3));
-            dataModel.put("set", ImmutableSet.of("a", "b", "c"));
-            dataModel.put("s", "test");
-        } else if (simpleTestName.equals("default-object-wrapper")) {
-            dataModel.put("array", new String[] { "array-0", "array-1"});
-            dataModel.put("list", Arrays.asList("list-0", "list-1", "list-2"));
-            Map<Object, Object> tmap = new HashMap<>();
-            tmap.put("key", "value");
-            Object objKey = new Object();
-            tmap.put(objKey, "objValue");
-            dataModel.put("map", tmap);
-            dataModel.put("objKey", objKey);
-            dataModel.put("obj", new org.apache.freemarker.test.templatesuite.models.BeanTestClass());
-            dataModel.put("resourceBundle",
-                    new ResourceBundleModel(ResourceBundle.getBundle(
-                            "org.apache.freemarker.test.templatesuite.models.BeansTestResources"), dow));
-            dataModel.put("date", new GregorianCalendar(1974, 10, 14).getTime());
-            dataModel.put("statics", dow.getStaticModels());
-            dataModel.put("enums", dow.getEnumModels());
-        } else if (simpleTestName.equals("boolean")) {
-            dataModel.put( "boolean1", TemplateBooleanModel.FALSE);
-            dataModel.put( "boolean2", TemplateBooleanModel.TRUE);
-            dataModel.put( "boolean3", TemplateBooleanModel.TRUE);
-            dataModel.put( "boolean4", TemplateBooleanModel.TRUE);
-            dataModel.put( "boolean5", TemplateBooleanModel.FALSE);
-            
-            dataModel.put( "list1", new BooleanList1(dow) );
-            dataModel.put( "list2", new BooleanList2(dow) );
-    
-            dataModel.put( "hash1", new BooleanHash1() );
-            dataModel.put( "hash2", new BooleanHash2() );
-        } else if (simpleTestName.startsWith("dateformat")) {
-            GregorianCalendar cal = new GregorianCalendar(2002, 10, 15, 14, 54, 13);
-            cal.setTimeZone(TimeZone.getTimeZone("GMT"));
-            dataModel.put("date", new SimpleDate(cal.getTime(), TemplateDateModel.DATETIME));
-            dataModel.put("unknownDate", new SimpleDate(cal.getTime(), TemplateDateModel.UNKNOWN));
-            dataModel.put("javaGMT02", TimeZone.getTimeZone("GMT+02"));
-            dataModel.put("javaUTC", TimeZone.getTimeZone("UTC"));
-            dataModel.put("adaptedToStringScalar", new Object() {
-                @Override
-                public String toString() {
-                    return "GMT+02";
-                }
-            });
-            dataModel.put("sqlDate", new java.sql.Date(1273955885023L));
-            dataModel.put("sqlTime", new java.sql.Time(74285023L));
-        } else if (
-                templateName.equals("list.ftl") || templateName.equals("list2.ftl") || templateName.equals("list3.ftl")
-                || simpleTestName.equals("listhash")) {
-            dataModel.put("listables", new Listables());
-        } else if (simpleTestName.startsWith("number-format")) {
-            dataModel.put("int", new SimpleNumber(Integer.valueOf(1)));
-            dataModel.put("double", new SimpleNumber(Double.valueOf(1.0)));
-            dataModel.put("double2", new SimpleNumber(Double.valueOf(1 + 1e-15)));
-            dataModel.put("double3", new SimpleNumber(Double.valueOf(1e-16)));
-            dataModel.put("double4", new SimpleNumber(Double.valueOf(-1e-16)));
-            dataModel.put("bigDecimal", new SimpleNumber(java.math.BigDecimal.valueOf(1)));
-            dataModel.put("bigDecimal2", new SimpleNumber(java.math.BigDecimal.valueOf(1, 16)));
-        } else if (simpleTestName.equals("simplehash-char-key")) {
-            HashMap<String, String> mStringC = new HashMap<>();
-            mStringC.put("c", "string");
-            dataModel.put("mStringC", mStringC);
-            
-            HashMap<String, String> mStringCNull = new HashMap<>();
-            mStringCNull.put("c", null);
-            dataModel.put("mStringCNull", mStringCNull);
-            
-            HashMap<Character, String> mCharC = new HashMap<>();
-            mCharC.put(Character.valueOf('c'), "char");
-            dataModel.put("mCharC", mCharC);
-            
-            HashMap<String, String> mCharCNull = new HashMap<>();
-            mCharCNull.put("c", null);
-            dataModel.put("mCharCNull", mCharCNull);
-            
-            HashMap<Object, String> mMixed = new HashMap<>();
-            mMixed.put(Character.valueOf('c'), "char");
-            mMixed.put("s", "string");
-            mMixed.put("s2", "string2");
-            mMixed.put("s2n", null);
-            dataModel.put("mMixed", mMixed);
-        } else if (simpleTestName.equals("default-xmlns")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/defaultxmlns1.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.equals("multimodels")) {
-            dataModel.put("test", "selftest");
-            dataModel.put("self", "self");
-            dataModel.put("zero", Integer.valueOf(0));
-            dataModel.put("data", new MultiModel1());
-        } else if (simpleTestName.equals("stringbimethods")) {
-            dataModel.put("multi", new TestBoolean());
-        } else if (simpleTestName.startsWith("type-builtins")) {
-            dataModel.put("testmethod", new TestMethod());
-            dataModel.put("testnode", new TestNode());
-            dataModel.put("testcollection", new SimpleCollection(new ArrayList<>(), dow));
-            dataModel.put("testcollectionEx", DefaultNonListCollectionAdapter.adapt(new HashSet<>(), dow));
-            dataModel.put("bean", new TestBean());
-        } else if (simpleTestName.equals("date-type-builtins")) {
-            GregorianCalendar cal = new GregorianCalendar(2003, 4 - 1, 5, 6, 7, 8);
-            cal.setTimeZone(TimeZone.getTimeZone("UTC"));
-            Date d = cal.getTime();
-            dataModel.put("unknown", d);
-            dataModel.put("timeOnly", new java.sql.Time(d.getTime()));
-            dataModel.put("dateOnly", new java.sql.Date(d.getTime()));
-            dataModel.put("dateTime", new java.sql.Timestamp(d.getTime()));
-        } else if (simpleTestName.equals("var-layers")) {
-            dataModel.put("x", Integer.valueOf(4));
-            dataModel.put("z", Integer.valueOf(4));
-            confB.setSharedVariable("y", Integer.valueOf(7));
-        } else if (simpleTestName.equals("xml-fragment")) {
-            DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
-            f.setNamespaceAware(true);
-            DocumentBuilder db = f.newDocumentBuilder();
-            org.w3c.dom.Document doc = db.parse(new InputSource(getClass().getResourceAsStream("models/xmlfragment.xml")));
-            NodeModel.simplify(doc);
-            dataModel.put("node", NodeModel.wrap(doc.getDocumentElement().getFirstChild().getFirstChild()));
-        } else if (simpleTestName.equals("xmlns1")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.equals("xmlns2")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns2.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.equals("xmlns3") || simpleTestName.equals("xmlns4")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns3.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.equals("xmlns5")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/defaultxmlns1.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.equals("xml-ns_prefix-scope")) {
-            InputSource is = new InputSource(getClass().getResourceAsStream("models/xml-ns_prefix-scope.xml"));
-            NodeModel nm = XMLLoader.toModel(is);
-            dataModel.put("doc", nm);
-        } else if (simpleTestName.startsWith("sequence-builtins")) {
-            Set<String> abcSet = new TreeSet<>();
-            abcSet.add("a");
-            abcSet.add("b");
-            abcSet.add("c");
-            dataModel.put("abcSet", abcSet);
-            dataModel.put("abcSetNonSeq", DefaultNonListCollectionAdapter.adapt(abcSet, dow));
-            
-            List<String> listWithNull = new ArrayList<>();
-            listWithNull.add("a");
-            listWithNull.add(null);
-            listWithNull.add("c");
-            dataModel.put("listWithNull", listWithNull);
-            
-            List<String> listWithNullsOnly = new ArrayList<>();
-            listWithNull.add(null);
-            listWithNull.add(null);
-            listWithNull.add(null);
-            dataModel.put("listWithNullsOnly", listWithNullsOnly);
-            
-            dataModel.put("abcCollection", new SimpleCollection(abcSet, dow));
-            
-            Set<String> set = new HashSet<>();
-            set.add("a");
-            set.add("b");
-            set.add("c");
-            dataModel.put("set", set);
-        } else if (simpleTestName.equals("number-to-date")) {
-          dataModel.put("bigInteger", new BigInteger("1305575275540"));
-          dataModel.put("bigDecimal", new BigDecimal("1305575275539.5"));
-        } else if (simpleTestName.equals("varargs")) {
-          dataModel.put("m", new VarArgTestModel());
-        } else if (simpleTestName.startsWith("boolean-formatting")) {
-          dataModel.put("booleanAndString", new BooleanAndStringTemplateModel());
-          dataModel.put("booleanVsStringMethods", new BooleanVsStringMethods());
-        } else if (simpleTestName.startsWith("number-math-builtins")) {
-            dataModel.put("fNan", Float.valueOf(Float.NaN));
-            dataModel.put("dNan", Double.valueOf(Double.NaN));
-            dataModel.put("fNinf", Float.valueOf(Float.NEGATIVE_INFINITY));
-            dataModel.put("dPinf", Double.valueOf(Double.POSITIVE_INFINITY));
-            
-            dataModel.put("fn", Float.valueOf(-0.05f));
-            dataModel.put("dn", Double.valueOf(-0.05));
-            dataModel.put("ineg", Integer.valueOf(-5));
-            dataModel.put("ln", Long.valueOf(-5));
-            dataModel.put("sn", Short.valueOf((short) -5));
-            dataModel.put("bn", Byte.valueOf((byte) -5));
-            dataModel.put("bin", BigInteger.valueOf(5));
-            dataModel.put("bdn", BigDecimal.valueOf(-0.05));
-            
-            dataModel.put("fp", Float.valueOf(0.05f));
-            dataModel.put("dp", Double.valueOf(0.05));
-            dataModel.put("ip", Integer.valueOf(5));
-            dataModel.put("lp", Long.valueOf(5));
-            dataModel.put("sp", Short.valueOf((short) 5));
-            dataModel.put("bp", Byte.valueOf((byte) 5));
-            dataModel.put("bip", BigInteger.valueOf(5));
-            dataModel.put("bdp", BigDecimal.valueOf(0.05));
-        } else if (simpleTestName.startsWith("overloaded-methods")) {
-            dataModel.put("obj", new OverloadedMethods2());
-        }
-    }
-    
-    @Override
-    public void runTest() throws IOException, ConfigurationException {
-        Template template;
-        try {
-            template = confB.build().getTemplate(templateName);
-        } catch (IOException e) {
-            throw new AssertionFailedError(
-                    "Could not load template " + _StringUtil.jQuote(templateName) + ":\n" + getStackTrace(e));
-        }
-        ASTPrinter.validateAST(template);
-        
-        StringWriter out = noOutput ? null : new StringWriter();
-        try {
-            template.process(dataModel, out != null ? out : _NullWriter.INSTANCE);
-        } catch (TemplateException e) {
-            throw new AssertionFailedError("Template " + _StringUtil.jQuote(templateName) + " has stopped with error:\n"
-                        + getStackTrace(e));
-        }
-        
-        if (out != null) {
-            assertExpectedFileEqualsString(expectedFileName, out.toString());
-        }
-    }
-
-    private String getStackTrace(Throwable e) {
-        StringWriter sw = new StringWriter();
-        e.printStackTrace(new PrintWriter(sw));
-        return sw.toString();
-    }
-
-    @Override
-    protected String getExpectedContentFileDirectoryResourcePath() throws IOException {
-        return joinResourcePaths(super.getExpectedContentFileDirectoryResourcePath(), "expected");
-    }
-
-    @Override
-    protected Charset getTestResourceDefaultCharset() {
-        return confB.getOutputEncoding() != null ? confB.getOutputEncoding() : StandardCharsets.UTF_8;
-    }
-
-    static class TestBoolean implements TemplateBooleanModel, TemplateScalarModel {
-        @Override
-        public boolean getAsBoolean() {
-            return true;
-        }
-        
-        @Override
-        public String getAsString() {
-            return "de";
-        }
-    }
-
-    static class TestMethod implements TemplateMethodModel {
-        @Override
-        public Object exec(List arguments) {
-            return "x";
-        }
-    }
-
-    static class TestNode implements TemplateNodeModel {
-
-        @Override
-        public String getNodeName() {
-            return "name";
-        }
-
-        @Override
-        public TemplateNodeModel getParentNode() {
-            return null;
-        }
-
-        @Override
-        public String getNodeType() {
-            return "element";
-        }
-
-        @Override
-        public TemplateSequenceModel getChildNodes() {
-            return null;
-        }
-
-        @Override
-        public String getNodeNamespace() {
-            return null;
-        }
-    }
-
-   public Object getTestMapBean() {
-        Map<String, Object> testBean = new TestMapBean();
-        testBean.put("name", "Chris");
-        testBean.put("location", "San Francisco");
-        testBean.put("age", Integer.valueOf(27));
-        return testBean;
-    }
-
-    public static class TestMapBean extends HashMap<String, Object> {
-        public String getName() {
-            return "Christopher";
-        }
-        public int getLuckyNumber() {
-            return 7;
-        }
-    }
-
-    public static class TestBean {
-
-        public int m(int n) {
-            return n * 10;
-        }
-
-        public int mOverloaded(int n) {
-            return n * 10;
-        }
-
-        public String mOverloaded(String s) {
-            return s.toUpperCase();
-        }
-        
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
deleted file mode 100644
index 0edae99..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
+++ /dev/null
@@ -1,298 +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.test.templatesuite;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.util._StringUtil;
-import org.apache.freemarker.dom.NodeModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import junit.framework.TestSuite;
-
-/**
- * Test suite where the test cases are defined in testcases.xml, and usually process
- * templates and compare their output with the expected output.
- * 
- * If you only want to run certain tests, you can specify a regular expression for
- * the test name in the {@link #TEST_FILTER_PROPERTY_NAME} system property.
- */
-public class TemplateTestSuite extends TestSuite {
-    
-    private static final String ELEM_TEST_CASE = "testCase";
-
-    private static final String ELEM_SETTING = "setting";
-
-    private static final String ATTR_NO_OUTPUT = "noOutput";
-
-    private static final String ATTR_EXPECTED = "expected";
-
-    private static final String ATTR_TEMPLATE = "template";
-
-    private static final String END_TEMPLATE_NAME_MARK = "[#endTN]";
-
-    public static final String CONFIGURATION_XML_FILE_NAME = "testcases.xml";
-
-    /**
-     * When setting this system property, only the tests whose name matches the
-     * given regular expression will be executed.
-     */
-    public static final String TEST_FILTER_PROPERTY_NAME = "freemareker.templateTestSuite.testFilter";
-    
-    /**
-     * Comma separated list of "incompatible improvements" versions to run the test cases with.
-     */
-    public static final String INCOMPATIBLE_IMPROVEMENTS_PROPERTY_NAME
-            = "freemareker.templateTestSuite.incompatibleImprovements";
-    
-    private final Map<String, String> testSuiteSettings = new LinkedHashMap<>();
-
-    private final ArrayList<Version> testSuiteIcis;
-
-    private final Pattern testCaseNameFilter;
-    
-    public static TestSuite suite() throws Exception {
-        return new TemplateTestSuite();
-    }
-    
-    public TemplateTestSuite() throws Exception {
-        NodeModel.useJaxenXPathSupport();
-        
-        String filterStr = System.getProperty(TEST_FILTER_PROPERTY_NAME);
-        testCaseNameFilter = filterStr != null ? Pattern.compile(filterStr) : null;
-        if (testCaseNameFilter != null) {
-            System.out.println("Note: " + TEST_FILTER_PROPERTY_NAME + " is " + _StringUtil.jQuote(testCaseNameFilter));
-        }
-        
-        testSuiteIcis = new ArrayList<>();
-        String testedIcIsStr = System.getProperty(INCOMPATIBLE_IMPROVEMENTS_PROPERTY_NAME);
-        if (testedIcIsStr != null) {
-            for (String iciStr : testedIcIsStr.split(",")) {
-                iciStr = iciStr.trim();
-                if (iciStr.length() != 0) {
-                    testSuiteIcis.add(new Version(iciStr));
-                }
-            }
-        }
-        if (testSuiteIcis.isEmpty()) {
-            testSuiteIcis.add(getMinIcIVersion());
-            testSuiteIcis.add(getMaxIcIVersion());
-        }
-        
-        java.net.URL url = TemplateTestSuite.class.getResource(CONFIGURATION_XML_FILE_NAME);
-        if (url == null) {
-            throw new IOException("Resource not found: "
-                    + TemplateTestSuite.class.getName() + ", " + CONFIGURATION_XML_FILE_NAME);
-        }
-        processConfigXML(url.toURI());
-    }
-    
-    /**
-     * Read the test case configurations file and build up the test suite.
-     */
-    public void processConfigXML(URI uri) throws Exception {
-        Element testCasesElem = loadXMLFromURL(uri);
-        
-        NodeList children = testCasesElem.getChildNodes();
-        for (int childIdx = 0; childIdx < children.getLength(); childIdx++) {
-            Node n = children.item(childIdx);
-            if (n.getNodeType() == Node.ELEMENT_NODE) {
-                final String nodeName = n.getNodeName();
-                if (nodeName.equals(ELEM_SETTING)) {
-                    NamedNodeMap attrs = n.getAttributes();
-                    for (int attrIdx = 0; attrIdx < attrs.getLength(); attrIdx++) {
-                        Attr attr = (Attr) attrs.item(attrIdx);
-                        testSuiteSettings.put(attr.getName(), attr.getValue());
-                    }
-                } else if (nodeName.equals(ELEM_TEST_CASE)) {
-                    for (TemplateTestCase testCase : createTestCasesFromElement((Element) n)) {
-                        addTest(testCase);
-                    }
-                }
-            }
-        }
-    }
-
-    private Element loadXMLFromURL(URI uri) throws ParserConfigurationException, SAXException, IOException {
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        // dbf.setValidating(true);
-        DocumentBuilder db = dbf.newDocumentBuilder();
-        Document d = db.parse(uri.toString());
-        return d.getDocumentElement();
-    }
-    
-    String getTextInElement(Element e) {
-        StringBuilder buf = new StringBuilder();
-        NodeList children = e.getChildNodes();
-        for (int i = 0; i < children.getLength(); i++) {
-            Node n = children.item(i);
-            short type = n.getNodeType();
-            if (type == Node.TEXT_NODE || type == Node.CDATA_SECTION_NODE) {
-                buf.append(n.getNodeValue());
-            }
-        }
-        return buf.toString();
-    }
-    
-    /**
-     * Returns the list of test cases generated from the {@link #ELEM_TEST_CASE} element.
-     * There can be multiple generated test cases because of "incompatible improvements" variations, or none because
-     * of the {@code nameFilter}.
-     */
-    private List<TemplateTestCase> createTestCasesFromElement(Element testCaseElem)
-            throws Exception {
-        final String caseName = _StringUtil.emptyToNull(testCaseElem.getAttribute("name"));
-        if (caseName == null) throw new Exception("Invalid XML: the \"name\" attribute is mandatory.");
-        
-        if (testCaseNameFilter != null
-                && !testCaseNameFilter.matcher(caseName).matches()) {
-            return Collections.emptyList();
-        }
-        
-        final String templateName;
-        final String expectedFileName;
-        {
-            final String beforeEndTN;
-            final String afterEndTN;
-            {
-                int tBNameSep = caseName.indexOf(END_TEMPLATE_NAME_MARK);
-                beforeEndTN = tBNameSep == -1 ? caseName : caseName.substring(0, tBNameSep);
-                afterEndTN = tBNameSep == -1
-                        ? "" : caseName.substring(tBNameSep + END_TEMPLATE_NAME_MARK.length());
-            }
-            
-            {
-                String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_TEMPLATE));
-                templateName = s != null ? s : beforeEndTN + ".ftl";
-            }
-    
-            {
-                String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_EXPECTED));
-                expectedFileName = s != null ? s : beforeEndTN + afterEndTN + ".txt";
-            }
-        }
-        
-        final boolean noOutput;
-        {
-            String s = _StringUtil.emptyToNull(testCaseElem.getAttribute(ATTR_NO_OUTPUT));
-            noOutput = s != null && _StringUtil.getYesNo(s);
-        }
-
-        final Map<String, String> testCaseSettings = getCaseFMSettings(testCaseElem);
-        
-        final List<Version> icisToTest;
-        {
-            final String testCaseIcis = testCaseSettings.get(Configuration.ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY);
-                    
-            icisToTest = testCaseIcis != null ? parseVersionList(testCaseIcis) : testSuiteIcis;
-            if (icisToTest.isEmpty()) {
-                throw new Exception("The incompatible_improvement list was empty");
-            }
-        }
-
-        List<TemplateTestCase> result = new ArrayList<>();
-        for (Version iciToTest : icisToTest) {
-            TemplateTestCase testCase = new TemplateTestCase(
-                    caseName + "(ici=" + iciToTest + ")", caseName,
-                    templateName, expectedFileName, noOutput, iciToTest);
-            for (Map.Entry<String, String> setting : testSuiteSettings.entrySet()) {
-                testCase.setSetting(setting.getKey(), setting.getValue());
-            }
-            for (Map.Entry<String, String> setting : testCaseSettings.entrySet()) {
-                testCase.setSetting(setting.getKey(), setting.getValue());
-            }
-            
-            result.add(testCase);
-        }
-        
-        return result;
-    }
-
-    private List<Version> parseVersionList(String versionsStr) {
-        List<Version> versions = new ArrayList<>();
-        for (String versionStr : versionsStr.split(",")) {
-            versionStr = versionStr.trim();
-            if (versionStr.length() != 0) {
-                final Version v;
-                if ("min".equals(versionStr)) {
-                    v = getMinIcIVersion();
-                } else if ("max".equals(versionStr)) {
-                    v = getMaxIcIVersion();
-                } else {
-                    v = new Version(versionStr);
-                }
-                if (!versions.contains(v)) {
-                    versions.add(v);
-                }
-            }
-        }
-        return versions;
-    }
-
-    private Version getMaxIcIVersion() {
-        Version v = Configuration.getVersion();
-        // Remove nightly, RC and such:
-        return new Version(v.getMajor(), v.getMinor(), v.getMicro());
-    }
-
-    private Version getMinIcIVersion() {
-        return Configuration.VERSION_3_0_0;
-    }
-
-    private Map<String, String> getCaseFMSettings(Element e) {
-        final Map<String, String> caseFMSettings;
-        caseFMSettings = new LinkedHashMap<>();
-        NodeList settingElems = e.getElementsByTagName(ELEM_SETTING);
-        for (int elemIdx = 0; elemIdx < settingElems.getLength(); elemIdx++) {
-            NamedNodeMap attrs = settingElems.item(elemIdx).getAttributes();
-            for (int attrIdx = 0; attrIdx < attrs.getLength(); attrIdx++) {
-                Attr attr = (Attr) attrs.item(attrIdx);
-
-                final String settingName = attr.getName();
-                caseFMSettings.put(settingName, attr.getValue());
-            }
-        }
-        return caseFMSettings;
-    }
-    
-    public static void main (String[] args) throws Exception {
-        junit.textui.TestRunner.run(new TemplateTestSuite());
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/AllTemplateModels.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/AllTemplateModels.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/AllTemplateModels.java
deleted file mode 100644
index 974b3f9..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/AllTemplateModels.java
+++ /dev/null
@@ -1,128 +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.test.templatesuite.models;
-
-import java.util.Date;
-
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateCollectionModel;
-import org.apache.freemarker.core.model.TemplateDateModel;
-import org.apache.freemarker.core.model.TemplateHashModelEx;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateModelIterator;
-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.model.impl.SimpleScalar;
-
-/**
- * Implements all template models that are interesting when calling overloaded Java methods.
- */
-public class AllTemplateModels implements
-        TemplateScalarModel, TemplateNumberModel, TemplateDateModel, TemplateBooleanModel,
-        TemplateHashModelEx, TemplateSequenceModel, TemplateCollectionModel {
-
-    public static final AllTemplateModels INSTANCE = new AllTemplateModels();
-    
-    private final TemplateModelIterator EMPTY_ITERATOR = new TemplateModelIterator() {
-
-        @Override
-        public TemplateModel next() throws TemplateModelException {
-            return null;
-        }
-
-        @Override
-        public boolean hasNext() throws TemplateModelException {
-            return false;
-        }
-        
-    };
-    
-    private final TemplateCollectionModel EMPTY_COLLECTION = new TemplateCollectionModel() {
-
-        @Override
-        public TemplateModelIterator iterator() throws TemplateModelException {
-            return EMPTY_ITERATOR;
-        }
-    };
-    
-    @Override
-    public TemplateModel get(String key) throws TemplateModelException {
-        return new SimpleScalar("value for key " + key);
-    }
-
-    @Override
-    public boolean isEmpty() throws TemplateModelException {
-        return true;
-    }
-
-    @Override
-    public TemplateModelIterator iterator() throws TemplateModelException {
-        return EMPTY_ITERATOR;
-    }
-
-    @Override
-    public TemplateModel get(int index) throws TemplateModelException {
-        return null;
-    }
-
-    @Override
-    public int size() throws TemplateModelException {
-        return 0;
-    }
-
-    @Override
-    public TemplateCollectionModel keys() throws TemplateModelException {
-        return EMPTY_COLLECTION;
-    }
-
-    @Override
-    public TemplateCollectionModel values() throws TemplateModelException {
-        return EMPTY_COLLECTION;
-    }
-
-    @Override
-    public boolean getAsBoolean() throws TemplateModelException {
-        return true;
-    }
-
-    @Override
-    public Date getAsDate() throws TemplateModelException {
-        return new Date(0);
-    }
-
-    @Override
-    public int getDateType() {
-        return TemplateDateModel.DATETIME;
-    }
-
-    @Override
-    @SuppressWarnings("boxing")
-    public Number getAsNumber() throws TemplateModelException {
-        return 1;
-    }
-
-    @Override
-    public String getAsString() throws TemplateModelException {
-        return "s";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestClass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestClass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestClass.java
deleted file mode 100644
index 7e7fa82..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestClass.java
+++ /dev/null
@@ -1,93 +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.test.templatesuite.models;
-
-/**
- */
-public class BeanTestClass extends BeanTestSuperclass implements BeanTestInterface<Integer> {
-    public static final String STATIC_FINAL_FIELD = "static-final-field";
-    public static String STATIC_FIELD = "static-field";
-    
-	public String getFoo() {
-	    return "foo-value";
-	}
-	
-	public String getBar(int index) {
-	    return "bar-value-" + index;
-	}
-
-	public String[] getBar() {
-		return new String[] { "bar-value-0", "bar-value-1", "bar-value-2" };
-	}
-
-	public String overloaded(int i) {
-	    return "overloaded-int-" + i;
-	}
-	
-	public String overloaded(String s) {
-	    return "overloaded-String-" + s;
-	}
-	
-	public static String staticMethod() {
-	    return "static-method";
-	}
-	
-	public static String staticOverloaded(int i) {
-	    return "static-overloaded-int-" + i;
-	}
-
-	public static String staticOverloaded(String s) {
-	    return "static-overloaded-String-" + s;
-	}
-	
-	public PrivateInner getPrivateInner() {
-	    return new PrivateInner();
-	}
-
-        public PublicInner getPublicInner() {
-            return new PublicInner();
-        }
-	
-        public class PublicInner {
-            
-            public int getX() {
-                return 1;
-            }
-            
-            public String m() {
-                return "m";
-            }
-            
-        }
-        
-        @SuppressWarnings("unused")
-	private class PrivateInner {
-	    
-            public int getX() {
-	        return 2;
-	    }
-	    
-	    public String m() {
-	        return "M";
-	    }
-	    
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestInterface.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestInterface.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestInterface.java
deleted file mode 100644
index 6737b87..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestInterface.java
+++ /dev/null
@@ -1,25 +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.test.templatesuite.models;
-
-public interface BeanTestInterface<T> {
-    T getSomething();
-    void setSomething(T s);
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestSuperclass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestSuperclass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestSuperclass.java
deleted file mode 100644
index b462e9a..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BeanTestSuperclass.java
+++ /dev/null
@@ -1,30 +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.test.templatesuite.models;
-
-public class BeanTestSuperclass {
-    public Integer getSomething() {
-        return 42;
-    }
-    
-    public void setSomething(Integer x) {
-        
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndScalarModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndScalarModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndScalarModel.java
deleted file mode 100644
index 4af030e..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndScalarModel.java
+++ /dev/null
@@ -1,40 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-public class BooleanAndScalarModel implements TemplateBooleanModel, TemplateScalarModel {
-
-    public static final BooleanAndScalarModel INSTANCE = new BooleanAndScalarModel();
-
-    @Override
-    public String getAsString() throws TemplateModelException {
-        return "s";
-    }
-
-    @Override
-    public boolean getAsBoolean() throws TemplateModelException {
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndStringTemplateModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndStringTemplateModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndStringTemplateModel.java
deleted file mode 100644
index d87b65c..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanAndStringTemplateModel.java
+++ /dev/null
@@ -1,38 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-public class BooleanAndStringTemplateModel implements TemplateBooleanModel, TemplateScalarModel {
-
-    @Override
-    public String getAsString() throws TemplateModelException {
-        return "theStringValue";
-    }
-
-    @Override
-    public boolean getAsBoolean() throws TemplateModelException {
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash1.java
deleted file mode 100644
index 524d003..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash1.java
+++ /dev/null
@@ -1,58 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-/**
- * Tests the impact that the isEmpty() has on template hash models.
- */
-public class BooleanHash1 implements TemplateHashModel {
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        if ( key.equals( "temp" )) {
-            return new SimpleScalar( "Hello, world." );
-        } else if ( key.equals( "boolean" )) {
-            return TemplateBooleanModel.FALSE;
-        } else {
-            return new SimpleScalar( "Just another key..." );
-        }
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash2.java
deleted file mode 100644
index 8bae7ab..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanHash2.java
+++ /dev/null
@@ -1,50 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.TemplateModel;
-
-/**
- * Tests the impact that the isEmpty() has on template hash models.
- */
-public class BooleanHash2 implements TemplateHashModel {
-
-    /**
-     * Gets a <tt>TemplateModel</tt> from the hash.
-     *
-     * @param key the name by which the <tt>TemplateModel</tt>
-     * is identified in the template.
-     * @return the <tt>TemplateModel</tt> referred to by the key,
-     * or null if not found.
-     */
-    @Override
-    public TemplateModel get(String key) {
-        return null;
-    }
-
-    /**
-     * @return true if this object is empty.
-     */
-    @Override
-    public boolean isEmpty() {
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList1.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList1.java
deleted file mode 100644
index 3e0a69c..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList1.java
+++ /dev/null
@@ -1,62 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Model for testing the impact of isEmpty() on template list models. Every
- * other method simply delegates to a SimpleList model.
- */
-public class BooleanList1 implements TemplateSequenceModel {
-
-    private SimpleSequence cList;
-
-    /** Creates new BooleanList1 */
-    public BooleanList1(ObjectWrapper ow) {
-        cList = new SimpleSequence(ow);
-        cList.add( "false" );
-        cList.add( "0" );
-        cList.add(TemplateBooleanModel.FALSE);
-        cList.add(TemplateBooleanModel.TRUE);
-        cList.add(TemplateBooleanModel.TRUE);
-        cList.add(TemplateBooleanModel.TRUE);
-        cList.add(TemplateBooleanModel.FALSE);
-    }
-
-    /**
-     * @return the specified index in the list
-     */
-    @Override
-    public TemplateModel get(int i) throws TemplateModelException {
-        return cList.get(i);
-    }
-
-    @Override
-    public int size() {
-        return cList.size();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList2.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList2.java
deleted file mode 100644
index 939fb5f..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanList2.java
+++ /dev/null
@@ -1,53 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-
-/**
- * Model for testing list models. Every
- * other method simply delegates to a SimpleList model.
- */
-public class BooleanList2 implements TemplateSequenceModel {
-
-    private SimpleSequence cList;
-
-    /** Creates new BooleanList2 */
-    public BooleanList2(ObjectWrapper ow) {
-        cList = new SimpleSequence(ow);
-    }
-
-    /**
-     * @return the specified index in the list
-     */
-    @Override
-    public TemplateModel get(int i) throws TemplateModelException {
-        return cList.get(i);
-    }
-
-    @Override
-    public int size() {
-        return cList.size();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanVsStringMethods.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanVsStringMethods.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanVsStringMethods.java
deleted file mode 100644
index 3e13623..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/BooleanVsStringMethods.java
+++ /dev/null
@@ -1,40 +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.test.templatesuite.models;
-
-public class BooleanVsStringMethods {
-    
-    public String expectsString(String s) {
-        return s;
-    }
-
-    public boolean expectsBoolean(boolean b) {
-        return b;
-    }
-    
-    public String overloaded(String s) {
-        return "String " + s;
-    }
-    
-    public String overloaded(boolean s) {
-        return "boolean " + s;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/EnumTestClass.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/EnumTestClass.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/EnumTestClass.java
deleted file mode 100644
index 359e4a4..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/EnumTestClass.java
+++ /dev/null
@@ -1,34 +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.test.templatesuite.models;
-
-/**
- */
-public enum EnumTestClass
-{
-    ONE, 
-    TWO, 
-    THREE;
-    
-    @Override
-    public String toString() {
-        return name() + "x";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/ExceptionModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/ExceptionModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/ExceptionModel.java
deleted file mode 100644
index ca0f9be..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/ExceptionModel.java
+++ /dev/null
@@ -1,39 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-/**
- * A template that always throws an exception whenever we call getAsString()
- */
-public class ExceptionModel implements TemplateScalarModel {
-
-    /**
-     * Returns the scalar's value as a String.
-     *
-     * @return the String value of this scalar.
-     */
-    @Override
-    public String getAsString () throws TemplateModelException {
-        throw new TemplateModelException( "Throwing from ExceptionModel!" );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/HashAndScalarModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/HashAndScalarModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/HashAndScalarModel.java
deleted file mode 100644
index 70ea42a..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/HashAndScalarModel.java
+++ /dev/null
@@ -1,84 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.model.TemplateCollectionModel;
-import org.apache.freemarker.core.model.TemplateHashModelEx;
-import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateModelIterator;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-public class HashAndScalarModel implements TemplateHashModelEx, TemplateScalarModel {
-    
-    public static final HashAndScalarModel INSTANCE = new HashAndScalarModel();
-    
-    private final TemplateCollectionModel EMPTY_COLLECTION = new TemplateCollectionModel() {
-
-        @Override
-        public TemplateModelIterator iterator() throws TemplateModelException {
-            return new TemplateModelIterator() {
-
-                @Override
-                public TemplateModel next() throws TemplateModelException {
-                    return null;
-                }
-
-                @Override
-                public boolean hasNext() throws TemplateModelException {
-                    return false;
-                }
-                
-            };
-        }
-    };
-
-    @Override
-    public String getAsString() throws TemplateModelException {
-        return "scalarValue";
-    }
-
-    @Override
-    public TemplateModel get(String key) throws TemplateModelException {
-        return new SimpleScalar("mapValue for " + key);
-    }
-
-    @Override
-    public boolean isEmpty() throws TemplateModelException {
-        return true;
-    }
-
-    @Override
-    public int size() throws TemplateModelException {
-        return 0;
-    }
-
-    @Override
-    public TemplateCollectionModel keys() throws TemplateModelException {
-        return EMPTY_COLLECTION;
-    }
-
-    @Override
-    public TemplateCollectionModel values() throws TemplateModelException {
-        return EMPTY_COLLECTION;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/JavaObjectInfo.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/JavaObjectInfo.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/JavaObjectInfo.java
deleted file mode 100644
index 4673b09..0000000
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/JavaObjectInfo.java
+++ /dev/null
@@ -1,35 +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.test.templatesuite.models;
-
-import org.apache.freemarker.core.util._StringUtil;
-
-public class JavaObjectInfo {
-    
-    public static final Object INSTANCE = new JavaObjectInfo();
-
-    private JavaObjectInfo() { }
-    
-    public String info(Object o) {
-        if (o == null) return "null";
-        return o.getClass().getName() + " " + _StringUtil.jQuote(o.toString());
-    }
-
-}



[10/19] incubator-freemarker git commit: Moving TemplateTestSuite to freemarker-test-utils, so that it can be used from multiple modules. It had to be generalized for this a bit, as now it has a CoreTemplateTestSuite subclass in freemarker-core-test.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/overloaded-methods.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/overloaded-methods.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/overloaded-methods.ftl
new file mode 100644
index 0000000..329d041
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/overloaded-methods.ftl
@@ -0,0 +1,411 @@
+<#--
+  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.
+-->
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringList) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
+
+<#-- Check if non-overloaded calls still work; they share some code with overloaded methods: -->
+<@assertEquals actual=obj.mIntArrayNonOverloaded([1, 2, 3]) expected="mIntArrayNonOverloaded(int[] [1, 2, 3])" />
+<@assertEquals actual=obj.mIntegerArrayNonOverloaded([1, 2, 3]) expected="mIntegerArrayNonOverloaded(Integer[] [1, 2, 3])" />
+<@assertEquals actual=obj.mIntegerListNonOverloaded([1, 2, 3]) expected="mIntegerListNonOverloaded(List<Integer> [1, 2, 3])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(['a', 'b', 'c']) expected="mStringListNonOverloaded(List<String> [a, b, c])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringList) expected="mStringListNonOverloaded(List<String> [a, b])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringArray) expected="mStringListNonOverloaded(List<String> [a, b])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(['a', 'b', 'c']) expected="mStringArrayNonOverloaded(String[] [a, b, c])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringList) expected="mStringArrayNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringArray) expected="mStringArrayNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(['a', 'b', 3]) expected="mObjectListNonOverloaded(List<Object> [a, b, 3])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringList) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringArray) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(['a', 'b', 3]) expected="mObjectArrayNonOverloaded(Object[] [a, b, 3])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringList) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringArray) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded('a', 'b') expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(['a', 'b']) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringList) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringArray) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1('a', 'b') expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(['a', 'b']) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringList) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringArray) expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a', 'b') expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a') expected="mStringArrayVarargsOverloaded2(String a)" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a']) expected="mStringArrayVarargsOverloaded3(String[] [a])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b']) expected="mStringArrayVarargsOverloaded3(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a') expected="mStringArrayVarargsOverloaded3(String[] [a])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b') expected="mStringArrayVarargsOverloaded3(String a, String b)" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b', 'c') expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
+
+<@assertEquals actual=obj.mListOrString(['a', 'b']) expected="mListOrString(List [a, b])" />
+<@assertEquals actual=obj.mListOrString('a') expected="mListOrString(String a)" />
+<@assertEquals actual=obj.mListListOrString([['a'], 'b', 3]) expected="mListListOrString(List [[a], b, 3])" />
+<@assertEquals actual=obj.mListListOrString('s') expected="mListListOrString(String s)" />
+
+<#-- Because the fixed arg interpretations are ambiguous, it only considers the vararg interpretations:  -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded4(List[] [[a, b, c]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4('a', 'b', 'c') expected="mStringArrayVarargsOverloaded4(String[] [a, b, c])" />
+
+<#-- Fixed arg solutions have priority: -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(String[] [a, b])" />
+
+<#-- Choses between the vararg solutions: -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+
+<#-- Until there's no overloading String->Character conversion work: -->
+<@assertEquals actual=obj.mCharNonOverloaded('c') expected="mCharNonOverloaded(char c)" />
+<@assertEquals actual=obj.mCharNonOverloaded(obj.javaString) expected="mCharNonOverloaded(char s)" />
+<@assertEquals actual=obj.mCharacterNonOverloaded('c') expected="mCharacterNonOverloaded(Character c)" />
+<@assertEquals actual=obj.mCharacterNonOverloaded(obj.javaString) expected="mCharacterNonOverloaded(Character s)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded('s', 1) expected="mCharOrStringOverloaded(String s, int 1)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded('s', 1) expected="mCharacterOrStringOverloaded(String s, int 1)" />
+<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
+
+<@assertEquals actual=obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c')) expected='mVarargs(String... a1 = abc)' />
+
+<@assertEquals actual=obj.mNull1(null) expected="mNull1(String a1 = null)" />
+<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" />
+<@assertEquals actual=obj.mNull2(null) expected="mNull2(String a1 = null)" />
+<@assertEquals actual=obj.mVarargs('a', null) expected="mVarargs(String... a1 = anull)" />
+<@assertEquals actual=obj.mVarargs(null, 'a') expected="mVarargs(File a1, String... a2)" />
+<@assertEquals actual=obj.mSpecificity('a', 'b') expected="mSpecificity(String a1, Object a2)" />
+
+<@assertEquals actual=obj.mChar('a') expected='mChar(char a1 = a)' />
+<@assertEquals actual=obj.mBoolean(true) expected="mBoolean(boolean a1 = true)" />
+<@assertEquals actual=obj.mBoolean(null) expected="mBoolean(Boolean a1 = null)" />
+
+<@assertEquals actual=obj.mIntNonOverloaded(123?long) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(123) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(123.5) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(2147483648) expected=-2147483648 /> <#-- overflow -->
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123.5) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?int) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?long) expected="mNumBoxedVSBoxed(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?short) expected="mNumBoxedVSBoxed(Short a1 = 123)" />
+<@assertEquals 
+    actual=obj.mNumUnambigous(2147483648) expected="mNumUnambigous(Integer a1 = -2147483648)" /> <#-- overflow -->
+
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?int) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?short) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<@assertEquals actual=obj.mIntPrimVSBoxed(123) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<#-- This doesn't fail as 123L can be converted to int without loss: -->
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?long) expected="mIntPrimVSBoxed(int a1 = 123)" />
+
+<@assertEquals actual=obj.mNumPrimVSPrim(123?short) expected="mNumPrimVSPrim(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?int) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?long) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?double) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(long a1 = 123456)" />
+
+<@assertEquals actual=obj.mNumPrimAll(123?byte) expected="mNumPrimAll(byte a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?short) expected="mNumPrimAll(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?int) expected="mNumPrimAll(int a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?long) expected="mNumPrimAll(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?float) expected="mNumPrimAll(float a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll(123?double) expected="mNumPrimAll(double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll(123) expected="mNumPrimAll(BigDecimal a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(obj.bigInteger(123)) expected="mNumPrimAll(BigInteger a1 = 123)" />
+
+<@assertEquals actual=obj.mNumBoxedAll(123?byte) expected="mNumBoxedAll(Byte a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?short) expected="mNumBoxedAll(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?int) expected="mNumBoxedAll(Integer a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?long) expected="mNumBoxedAll(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?float) expected="mNumBoxedAll(Float a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?double) expected="mNumBoxedAll(Double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll(123) expected="mNumBoxedAll(BigDecimal a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(obj.bigInteger(123)) expected="mNumBoxedAll(BigInteger a1 = 123)" />
+
+<@assertEquals actual=obj.mNumPrimAll2nd(123?byte) expected="mNumPrimAll2nd(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?short) expected="mNumPrimAll2nd(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?int) expected="mNumPrimAll2nd(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?long) expected="mNumPrimAll2nd(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?float) expected="mNumPrimAll2nd(double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?double) expected="mNumPrimAll2nd(double a1 = 123.0)" />
+
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?byte) expected="mNumBoxedAll2nd(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?int) expected="mNumBoxedAll2nd(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?float) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
+ 
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?int) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?long) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123.5?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.5)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(9223372036854775808))
+    expected="mNumPrimFallbackToNumber(Number a1 = 9223372036854775808)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.rational(246, 2)) expected="mNumPrimFallbackToNumber(Number a1 = 246/2)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" />
+
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123.5?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.5)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(9223372036854775808))
+    expected="mNumBoxedFallbackToNumber(Number a1 = 9223372036854775808)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.rational(246, 2)) expected="mNumBoxedFallbackToNumber(Number a1 = 246/2)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" />
+
+<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(double a1 = 1.5)" />
+<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" />
+
+<@assertEquals actual=obj.mNumConversionLoses1(1?double, '', '') expected="Number 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses1(1?short, '', '') expected="Number 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses1(1?long, '', '') expected="Number 1 java.lang.Long" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?double, '', '') expected="Number 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?short, '', '') expected="Number 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?long, '', '') expected="Number 1 java.lang.Long" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?double, '', '') expected="Serializable 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?int, '', '') expected="Serializable 1 java.lang.Integer" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?short, '', '') expected="Serializable 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?long, '', '') expected="Serializable 1 java.lang.Long" />
+
+<#-- BigDecimal-to-int is preferred over to-long for BC and user expectations: -->
+<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" />
+<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" />
+<#-- BigDecimal-to-short is, however unfavored due to the higher chance of overflow: -->
+<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(int 1)" />
+<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" />
+<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(long 1)" />
+<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" />
+
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.5])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2.5, 3) expected='varargs1(String s = null, double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1.5, 2, 3) expected='varargs1(String s = null, double... xs = [1.5, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 'c') expected='varargs1(String s = null, Object... xs = [1, 2, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 'b', 3) expected='varargs1(String s = null, Object... xs = [1, b, 3])' />
+<@assertEquals actual=obj.varargs1(null, 'a', 2, 3) expected='varargs1(String s = null, Object... xs = [a, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s', 1, 2, 3) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s', 1.1, 2.1, 3.1) expected='varargs1(String s = "s", double... xs = [1.1, 2.1, 3.1])' />
+<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(null, 1.1, 2.1, 3.1) expected='varargs1(String s = null, double... xs = [1.1, 2.1, 3.1])' />
+<@assertEquals actual=obj.varargs1(null, 'a', 'b', 'c') expected='varargs1(String s = null, Object... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3?double) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2?double, 3?double) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2?float, 3?float) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1?double, 2?byte, 3?byte) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s') expected='varargs1(String s = "s", int... xs = [])' />
+
+<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?int, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?long, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?long, 2?double, 3) expected='varargs2(int... xs = [1, 2, 3])' />
+
+<@assertEquals actual=obj.varargs3(1, 2, 3) expected='varargs3(Comparable... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs3('a', 'b', 'c') expected='varargs3(String... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs3(1, 'b', 'c') expected='varargs3(Comparable... xs = [1, b, c])' />
+<@assertEquals actual=obj.varargs3('a', 'b', 3) expected='varargs3(Comparable... xs = [a, b, 3])' />
+<@assertEquals actual=obj.varargs3('a', [], 3) expected='varargs3(Object... xs = [a, [], 3])' />
+<@assertEquals actual=obj.varargs3(null, 'b', null) expected='varargs3(String... xs = [null, b, null])' />
+<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Comparable... xs = [null, 2, null])' />
+<@assertEquals actual=obj.varargs3(null, [], null) expected='varargs3(Object... xs = [null, [], null])' />
+<@assertEquals actual=obj.varargs3(null, null, null) expected='varargs3(String... xs = [null, null, null])' />
+<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' />
+
+<@assertEquals actual=obj.varargs4(null) expected='varargs4(Integer... xs = [null])' />
+<@assertEquals actual=obj.varargs4(null, null, null) expected='varargs4(Integer... xs = [null, null, null])' />
+<@assertEquals actual=obj.varargs4(1, null, 2) expected='varargs4(Integer... xs = [1, null, 2])' />
+<@assertEquals actual=obj.varargs4(1) expected='varargs4(int... xs = [1])' />
+<@assertEquals actual=obj.varargs4(1, 2, 3) expected='varargs4(int... xs = [1, 2, 3])' />
+
+<@assertEquals actual=obj.varargs5(1, 2, 3, 4, 5) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4, 5])' />
+<@assertEquals actual=obj.varargs5(1, 2, 3, 4) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4])' />
+<@assertEquals actual=obj.varargs5(1, 2, 3) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [])' />
+<@assertEquals actual=obj.varargs5(1, 2) expected='varargs5(int a1 = 1, int a2 = 2, int... xs = [])' />
+<@assertEquals actual=obj.varargs5(1) expected='varargs5(int a1 = 1, int... xs = [])' />
+<@assertEquals actual=obj.varargs5() expected='varargs5(int... xs = [])' />
+
+<@assertEquals actual=obj.varargs6('s', 2) expected='varargs6(String a1 = s, int... xs = [2])' />
+<@assertEquals actual=obj.varargs6('s') expected='varargs6(String a1 = s, int... xs = [])' />
+<@assertEquals actual=obj.varargs6(1, 2) expected='varargs6(Object a1 = 1, int a2 = 2, int... xs = [])' />
+<@assertFails message="no compatible overloaded">${obj.varargs6(1)}</@>
+
+<@assertEquals actual=obj.varargs7(1?int, 2?int) expected='varargs7(int... xs = [1, 2])' />
+<@assertEquals actual=obj.varargs7(1?short, 2?int) expected='varargs7(short a1 = 1, int... xs = [2])' />
+
+<#-- Tests that a pre-2.3.21 bug is fixed now: -->
+<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
+<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3.5) expected='mVarargsIgnoredTail(int i = 1, double... ds = [2.0, 3.5])' />
+
+<@assertEquals actual=obj.mNullAmbiguous('a') expected='mNullAmbiguous(String s = a)' />
+<@assertEquals actual=obj.mNullAmbiguous(123) expected='mNullAmbiguous(int i = 123)' />
+<@assertEquals actual=obj.mNullAmbiguous(1.9) expected='mNullAmbiguous(int i = 1)' />
+<@assertEquals actual=obj.mNullAmbiguous(1?double) expected='mNullAmbiguous(int i = 1)' />
+<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@>
+<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous(null)}</@>
+
+<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous2(null)}</@>
+
+<@assertEquals actual=obj.mNullNonAmbiguous(null) expected='mNullNonAmbiguous(String s = null)' />
+
+<#-- The primitive int-s will win twice, but then String wins over Object, which is stronger: -->
+<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(Integer x = 1, Integer y = 2, String s = a)' />
+
+<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
+               expected='mRareWrappings(File f = file, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)
+               expected='mRareWrappings(String s = yes, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.stringAdaptedToBoolean2, obj.wrapperNumber, obj.wrapperNumber, obj.wrapperNumber, obj.stringAdaptedToBoolean2)
+               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0001, double d3 = 123.0001, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)
+               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)
+               expected='mRareWrappings(Object o = 124, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)
+               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+               
+<@assertEquals actual=obj.mRareWrappings2(obj.adaptedNumber) expected='mRareWrappings2(byte b = 124)' />
+
+<#-- Test for List VS array problems due to too vague hinting: -->
+
+<@assertEquals actual=obj.mSeqToArrayNonOverloaded(['a', 'b'], 'c') expected='mSeqToArrayNonOverloaded(String[] [a, b], String c)' />
+
+<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 'c') expected='mSeqToArrayGoodHint(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 3) expected='mSeqToArrayGoodHint(String[] [a, b], int 3)' />
+
+<@assertEquals actual=obj.mSeqToArrayGoodHint2(['a', 'b'], 'c') expected='mSeqToArrayGoodHint2(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayGoodHint2('a') expected='mSeqToArrayGoodHint2(String a)' />
+
+<@assertEquals actual=obj.mSeqToArrayPoorHint(['a', 'b'], 'c') expected='mSeqToArrayPoorHint(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayPoorHint('a', 2) expected='mSeqToArrayPoorHint(String a, int 2)' />
+
+<@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' />
+<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' />
+
+<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@>
+<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@>
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(['a', 'b']) expected="mStringArrayVsObjectArrayPreference(Object[] [a, b])" />
+<@assertEquals actual=obj.mIntArrayVsIntegerArrayPreference([1, 2]) expected="mIntArrayVsIntegerArrayPreference(Integer[] [1, 2])" />
+
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(String[] [a, b])" />
+<@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
+
+<@assertEquals actual=obj.mIntegerArrayOverloaded([1, 2], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaByteList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+
+<@assertEquals actual=obj.mStringArrayOverloaded(['a', 'b'], 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
+<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaStringList, 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
+<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaCharacterList, 3) expected="mStringArrayOverloaded(String[] [c, C], int 3)" />
+<@assertFails message="Failed to convert sequence">${obj.mStringArrayOverloaded([1, 2], 3)}</@>
+<@assertFails message="Failed to convert">${obj.mStringArrayOverloaded(obj.javaIntegerList, 3)}</@>
+
+<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 3) expected="mCharArrayOverloaded(char[] [c, C], int 3)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
+<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 3)}</@>
+<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 3)}</@>
+<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 's') expected="mCharArrayOverloaded(Character[] [c, C], String s)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
+<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 's')}</@>
+<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 's')}</@>
+
+<@assertEquals actual=obj.mStringArrayArrayOverloaded([['a', 'b'], ['c']], 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringListList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringSequenceList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaStringList, 3)}</@>
+<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaIntegerListList, 3)}</@>
+<@assertEquals actual=obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mIntArrayArrayNonOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayNonOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mArrayOfListsNonOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsNonOverloaded([[1, 2, 3], [], [4]])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a', 'b']) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a']) expected="mStringArrayVarargsOverloaded2(String[] [a])" />
+
+<#-- Situations that lead to array-to-List conversion: -->
+<@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" />
+<@assertEquals actual=obj.mListOrString(obj.javaEmptyStringArray) expected="mListOrString(List [])" />
+<@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" />
+<@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+
+<@assertEquals actual=obj.mMapOrBoolean(obj.hashAndScalarModel) expected="mMapOrBoolean(Map {})" />
+<@assertEquals actual=obj.mMapOrBoolean(obj.booleanAndScalarModel) expected="mMapOrBoolean(boolean true)" />
+<@assertEquals actual=obj.mMapOrBoolean(obj.allModels) expected="mMapOrBoolean(boolean true)" />
+
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true, true])" />
+
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map {})" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean true)" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true, true])" />
+
+<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" />
+<@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" />
+<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" />
+<@assertEquals actual=obj.mDateOrArray(obj.allModels) expected="mDateOrArray(Date 0)" />
+<@assertEquals actual=obj.mStringOrArray(obj.allModels) expected="mStringOrArray(String s)" />
+<@assertEquals actual=obj.mBooleanOrArray(obj.allModels) expected="mBooleanOrArray(boolean true)" />
+<@assertEquals actual=obj.mMapOrArray(obj.allModels) expected="mMapOrArray(Map {})" />
+<@assertEquals actual=obj.mListOrArray(obj.allModels) expected="mListOrArray(List [])" />
+<@assertEquals actual=obj.mSetOrArray(obj.allModels) expected="mSetOrArray(Set [])" />
+
+<@assertEquals actual=obj.mCharOrCharacterOverloaded('c') expected="mCharOrCharacterOverloaded(char c)" />
+<@assertEquals actual=obj.mCharOrCharacterOverloaded(obj.javaString) expected="mCharOrCharacterOverloaded(char s)" />
+<@assertEquals actual=obj.mCharOrCharacterOverloaded(null) expected="mCharOrCharacterOverloaded(Character null)" />
+
+<@assertEquals actual=obj.mCharOrBooleanOverloaded('c') expected="mCharOrBooleanOverloaded(char c)" />
+<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded('c', true) expected="mCharOrStringOverloaded(char c, boolean true)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded('c', true) expected="mCharacterOrStringOverloaded(Character c, boolean true)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(char c)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(Character c)" />
+<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
+
+<#-- The exmple given in bug report 363 -->
+<#assign theMap = {'name':'Billy', 'lastName', 'Pilgrim'} />
+<@assertEquals actual=obj.bugReport363(theMap, []) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=[]" />
+<@assertEquals actual=obj.bugReport363(theMap, null) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=null" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/precedence.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/precedence.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/precedence.ftl
new file mode 100644
index 0000000..472b076
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/precedence.ftl
@@ -0,0 +1,61 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Operator Precedence Test</title>
+</head>
+<body>
+<#assign patate1 = "test">
+<#assign patate2 = "test">
+<#assign patate3 = "test">
+
+<#if patate1 == patate2 && patate2 == patate3>
+@@@@@@@@@@@
+</#if>
+
+<br />
+<br />
+
+<#if patate1?exists && patate2 == patate3>
+##########
+</#if>
+
+<br />
+<br />
+
+<#if patate2 == patate2 && (patate2==patate2)>
+&&&&&&&&&&&
+</#if>
+
+<br />
+<br />
+
+<#if (patate2 == patate2) && (patate2==patate2)>
+!!!!!!!!!!!
+</#if>
+
+<br />
+<br />
+
+<#if (patate2 == patate2) && patate2==patate2>
+$$$$$$$$$$$
+</#if>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range-common.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range-common.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range-common.ftl
new file mode 100644
index 0000000..142435b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range-common.ftl
@@ -0,0 +1,314 @@
+<#--
+  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.
+-->
+<#-- A version of "?join" that fails at null-s in the sequence: -->
+<#function join seq sep=''>
+  <#local r = "">
+  <#list seq as i>
+    <#local r = r + i>
+    <#if i_has_next>
+      <#local r = r + sep>
+    </#if>
+  </#list>
+  <#return r>
+</#function>
+
+<#----------------------->
+<#-- Range expressions -->
+
+<@assertEquals actual=join(1..2, ' ') expected="1 2" />
+<@assertEquals actual=join(1..1, ' ') expected="1" />
+<@assertEquals actual=join(1..0, ' ') expected="1 0" />
+<@assertEquals actual=join(1..-1, ' ') expected="1 0 -1" />
+<@assertEquals actual=join(-1..-1, ' ') expected="-1" />
+<@assertEquals actual=join(-1..1, ' ') expected="-1 0 1" />
+
+<@assertEquals actual=join(1..<3, ' ') expected="1 2" />
+<@assertEquals actual=join(1..<2, ' ') expected="1" />
+<@assertEquals actual=join(1..<1, ' ') expected="" />
+<@assertEquals actual=join(1..<0, ' ') expected="1" />
+<@assertEquals actual=join(1..<-1, ' ') expected="1 0" />
+<@assertEquals actual=join(1..<-2, ' ') expected="1 0 -1" />
+<@assertEquals actual=join(-1..<0, ' ') expected="-1" />
+<@assertEquals actual=join(-1..<2, ' ') expected="-1 0 1" />
+
+<@assertEquals actual=join(1..!3, ' ') expected="1 2" />
+<@assertEquals actual=join(1..!2, ' ') expected="1" />
+<@assertEquals actual=join(1..!1, ' ') expected="" />
+<@assertEquals actual=join(1..!0, ' ') expected="1" />
+<@assertEquals actual=join(1..!-1, ' ') expected="1 0" />
+<@assertEquals actual=join(1..!-2, ' ') expected="1 0 -1" />
+<@assertEquals actual=join(-1..!0, ' ') expected="-1" />
+<@assertEquals actual=join(-1..!2, ' ') expected="-1 0 1" />
+
+<@assertEquals actual=join(1..*2, ' ') expected="1 2" />
+<@assertEquals actual=join(1..*1, ' ') expected="1" />
+<@assertEquals actual=join(1..*0, ' ') expected="" />
+<@assertEquals actual=join(1..*-1, ' ') expected="1" />
+<@assertEquals actual=join(1..*-2, ' ') expected="1 0" />
+<@assertEquals actual=join(1..*-3, ' ') expected="1 0 -1" />
+<@assertEquals actual=join(-1..*1, ' ') expected="-1" />
+<@assertEquals actual=join(-1..*3, ' ') expected="-1 0 1" />
+
+<@assertEquals actual=1 expected=(0..0)?size />
+<@assertEquals actual=1 expected=(1..1)?size />
+<@assertEquals actual=1 expected=(2..2)?size />
+<@assertEquals actual=2 expected=(0..1)?size />
+<@assertEquals actual=2 expected=(1..2)?size />
+<@assertEquals actual=2 expected=(2..3)?size />
+<@assertEquals actual=3 expected=(2..4)?size />
+<@assertEquals actual=2 expected=(1..0)?size />
+<@assertEquals actual=2 expected=(2..1)?size />
+<@assertEquals actual=2 expected=(3..2)?size />
+<@assertEquals actual=3 expected=(4..2)?size />
+
+<@assertEquals actual=0 expected=(0..<0)?size />
+<@assertEquals actual=0 expected=(1..<1)?size />
+<@assertEquals actual=0 expected=(2..<2)?size />
+<@assertEquals actual=1 expected=(0..<1)?size />
+<@assertEquals actual=1 expected=(1..<2)?size />
+<@assertEquals actual=1 expected=(2..<3)?size />
+<@assertEquals actual=2 expected=(2..<4)?size />
+<@assertEquals actual=1 expected=(1..<0)?size />
+<@assertEquals actual=1 expected=(2..<1)?size />
+<@assertEquals actual=1 expected=(3..<2)?size />
+<@assertEquals actual=2 expected=(4..<2)?size />
+
+<@assertEquals actual=0 expected=(0..*0)?size />
+<@assertEquals actual=0 expected=(1..*0)?size />
+<@assertEquals actual=0 expected=(2..*0)?size />
+<@assertEquals actual=1 expected=(0..*1)?size />
+<@assertEquals actual=1 expected=(1..*1)?size />
+<@assertEquals actual=1 expected=(2..*1)?size />
+<@assertEquals actual=2 expected=(2..*2)?size />
+<@assertEquals actual=1 expected=(0..*-1)?size />
+<@assertEquals actual=1 expected=(1..*-1)?size />
+<@assertEquals actual=1 expected=(2..*-1)?size />
+<@assertEquals actual=2 expected=(0..*-2)?size />
+<@assertEquals actual=2 expected=(1..*-2)?size />
+<@assertEquals actual=2 expected=(2..*-2)?size />
+
+
+<#--------------------->
+<#-- String slicing: -->
+
+<#assign s = 'abcd'>
+
+<@assertEquals actual=s[0..] expected="abcd" />
+<@assertEquals actual=s[1..] expected="bcd" />
+<@assertEquals actual=s[2..] expected="cd" />
+<@assertEquals actual=s[3..] expected="d" />
+<@assertEquals actual=s[4..] expected="" />
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[5..] />
+</...@assertFails>
+<@assertFails message="6 is out of bounds">
+  <#assign _ = s[6..] />
+</...@assertFails>
+
+<@assertEquals actual=s[1..2] expected="bc" />
+<@assertEquals actual=s[1..1] expected="b" />
+<@assertEquals actual=s[0..1] expected="ab" />
+<@assertEquals actual=s[0..0] expected="a" />
+<@assertFails message="4 is out of bounds">
+  <#assign _ = s[1..4] />
+</...@assertFails>
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[1..5] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-1..1] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-2..1] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[0..-1] />
+</...@assertFails>
+
+<@assertEquals actual=s[1..<3] expected="bc" />
+<@assertEquals actual=s[1..!3] expected="bc" />
+<@assertEquals actual=s[1..<2] expected="b" />
+<@assertEquals actual=s[1..<0] expected="b" />
+<@assertEquals actual=s[1..<1] expected="" />
+<@assertEquals actual=s[0..<0] expected="" />
+<@assertEquals actual=s[5..<5] expected="" />
+<@assertEquals actual=s[6..<6] expected="" />
+<@assertEquals actual=s[-5..<-5] expected="" />
+<@assertFails message="negative">
+  <#assign _ = s[-5..<1] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[2..<-4] />
+</...@assertFails>
+<@assertFails message="decreasing">
+  <#assign _ = s[2..<0] />
+</...@assertFails>
+
+<@assertEquals actual=s[1..*-1] expected="b" />
+<@assertEquals actual=s[1..*0] expected="" />
+<@assertEquals actual=s[1..*1] expected="b" />
+<@assertEquals actual=s[1..*2] expected="bc" />
+<@assertEquals actual=s[1..*3] expected="bcd" />
+<@assertEquals actual=s[1..*4] expected="bcd" />
+<@assertEquals actual=s[1..*5] expected="bcd" />
+<@assertEquals actual=s[4..*1] expected="" />
+<@assertEquals actual=s[5..*0] expected="" />
+<@assertEquals actual=s[6..*0] expected="" />
+<@assertEquals actual=s[-5..*0] expected="" />
+<@assertEquals actual=s[0..*0] expected="" />
+<@assertEquals actual=s[0..*-1] expected="a" />
+<@assertEquals actual=s[0..*-2] expected="a" />
+<@assertEquals actual=s[0..*-3] expected="a" />
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[5..*1] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-1..*1] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-2..*1] />
+</...@assertFails>
+<@assertFails message="decreasing">
+  <#assign _ = s[1..*-2] />
+</...@assertFails>
+<@assertFails message="decreasing">
+  <#assign _ = s[1..*-3] />
+</...@assertFails>
+<@assertFails message="4 is out of bounds">
+  <#assign _ = s[4..*-1] />
+</...@assertFails>
+
+<#-- Legacy string backward-range bug kept for compatibility: -->
+<@assertEquals actual=s[1..0] expected="" />
+<@assertEquals actual=s[2..1] expected="" />
+<@assertFails message="negative">
+  <@assertEquals actual=s[0..-1] expected="" />
+</...@assertFails>
+<@assertFails message="decreasing">
+  <@assertEquals actual=s[3..1] expected="" />
+</...@assertFails>
+<#-- But it isn't emulated for operators introduced after 2.3.20: -->
+<@assertFails message="decreasing">
+  <@assertEquals actual=s[3..<1] expected="" />
+</...@assertFails>
+<@assertFails message="decreasing">
+  <@assertEquals actual=s[3..*-2] expected="" />
+</...@assertFails>
+
+<#assign r = 1..2>
+<@assertEquals actual=s[r] expected="bc" />
+<#assign r = 2..1>
+<@assertEquals actual=s[r] expected="" />
+<#assign r = 1..<2>
+<@assertEquals actual=s[r] expected="b" />
+<#assign r = 2..<4>
+<@assertEquals actual=s[r] expected="cd" />
+<#assign r = 2..>
+<@assertEquals actual=s[r] expected="cd" />
+<#assign r = 1..*2>
+<@assertEquals actual=s[r] expected="bc" />
+
+<#----------------------->
+<#-- Sequence slicing: -->
+
+<#assign s = ['a', 'b', 'c', 'd']>
+
+<@assertEquals actual=join(s[0..]) expected="abcd" />
+<@assertEquals actual=join(s[1..]) expected="bcd" />
+<@assertEquals actual=join(s[2..]) expected="cd" />
+<@assertEquals actual=join(s[3..]) expected="d" />
+<@assertEquals actual=join(s[4..]) expected="" />
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[5..] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-1..] />
+</...@assertFails>
+
+<@assertEquals actual=join(s[1..2]) expected="bc" />
+<@assertEquals actual=join(s[1..1]) expected="b" />
+<@assertEquals actual=join(s[0..1]) expected="ab" />
+<@assertEquals actual=join(s[0..0]) expected="a" />
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[1..5] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-1..0] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[0..-1] />
+</...@assertFails>
+
+<@assertEquals actual=join(s[1..<3]) expected="bc" />
+<@assertEquals actual=join(s[1..!3]) expected="bc" />
+<@assertEquals actual=join(s[1..<2]) expected="b" />
+<@assertEquals actual=join(s[1..<0]) expected="b" />
+<@assertEquals actual=join(s[1..<1]) expected="" />
+<@assertEquals actual=join(s[0..<0]) expected="" />
+
+<@assertEquals actual=join(s[1..0]) expected="ba" />
+<@assertEquals actual=join(s[2..1]) expected="cb" />
+<@assertEquals actual=join(s[2..0]) expected="cba" />
+<@assertEquals actual=join(s[2..<0]) expected="cb" />
+<@assertEquals actual=join(s[1..<0]) expected="b" />
+<@assertEquals actual=join(s[0..<0]) expected="" />
+<@assertEquals actual=join(s[3..<1]) expected="dc" />
+<@assertEquals actual=join(s[2..<1]) expected="c" />
+<@assertEquals actual=join(s[1..<1]) expected="" />
+<@assertEquals actual=join(s[0..<1]) expected="a" />
+<@assertEquals actual=join(s[0..<0]) expected="" />
+<@assertEquals actual=join(s[5..<5]) expected="" />
+<@assertEquals actual=join(s[-5..<-5]) expected="" />
+
+<@assertEquals actual=join(s[0..*-4]) expected="a" />
+<@assertEquals actual=join(s[1..*-4]) expected="ba" />
+<@assertEquals actual=join(s[1..*-3]) expected="ba" />
+<@assertEquals actual=join(s[1..*-2]) expected="ba" />
+<@assertEquals actual=join(s[1..*-1]) expected="b" />
+<@assertEquals actual=join(s[1..*0]) expected="" />
+<@assertEquals actual=join(s[1..*1]) expected="b" />
+<@assertEquals actual=join(s[1..*2]) expected="bc" />
+<@assertEquals actual=join(s[1..*3]) expected="bcd" />
+<@assertEquals actual=join(s[1..*4]) expected="bcd" />
+<@assertEquals actual=join(s[1..*5]) expected="bcd" />
+<@assertEquals actual=join(s[0..*3]) expected="abc" />
+<@assertEquals actual=join(s[2..*3]) expected="cd" />
+<@assertEquals actual=join(s[3..*3]) expected="d" />
+<@assertEquals actual=join(s[4..*3]) expected="" />
+<@assertFails message="5 is out of bounds">
+  <#assign _ = s[5..*3] />
+</...@assertFails>
+<@assertFails message="negative">
+  <#assign _ = s[-1..*2] />
+</...@assertFails>
+
+<#assign r = 1..2>
+<@assertEquals actual=join(s[r]) expected="bc" />
+<#assign r = 2..0>
+<@assertEquals actual=join(s[r]) expected="cba" />
+<#assign r = 1..<2>
+<@assertEquals actual=join(s[r]) expected="b" />
+<#assign r = 2..<0>
+<@assertEquals actual=join(s[r]) expected="cb" />
+<#assign r = 2..>
+<@assertEquals actual=join(s[r]) expected="cd" />
+<#assign r = 1..*2>
+<@assertEquals actual=join(s[r]) expected="bc" />
+<#assign r = 1..*-9>
+<@assertEquals actual=join(s[r]) expected="ba" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range.ftl
new file mode 100644
index 0000000..d2f5450
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/range.ftl
@@ -0,0 +1,50 @@
+<#--
+  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.
+-->
+<#include 'range-common.ftl'>
+
+<@assertEquals actual=(4..)?size expected=2147483647 />
+<@assertEquals actual=limitedJoin(4.., 3) expected="4, 5, 6, ..." />
+
+<@assertEquals actual=(4..)[0] expected=4 />
+<@assertEquals actual=(4..)[1] expected=5 />
+<@assertEquals actual=(4..)[1000000] expected=1000004 />
+<@assertFails message="out of bounds">
+	<@assertEquals actual=(4..)[-1] expected=5 />
+</@>
+
+<#assign r = 2147483646..>
+<@assertEquals actual=r?size expected=2147483647 />
+<@assertEquals actual=limitedJoin(r, 3) expected="2147483646, 2147483647, 2147483648, ..." />
+<@assertEquals actual=r[100] expected=2147483746 />
+
+<#assign r = -2..>
+<@assertEquals actual=limitedJoin(r, 5) expected="-2, -1, 0, 1, 2, ..." />
+<@assertEquals actual=r[0] expected=-2 />
+<@assertEquals actual=r[1] expected=-1 />
+
+<#function limitedJoin range limit>
+	<#assign joined="">
+	<#list range as i>
+		<#assign joined = joined + i?c>
+		<#if i_has_next><#assign joined = joined + ', '></#if>
+		<#local limit = limit - 1>
+		<#if limit == 0><#assign joined = joined + "..."><#break></#if>
+	</#list>
+	<#return joined>
+</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/recover.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/recover.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/recover.ftl
new file mode 100644
index 0000000..f7dc437
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/recover.ftl
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<#attempt>
+ <#assign sequence = ["Hello, World"]>
+ ${sequence[0]}
+<#recover>
+  We should never get here.
+</#recover>
+<#attempt>
+ Let's try to output an undefined variable: ${undefinedVariable}
+<#recover>
+ Well, that did not work.<@assert test=.error?contains('undefinedVariable') />
+ Now we nest another attempt/recover here:
+ <#attempt>
+   ${sequence[1]}
+ <#recover>
+   Oops...<@assert test=.error?contains('sequence[1]') />
+   Remember, freeMarker sequences are zero-based! ${sequence[0]}
+ </#recover>
+ Now we check the current error message.<@assert test=.error?contains('undefinedVariable') />
+</#recover>
+<#attempt>
+  <#include "nonexistent_template">
+<#recover>
+  The template is not currently available
+</#recover>
+<#attempt>
+  <#include "undefined.ftl">
+<#recover>
+  The included template had a problem.<@assert test=.error?contains('undefined_variable') />
+</#attempt>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/root.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/root.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/root.ftl
new file mode 100644
index 0000000..e1bc7f3
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/root.ftl
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<html>
+<head>
+<title>FreeMarker: Root Lookup Test</title>
+</head>
+<body>
+
+<p>A simple test follows:</p>
+
+<p>${message}</p>
+
+<p>Access the same variable via the root variable (dot syntax):</p>
+
+<p>${.data_model.message}</p>
+
+<p>Access the same variable via the root variable (bracket syntax):</p>
+
+<p>${.data_model["message"]}</p>
+
+<p>Ensure that root lookups are unaffected by local variables:</p>
+
+<#macro test message>
+  ${.data_model.message}
+  ${message}
+</#macro>
+
+<@test message + " Part Deux" />
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/sequence-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/sequence-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/sequence-builtins.ftl
new file mode 100644
index 0000000..e21bc2d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/sequence-builtins.ftl
@@ -0,0 +1,360 @@
+<#--
+  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.
+-->
+<@noOutput>
+<#setting locale="en_US">
+<#setting number_format="0.#########">
+
+<#assign ls = []?sort>
+<#list ls as i>
+- ${i}
+</#list>
+<@assertEquals expected=0 actual=ls?size />
+<@assertEquals expected=3 actual=set?size />
+</...@noOutput>
+Sorting scalars:
+----------------
+
+String order:
+<#assign ls = ["whale", "Barbara", "zeppelin", "aardvark", "beetroot"]?sort>
+<#list ls as i>
+- ${i}
+</#list>
+
+First: ${ls?first}
+Last: ${ls?last}
+Size ${ls?size}
+
+Numerical order:
+<#assign ls = [123?byte, 543, -324, -34?float, 0.11, 0, 111?int, 0.1?double, 1, 5]?sort>
+<#list ls as i>
+- ${i}
+</#list>
+
+First: ${ls?first}
+Last: ${ls?last}
+Size ${ls?size}
+
+Date/time order:
+<#assign x = [
+        '08:05'?time('HH:mm'),
+        '18:00'?time('HH:mm'),
+        '06:05'?time('HH:mm'),
+        '08:15'?time('HH:mm')]>
+<#list x?sort as i>
+- ${i?string('HH:mm')}
+</#list>
+
+Boolean order:
+<#assign x = [
+        true,
+        false,
+        false,
+        true]>
+<#list x?sort as i>
+- ${i?string}
+</#list>
+
+
+Sorting hashes:
+---------------
+
+<#assign ls = [
+  {"name":"whale", "weight":2000?short},
+  {"name":"Barbara", "weight":53},
+  {"name":"zeppelin", "weight":-200?float},
+  {"name":"aardvark", "weight":30?long},
+  {"name":"beetroot", "weight":0.3}
+]>
+Order by name:
+<#assign ls = ls?sort_by("name")>
+<#list ls as i>
+- ${i.name}: ${i.weight}
+</#list>
+
+Order by weight:
+<#assign ls = ls?sort_by("weight")>
+<#list ls as i>
+- ${i.name}: ${i.weight}
+</#list>
+
+Order by a.x.v:
+<#assign x = [
+        {"a": {"x": {"v": "qweqw", "w": "asd"}, "y": '1998-02-20'?date('yyyy-MM-dd')}},
+        {"a": {"x": {"v": "aqweqw", "w": "asd"}, "y": '1999-01-20'?date('yyyy-MM-dd')}},
+        {"a": {"x": {"v": "dfgdf", "w": "asd"}, "y": '1999-04-20'?date('yyyy-MM-dd')}},
+        {"a": {"x": {"v": "utyu", "w": "asd"}, "y": '1999-04-19'?date('yyyy-MM-dd')}}]>
+<#list x?sort_by(['a', 'x', 'v']) as i>
+- ${i.a.x.v}
+</#list>
+
+Order by a.y, which is a date:
+<#list x?sort_by(['a', 'y']) as i>
+- ${i.a.y?string('yyyy-MM-dd')}
+</#list>
+
+Reverse:
+--------
+
+Order by weight desc:
+<#assign ls = ls?reverse>
+<#list ls as i>
+- ${i.name}: ${i.weight}
+</#list>
+
+Order by weight desc desc:
+<#assign ls = ls?reverse>
+<#list ls as i>
+- ${i.name}: ${i.weight}
+</#list>
+
+Order by weight desc desc desc:
+<#assign ls = ls?reverse>
+<#list ls as i>
+- ${i.name}: ${i.weight}
+</#list>
+
+Contains:
+---------
+
+<#macro test></#macro>
+<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, '1992-02-21'?date('yyyy-MM-dd')]>
+True:
+${x?seq_contains(1.0)?string}
+${x?seq_contains("2")?string}
+${x?seq_contains(true)?string}
+${x?seq_contains('1992-02-21'?date('yyyy-MM-dd'))?string}
+${abcSet?seq_contains("a")?string}
+${abcSet?seq_contains("b")?string}
+${abcSet?seq_contains("c")?string}
+
+False:
+${x?seq_contains("1")?string}
+${x?seq_contains(2)?string}
+${x?seq_contains(false)?string}
+${x?seq_contains('1992-02-22'?date('yyyy-MM-dd'))?string}
+${abcSet?seq_contains("A")?string}
+${abcSet?seq_contains(1)?string}
+${abcSet?seq_contains(true)?string}
+
+<#assign x = []>
+False: ${x?seq_contains(1)?string}
+
+Index_of:
+---------
+
+<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, '1992-02-21'?date('yyyy-MM-dd')]>
+0 = ${x?seq_index_of(1.0)}
+1 = ${x?seq_index_of("2")}
+2 = ${x?seq_index_of(true)}
+6 = ${x?seq_index_of('1992-02-21'?date('yyyy-MM-dd'))}
+0 = ${abcSet?seq_index_of("a")}
+1 = ${abcSet?seq_index_of("b")}
+2 = ${abcSet?seq_index_of("c")}
+
+-1 = ${x?seq_index_of("1")}
+-1 = ${x?seq_index_of(2)}
+-1 = ${x?seq_index_of(false)}
+-1 = ${x?seq_index_of('1992-02-22'?date('yyyy-MM-dd'))}
+-1 = ${abcSet?seq_index_of("A")}
+-1 = ${abcSet?seq_index_of(1)}
+-1 = ${abcSet?seq_index_of(true)}
+
+<#assign x = []>
+-1 = ${x?seq_index_of(1)}
+
+Last_index_of:
+--------------
+
+<#assign x = [1, "2", true, [1,2,3], {"a":1}, test, 1, '1992-02-21'?date('yyyy-MM-dd')]>
+6 = ${x?seq_last_index_of(1.0)}
+1 = ${x?seq_last_index_of("2")}
+2 = ${x?seq_last_index_of(true)}
+7 = ${x?seq_last_index_of('1992-02-21'?date('yyyy-MM-dd'))}
+-1 = ${x?seq_last_index_of("1")}
+0 = ${abcSet?seq_last_index_of("a")}
+1 = ${abcSet?seq_last_index_of("b")}
+2 = ${abcSet?seq_last_index_of("c")}
+-1 = ${abcSet?seq_last_index_of("A")}
+
+Index_of and last_index_of with starting indices
+------------------------------------------------
+
+<#assign names = ["Joe", "Fred", "Joe", "Susan"]>
+seq_index_of "Joe":
+0 = ${names?seq_index_of("Joe", -2)}
+0 = ${names?seq_index_of("Joe", -1)}
+0 = ${names?seq_index_of("Joe", 0)}
+2 = ${names?seq_index_of("Joe", 1)}
+2 = ${names?seq_index_of("Joe", 2)}
+-1 = ${names?seq_index_of("Joe", 3)}
+-1 = ${names?seq_index_of("Joe", 4)}
+ 
+seq_last_index_of "Joe":
+-1 = ${names?seq_last_index_of("Joe", -2)}
+-1 = ${names?seq_last_index_of("Joe", -1)}
+0 = ${names?seq_last_index_of("Joe", 0)}
+0 = ${names?seq_last_index_of("Joe", 1)}
+2 = ${names?seq_last_index_of("Joe", 2)}
+2 = ${names?seq_last_index_of("Joe", 3)}
+2 = ${names?seq_last_index_of("Joe", 4)}
+ 
+seq_index_of "Susan":
+3 = ${names?seq_index_of("Susan", -2)}
+3 = ${names?seq_index_of("Susan", -1)}
+3 = ${names?seq_index_of("Susan", 0)}
+3 = ${names?seq_index_of("Susan", 1)}
+3 = ${names?seq_index_of("Susan", 2)}
+3 = ${names?seq_index_of("Susan", 3)}
+-1 = ${names?seq_index_of("Susan", 4)}
+ 
+seq_last_index_of "Susan":
+-1 = ${names?seq_last_index_of("Susan", -2)}
+-1 = ${names?seq_last_index_of("Susan", -1)}
+-1 = ${names?seq_last_index_of("Susan", 0)}
+-1 = ${names?seq_last_index_of("Susan", 1)}
+-1 = ${names?seq_last_index_of("Susan", 2)}
+3 = ${names?seq_last_index_of("Susan", 3)}
+3 = ${names?seq_last_index_of("Susan", 4)}
+
+seq_index_of "a":
+0 = ${abcSet?seq_index_of("a", -2)}
+0 = ${abcSet?seq_index_of("a", -1)}
+0 = ${abcSet?seq_index_of("a", 0)}
+-1 = ${abcSet?seq_index_of("a", 1)}
+-1 = ${abcSet?seq_index_of("a", 2)}
+-1 = ${abcSet?seq_index_of("a", 3)}
+-1 = ${abcSet?seq_index_of("a", 4)}
+
+seq_index_of "b":
+1 = ${abcSet?seq_index_of("b", -2)}
+1 = ${abcSet?seq_index_of("b", -1)}
+1 = ${abcSet?seq_index_of("b", 0)}
+1 = ${abcSet?seq_index_of("b", 1)}
+-1 = ${abcSet?seq_index_of("b", 2)}
+-1 = ${abcSet?seq_index_of("b", 3)}
+
+seq_index_of "c":
+2 = ${abcSet?seq_index_of("c", -2)}
+2 = ${abcSet?seq_index_of("c", -1)}
+2 = ${abcSet?seq_index_of("c", 0)}
+2 = ${abcSet?seq_index_of("c", 1)}
+2 = ${abcSet?seq_index_of("c", 2)}
+-1 = ${abcSet?seq_index_of("c", 3)}
+ 
+seq_last_index_of "a":
+-1 = ${abcSet?seq_last_index_of("a", -2)}
+-1 = ${abcSet?seq_last_index_of("a", -1)}
+0 = ${abcSet?seq_last_index_of("a", 0)}
+0 = ${abcSet?seq_last_index_of("a", 1)}
+0 = ${abcSet?seq_last_index_of("a", 2)}
+0 = ${abcSet?seq_last_index_of("a", 3)}
+0 = ${abcSet?seq_last_index_of("a", 4)}
+
+seq_last_index_of "b":
+-1 = ${abcSet?seq_last_index_of("b", -2)}
+-1 = ${abcSet?seq_last_index_of("b", -1)}
+-1 = ${abcSet?seq_last_index_of("b", 0)}
+1 = ${abcSet?seq_last_index_of("b", 1)}
+1 = ${abcSet?seq_last_index_of("b", 2)}
+1 = ${abcSet?seq_last_index_of("b", 3)}
+
+seq_last_index_of "c":
+-1 = ${abcSet?seq_last_index_of("c", -2)}
+-1 = ${abcSet?seq_last_index_of("c", -1)}
+-1 = ${abcSet?seq_last_index_of("c", 0)}
+-1 = ${abcSet?seq_last_index_of("c", 1)}
+2 = ${abcSet?seq_last_index_of("c", 2)}
+2 = ${abcSet?seq_last_index_of("c", 3)}
+
+Sequence builtins ignoring nulls
+--------------------------------
+
+true = ${listWithNull?seq_contains('c')?string}
+2 = ${listWithNull?seq_index_of('c')}
+0 = ${listWithNull?seq_last_index_of('a')}
+
+These should throw exception, but for BC they don't:
+false = ${listWithNull?seq_contains(noSuchVar)?string}
+-1 = ${listWithNull?seq_index_of(noSuchVar)}
+-1 = ${listWithNull?seq_last_index_of(noSuchVar)}
+
+Sequence built-ins failing on date-type mismatch
+------------------------------------------------
+
+<#assign x = ['1992-02-21'?date('yyyy-MM-dd'), 'foo']>
+<@assertEquals actual=x?seq_index_of('foo') expected=1 />
+<@assertEquals actual=x?seq_index_of('1992-02-21'?date('yyyy-MM-dd')) expected=0 />
+<@assertFails message="dates of different types">
+  0 = ${x?seq_index_of('1992-02-21 00:00:00'?datetime('yyyy-MM-dd HH:mm:ss'))}
+</@>
+
+Chunk
+-----
+
+<#assign ls = ['a', 'b', 'c', 'd', 'e', 'f', 'g']>
+<#list ['NULL', '-'] as fill>
+  <#list [1, 2, 3, 4, 5, 10] as columns>
+    <@printTable ls, columns, fill />
+  </#list>
+</#list>
+<@printTable [1, 2, 3, 4, 5, 6, 7, 8, 9], 3, 'NULL' />
+<@printTable [1, 2, 3, 4, 5, 6, 7, 8, 9], 3, '-' />
+<@printTable [1], 3, 'NULL' />
+<@printTable [1], 3, '-' />
+<@printTable [], 3, 'NULL' />
+<@printTable [], 3, '-' />
+
+<#macro printTable ls columns fill>
+  columns = ${columns}, fill = ${fill}:<#lt>
+  <#if fill='NULL'>
+    <#local rows = ls?chunk(columns)>
+  <#else>
+    <#local rows = ls?chunk(columns, fill)>
+  </#if>
+  Rows: ${rows?size}
+  <#list rows as row>
+    <#list row as i>${i} </#list>  <-- Columns: ${row?size}
+  </#list>
+  
+</#macro>
+
+
+Join
+----
+
+<#assign xs = [1, "two", "three", 4]>
+- ${xs?join(", ")}
+- ${[]?join(", ")}
+- ${xs?join(", ", "(empty)", ".")}
+- ${[]?join(", ", "(empty)", ".")}
+- ${listWithNull?join(", ")}
+- ${listWithNull?join(", ", "(empty)")}
+- ${listWithNull?join(", ", "(empty)", ".")}
+- ${listWithNullsOnly?join(", ")}
+- ${listWithNullsOnly?join(", ", "(empty)")}
+- ${listWithNullsOnly?join(", ", "(empty)", ".")}
+- ${abcSet?join(", ", "(empty)", ".")}
+- ${abcCollection?join(", ", "(empty)", ".")}
+<@assertFails message="index 1">${['a', [], 'c']?join(", ", "(empty)", ".")}</@>
+
+Misc
+----
+
+First of set 1: ${abcSet?first}
+First of set 2: ${abcSetNonSeq?first}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/setting.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/setting.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/setting.ftl
new file mode 100644
index 0000000..89f3e23
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/setting.ftl
@@ -0,0 +1,53 @@
+<#--
+  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.
+-->
+<#setting locale='de_DE'>
+<@assertEquals expected='de_DE' actual=.locale />
+<@assertEquals expected='de' actual=.lang />
+<@assertEquals expected='java.util.Locale "de_DE"' actual=javaObjectInfo.info(.locale_object) />
+
+<#setting number_format="'f'#">
+<@assertEquals expected='f1' actual=1?string />
+
+<#setting boolean_format="t,f">
+<@assertEquals expected='t' actual=true?string />
+
+<#setting date_format="'df'">
+<@assertEquals expected='df' actual=.now?date?string />
+
+<#setting time_format="'tf'">
+<@assertEquals expected='tf' actual=.now?time?string />
+
+<#setting datetime_format="'dtf'">
+<@assertEquals expected='dtf' actual=.now?string />
+
+<#setting time_zone='GMT+00'>
+<#assign t1='2000'?datetime('yyyy')>
+<#setting time_zone='GMT+01'>
+<#assign t2='2000'?datetime('yyyy')>
+<@assertEquals expected=1000*60*60 actual=t1?long-t2?long />
+
+<#setting sql_date_and_time_time_zone='GMT+01'>
+
+<#setting url_escaping_charset='ISO-8859-1'>
+<@assertEquals expected='%E1' actual='á'?url />
+<#setting url_escaping_charset='UTF-8'>
+<@assertEquals expected='%C3%A1' actual='á'?url />
+
+<#setting output_encoding="ISO-8859-2">
+<@assertEquals expected="ISO-8859-2" actual=.output_encoding />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/simplehash-char-key.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/simplehash-char-key.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/simplehash-char-key.ftl
new file mode 100644
index 0000000..07a3f1e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/simplehash-char-key.ftl
@@ -0,0 +1,44 @@
+<#--
+  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.
+-->
+<@assertEquals expected="string" actual=mStringC.c />
+<@assertEquals expected=1 actual=mStringC?keys?size />
+<@assertEquals expected="null" actual=mStringC.d!'null' />
+<@assertEquals expected=1 actual=mStringC?keys?size />
+
+<@assertEquals expected="null" actual=mStringCNull.c!'null' />
+<@assertEquals expected=1 actual=mStringCNull?keys?size />
+<@assertEquals expected="null" actual=mStringCNull.d!'null' />
+<@assertEquals expected=1 actual=mStringCNull?keys?size />
+
+<@assertEquals expected="char" actual=mCharC.c />
+<@assertEquals expected=1 actual=mCharC?keys?size />
+<@assertEquals expected="null" actual=mCharC.d!'null' />
+<@assertEquals expected=1 actual=mCharC?keys?size />
+
+<@assertEquals expected="null" actual=mCharCNull.c!'null' />
+<@assertEquals expected=1 actual=mCharCNull?keys?size />
+<@assertEquals expected="null" actual=mCharCNull.d!'null' />
+<@assertEquals expected=1 actual=mCharCNull?keys?size />
+
+<@assertEquals expected="char" actual=mMixed.c />
+<@assertEquals expected="string" actual=mMixed.s />
+<@assertEquals expected="string2" actual=mMixed.s2 />
+<@assertEquals expected="null" actual=mMixed.s2n!'null' />
+<@assertEquals expected="null" actual=mMixed.wrong!'null' />
+<@assertEquals expected=4 actual=mMixed?keys?size />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/specialvars.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/specialvars.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/specialvars.ftl
new file mode 100644
index 0000000..50416c9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/specialvars.ftl
@@ -0,0 +1,38 @@
+<#--
+  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.
+-->
+<#-- Mostly just checks if the expressions doesn't fail -->
+<#assign works = .data_model>
+<#attempt>
+  ${noSuchVariableExists}
+<#recover>
+  <#assign works = .error>
+</#attempt>
+<#assign works = .globals>
+${.lang} == en
+${.locale} == en_US
+<#assign works = .locals!>
+<#assign works = .main>
+<#assign works = .node!>
+${.output_encoding?lower_case} == utf-8
+${.template_name} == specialvars.ftl
+${.url_escaping_charset?lower_case} == iso-8859-1
+<#assign foo = "x">
+${.vars['foo']} == x
+<#assign works = .version>
+${.now?is_datetime?c} == true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtin-coercion.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtin-coercion.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtin-coercion.ftl
new file mode 100644
index 0000000..5d2e094
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtin-coercion.ftl
@@ -0,0 +1,34 @@
+<#--
+  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.
+-->
+Was broken 2.3.19:
+<#setting number_format="0.#">
+<@assert test=1232?contains('2') />
+<@assert test=1232?index_of('2') == 1 />
+<@assert test=1232?last_index_of('2') == 3 />
+<@assert test=1232?left_pad(6) == '  1232' /><@assert test=1232?left_pad(6, '0') == '001232' />
+<@assert test=1232?right_pad(6) == '1232  ' /><@assert test=1232?right_pad(6, '0') == '123200' />
+<@assert test=1232?matches('[1-3]+') />
+<@assert test=1232?replace('2', 'z') == '1z3z' />
+<@assert test=1232?replace('2', 'z', 'r') == '1z3z' />
+<@assert test=1232?split('2')[1] == '3' /><@assert test=1232?split('2')[2] == '' />
+<@assert test=1232?split('2', 'r')[1] == '3' />
+
+Was no broken in 2.3.19:
+<@assert test=1232?starts_with('12') />
+<@assert test=1232?ends_with('32') />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps-matches.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps-matches.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps-matches.ftl
new file mode 100644
index 0000000..201f404
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/string-builtins-regexps-matches.ftl
@@ -0,0 +1,118 @@
+<#--
+  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.
+-->
+<#assign input>
+L16
+L27
+L38
+L49
+</#assign>
+
+List mode:
+<#assign matches = input?matches(".+") >
+Size: ${matches?size}
+<#list 0..<matches?size as i>[${matches[i]}]</#list>
+<#list matches as m>[${m}]</#list>
+
+Iterator mode:
+<#assign matches = input?matches(".+") >
+<#list matches as m>[${m}]</#list>
+<#list matches as m>[${m}(${matches?join(', ')})]</#list>
+<#list matches as m>[${m}]</#list>
+
+Iterator mode changes to list mode:
+<#assign matches = input?matches(".+") >
+<#list matches as m>[${m}]/${matches?size}</#list>
+<#list matches as m>[${m}]</#list>
+
+Iterator mode changes to list mode 2:
+<#assign matches = input?matches(".+") >
+<#list matches as m>[${m}]</#list>
+<#list matches as m>[${m}]/${matches?size}<#t></#list>
+
+List mode with embedded iteration:
+<#assign matches = input?matches(".+") >
+<#list 0..<matches?size as i>[${matches[i]}(${matches?join(', ')})]</#list>
+
+Entire input match:
+<#assign matches = input?matches(r".*(\d)(\d)") >
+<#assign firstGS = false>
+<#list matches as m>
+- M: ${m}
+    <#if firstGS?is_boolean>
+      <#assign firstGS = m?groups>
+    </#if>
+    <#list m?groups as g>
+    - G: ${g}
+    </#list>
+</#list>
+firstGS was: ${firstGS?join(', ')}
+
+Entire input match 2:
+<#assign match = "x12"?matches(r"x(\d)(\d)") >
+Matches: ${match?c}
+<#list match?groups as g>
+- G: ${g}
+</#list>
+As list:
+<#list match as m>
+- M: ${m}
+  <#list m?groups as g>
+    - G: ${g}
+  </#list>
+</#list>
+Groups again:
+<#list match?groups as g>
+- G: ${g}
+</#list>
+
+Entire input match 3:
+<#assign match = "x12"?matches(r"y(\d)(\d)") >
+Matches: ${match?c}
+<@assertEquals expected=3 actual=match?groups?size />
+<@assertEquals expected=0 actual=match?size />
+
+Entire input match 4:
+<#assign match = "x12"?matches(r"x(\d)(\d)") >
+Matches: ${match?c}
+<#assign gs = match?groups>
+<@assertEquals expected=3 actual=gs?size />
+<@assertEquals expected=1 actual=match?size />
+- G: ${gs[0]}
+- G: ${match?groups[1]}
+- G: ${gs[2]}
+
+Substring match nested into entire input match:
+<#assign match = "x12"?matches(r"x(\d)(\d)") >
+<#list match?groups as g>
+- G: ${g} (<#list match as m>[${m}{${m?groups?join(', ')}}]</#list>)
+</#list>
+
+Different entire input and substring matches:
+<#assign match = "123"?matches(r"(\d+?)") >
+${match?groups?join(", ")}
+<#list match as m>
+- M: ${m} (Gs: ${m?groups?join(", ")})
+</#list>
+
+Different entire input and substring matches 2:
+<#assign match = "123"?matches(r"\d+?") >
+${match?groups?join(", ")}
+<#list match as m>
+- M: ${m} (Gs: ${m?groups?join(", ")})
+</#list>
\ No newline at end of file