http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java b/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java index 2e7cc56..924e170 100644 --- a/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java +++ b/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java @@ -19,48 +19,38 @@ package org.apache.freemarker.core; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.util.Collections; import java.util.Date; import java.util.HashSet; -import org.apache.freemarker.core.Configuration; import org.apache.freemarker.core.model.TemplateBooleanModel; import org.apache.freemarker.core.model.TemplateModelException; import org.apache.freemarker.core.model.impl.DefaultArrayAdapter; import org.apache.freemarker.core.model.impl.DefaultListAdapter; import org.apache.freemarker.core.model.impl.DefaultMapAdapter; +import org.apache.freemarker.core.model.impl.DefaultObjectWrapperTest.TestBean; import org.apache.freemarker.core.model.impl.SimpleDate; -import org.apache.freemarker.core.model.impl.SimpleHash; import org.apache.freemarker.core.model.impl.SimpleNumber; import org.apache.freemarker.core.model.impl.SimpleObjectWrapper; import org.apache.freemarker.core.model.impl.SimpleScalar; import org.apache.freemarker.core.model.impl.SimpleSequence; -import org.apache.freemarker.core.model.impl.DefaultObjectWrapperTest.TestBean; import org.junit.Test; public class SimpleObjectWrapperTest { @Test public void testBasics() throws TemplateModelException { - { - SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_2_3_22); - testCustomizationCommonPart(ow); - assertTrue(ow.wrap(Collections.emptyMap()) instanceof DefaultMapAdapter); - assertTrue(ow.wrap(Collections.emptyList()) instanceof DefaultListAdapter); - assertTrue(ow.wrap(new boolean[] { }) instanceof DefaultArrayAdapter); - assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence); // at least until IcI 2.4 - } - - { - SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_2_3_21); - testCustomizationCommonPart(ow); - assertTrue(ow.wrap(Collections.emptyMap()) instanceof SimpleHash); - assertTrue(ow.wrap(Collections.emptyList()) instanceof SimpleSequence); - assertTrue(ow.wrap(new boolean[] { }) instanceof SimpleSequence); - assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence); - } + SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0); + testCustomizationCommonPart(ow); + assertTrue(ow.wrap(Collections.emptyMap()) instanceof DefaultMapAdapter); + assertTrue(ow.wrap(Collections.emptyList()) instanceof DefaultListAdapter); + assertTrue(ow.wrap(new boolean[] { }) instanceof DefaultArrayAdapter); + assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence); // at least until IcI 2.4 } @SuppressWarnings("boxing")
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt deleted file mode 100644 index cdffd2a..0000000 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.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. - */ -a1: - -any:a1 was null, set to 0 -a1: 0 -page:a1 was 0, set to 1 -a1: 1 -request:a1 was null, set to 2 -session:a1 was null, set to 3 -application:a1 was null, set to 4 -Request.a1: 2 -Session.a1: 3 -Application.a1: 4 -a1: 1 -page:a1 was 1, set to null -a1: 2 -request:a1 was 2, set to null -a1: 3 -session:a1 was 3, set to null -a1: 4 -application:a1 was 4, set to null -a1: - -a2: - -application:a2 was null, set to 4 -a2: 4 -session:a2 was null, set to 3 -a2: 3 -request:a2 was null, set to 2 -a2: 2 -page:a2 was null, set to 1 -a2: 1 -G1 -page:a1 was G1, set to P1 -P1 -G2 -page:a2 was G2, set to P2 -P2 -Values created in the template: -String: s [java.lang.String] -Number: 1 [java.math.BigDecimal] -Boolean: true [java.lang.Boolean] -Date-time: [IGNORED] -Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence] -Hash: {"a": 1, "b": 2, "c": 3} [org.apache.freemarker.core.ast.HashLiteral$SequenceHash] -Values created in Java: -LinkedList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence] -ArrayList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence] -MyList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence] -LinkedHashMap: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.SimpleHash] -TreeMap: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.SimpleHash] -MyMap: [IGNORED] [org.apache.freemarker.core.model.impl.SimpleHash] -TreeSet: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt deleted file mode 100644 index 01c8f88..0000000 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt +++ /dev/null @@ -1,73 +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. - */ -a1: - -any:a1 was null, set to 0 -a1: 0 -page:a1 was 0, set to 1 -a1: 1 -request:a1 was null, set to 2 -session:a1 was null, set to 3 -application:a1 was null, set to 4 -Request.a1: 2 -Session.a1: 3 -Application.a1: 4 -a1: 1 -page:a1 was 1, set to null -a1: 2 -request:a1 was 2, set to null -a1: 3 -session:a1 was 3, set to null -a1: 4 -application:a1 was 4, set to null -a1: - - -a2: - -application:a2 was null, set to 4 -a2: 4 -session:a2 was null, set to 3 -a2: 3 -request:a2 was null, set to 2 -a2: 2 -page:a2 was null, set to 1 -a2: 1 - -G1 -page:a1 was G1, set to P1 -P1 - -G2 -page:a2 was G2, set to P2 -P2 - -Values created in the template: -String: s [java.lang.String] -Number: 1 [java.math.BigDecimal] -Boolean: true [java.lang.Boolean] -Date-time: 2014-12-20T16:19:00Z [java.util.Date] -Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.beans.SequenceAdapter] -Hash: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.beans.HashAdapter] - -Values created in Java: -LinkedList: [1, 2, 3] [java.util.LinkedList] -ArrayList: [1, 2, 3] [java.util.ArrayList] -MyList: [1, 2, 3] [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyList] -LinkedHashMap: {a=1, b=2, c=3} [java.util.LinkedHashMap] -TreeMap: {a=1, b=2, c=3} [java.util.TreeMap] -MyMap: {a=1, b=2, c=3} [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyMap] -TreeSet: [1, 2, 3] [java.util.TreeSet] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt new file mode 100644 index 0000000..01c8f88 --- /dev/null +++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +a1: - +any:a1 was null, set to 0 +a1: 0 +page:a1 was 0, set to 1 +a1: 1 +request:a1 was null, set to 2 +session:a1 was null, set to 3 +application:a1 was null, set to 4 +Request.a1: 2 +Session.a1: 3 +Application.a1: 4 +a1: 1 +page:a1 was 1, set to null +a1: 2 +request:a1 was 2, set to null +a1: 3 +session:a1 was 3, set to null +a1: 4 +application:a1 was 4, set to null +a1: - + +a2: - +application:a2 was null, set to 4 +a2: 4 +session:a2 was null, set to 3 +a2: 3 +request:a2 was null, set to 2 +a2: 2 +page:a2 was null, set to 1 +a2: 1 + +G1 +page:a1 was G1, set to P1 +P1 + +G2 +page:a2 was G2, set to P2 +P2 + +Values created in the template: +String: s [java.lang.String] +Number: 1 [java.math.BigDecimal] +Boolean: true [java.lang.Boolean] +Date-time: 2014-12-20T16:19:00Z [java.util.Date] +Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.beans.SequenceAdapter] +Hash: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.beans.HashAdapter] + +Values created in Java: +LinkedList: [1, 2, 3] [java.util.LinkedList] +ArrayList: [1, 2, 3] [java.util.ArrayList] +MyList: [1, 2, 3] [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyList] +LinkedHashMap: {a=1, b=2, c=3} [java.util.LinkedHashMap] +TreeMap: {a=1, b=2, c=3} [java.util.TreeMap] +MyMap: {a=1, b=2, c=3} [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyMap] +TreeSet: [1, 2, 3] [java.util.TreeSet] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml index b4b2d9e..0fa1a03 100644 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml +++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml @@ -57,7 +57,7 @@ <!-- FreeMarker settings: --> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.22</param-value> + <param-value>3.0.0</param-value> <!-- Recommended to set to a high value. For the details, see the Java API docs of freemarker.template.Configuration#Configuration(Version). --> </init-param> @@ -87,47 +87,17 @@ </servlet> <servlet> - <servlet-name>freemarker-2.3.0</servlet-name> + <servlet-name>freemarker-modernModels</servlet-name> <servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class> <!-- Specific parts: --> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.0</param-value> - </init-param> - - <!-- Common parts: --> - <init-param> - <param-name>TemplatePath</param-name> - <param-value>/</param-value> - </init-param> - <init-param> - <param-name>locale</param-name> - <param-value>en_US</param-value> - </init-param> - <init-param> - <param-name>default_encoding</param-name> - <param-value>UTF-8</param-value> <!-- The encoding of the template files. --> - </init-param> - <init-param> - <param-name>template_exception_handler</param-name> - <!-- Some may prefer "html_debug" for development. --> - <param-value>rethrow</param-value> - </init-param> - </servlet> - - <servlet> - <servlet-name>freemarker-2.3.22-future</servlet-name> - <servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class> - - <!-- Specific parts: --> - <init-param> - <param-name>incompatible_improvements</param-name> - <param-value>2.3.22</param-value> + <param-value>3.0.0</param-value> </init-param> <init-param> <param-name>object_wrapper</param-name> - <param-value>DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)</param-value> + <param-value>DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)</param-value> </init-param> <!-- Common parts: --> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml index a847471..67818b0 100644 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml +++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml @@ -90,14 +90,10 @@ <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertDefaultsFreemarkerServlet</servlet-class> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.22</param-value> + <param-value>3.0.0</param-value> </init-param> </servlet> <servlet> - <servlet-name>freemarker-assertDefaultsIcI2322FreemarkerServlet</servlet-name> - <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertDefaultsIcI2322FreemarkerServlet</servlet-class> - </servlet> - <servlet> <servlet-name>freemarker-assertCustomizedDefaultsFreemarkerServlet</servlet-name> <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertCustomizedDefaultsFreemarkerServlet</servlet-class> </servlet> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml index 9269f00..5d5cd20 100644 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml +++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml @@ -43,7 +43,7 @@ </init-param> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.22</param-value> + <param-value>3.0.0</param-value> </init-param> <init-param> <param-name>template_exception_handler</param-name> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml index b999f5d..079681c 100644 --- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml +++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml @@ -59,7 +59,7 @@ <!-- FreeMarker settings: --> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.21</param-value> + <param-value>3.0.0</param-value> </init-param> <init-param> <param-name>template_exception_handler</param-name> @@ -113,7 +113,7 @@ <!-- FreeMarker settings: --> <init-param> <param-name>incompatible_improvements</param-name> - <param-value>2.3.22</param-value> + <param-value>3.0.0</param-value> </init-param> <init-param> <param-name>template_exception_handler</param-name> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/servlet/web.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/servlet/web.xml b/src/test/resources/org/apache/freemarker/test/servlet/web.xml new file mode 100644 index 0000000..f6322fd --- /dev/null +++ b/src/test/resources/org/apache/freemarker/test/servlet/web.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" 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. +--> + +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <servlet> + <servlet-name>controller</servlet-name> + <servlet-class>com.example.Model2ControllerServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>controller</servlet-name> + <url-pattern>*.c</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>controller</servlet-name> + <url-pattern>/</url-pattern> + </servlet-mapping> + + <servlet> + <servlet-name>freemarker</servlet-name> + <servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class> + + <!-- FreemarkerServlet settings: --> + <init-param> + <param-name>TemplatePath</param-name> + <param-value>/</param-value> + </init-param> + <init-param> + <param-name>NoCache</param-name> + <param-value>true</param-value> + </init-param> + <init-param> + <param-name>ContentType</param-name> + <param-value>text/html; charset=UTF-8</param-value> <!-- Forces UTF-8 output encoding! --> + </init-param> + + <!-- FreeMarker settings: --> + <init-param> + <param-name>incompatible_improvements</param-name> + <param-value>3.0.0</param-value> + </init-param> + <init-param> + <param-name>template_exception_handler</param-name> + <!-- Some may prefer "html_debug" for development. --> + <param-value>rethrow</param-value> + </init-param> + <init-param> + <param-name>template_update_delay</param-name> + <param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. --> + </init-param> + <init-param> + <param-name>default_encoding</param-name> + <param-value>UTF-8</param-value> <!-- The encoding of the template files. --> + </init-param> + <init-param> + <param-name>number_format</param-name> + <param-value>0.##########</param-value> + </init-param> + + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>freemarker</servlet-name> + <url-pattern>*.ftl</url-pattern> + </servlet-mapping> + + <!-- Prevent the visiting of MVC Views from outside the servlet container. + RequestDispatcher.forward/include should and will still work. Removing this + may open security holes! --> + <security-constraint> + <web-resource-collection> + <web-resource-name>FreeMarker MVC Views</web-resource-name> + <url-pattern>*.ftl</url-pattern> + </web-resource-collection> + <auth-constraint> + <!-- Nobody is allowed to visit these --> + </auth-constraint> + </security-constraint> + +</web-app> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt deleted file mode 100644 index aff6329..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.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: [&<>"'{}\a/] -xml: [&<>"'{}\a/] -xhtml: [&<>"'{}\a/] -rtf: [&<>"'\{\}\\a/] -html: [a&a<a>a"a'a{a}a\] -xml: [a&a<a>a"a'a{a}a\] -xhtml: [a&a<a>a"a'a{a}a\] -rtf: [a&a<a>a"a'a\{a\}a\\] -html: [<<<<<] -xml: [<<<<<] -xhtml: [<<<<<] -rtf: [\{\{\{\{\{] -html: [] -xml: [] -xhtml: [] -rtf: [] -html: [a] -xml: [a] -xhtml: [a] -rtf: [a] -html: [&] -xml: [&] -xhtml: [&] -rtf: [\{] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt index 2ea37e2..aff6329 100644 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt +++ b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt @@ -18,11 +18,11 @@ */ FreeMarker: Encoding built-in tests -html: [&<>"'{}\a/] +html: [&<>"'{}\a/] xml: [&<>"'{}\a/] xhtml: [&<>"'{}\a/] rtf: [&<>"'\{\}\\a/] -html: [a&a<a>a"a'a{a}a\] +html: [a&a<a>a"a'a{a}a\] xml: [a&a<a>a"a'a{a}a\] xhtml: [a&a<a>a"a'a{a}a\] rtf: [a&a<a>a"a'a\{a\}a\\] http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt deleted file mode 100644 index df0becc..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.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. - */ - KVPs: - a = 1 - b = 2 - a = 3 - - Keys: - a - b - a - - Values: - 1 - 2 - 3 - - KVPs: - - Keys: - - Values: - http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt deleted file mode 100644 index 653cbe3..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.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: - http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt new file mode 100644 index 0000000..653cbe3 --- /dev/null +++ b/src/test/resources/org/apache/freemarker/test/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: + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt deleted file mode 100644 index 0554864..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.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 1 0 0 0 1 0 0 -0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt deleted file mode 100644 index 924bbe8..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.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 1 0 0 -0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt index d3ac7fa..924bbe8 100644 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt +++ b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt @@ -29,5 +29,5 @@ StNuBoMeTaMaHaHxSeCoCxEnInDiNo 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 1 0 0 1 1 0 0 -0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl deleted file mode 100644 index d70a854..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl +++ /dev/null @@ -1,159 +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")}</@> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl deleted file mode 100644 index 03ffd00..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.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. ---> -<#include "dateformat-iso-bi-common.ftl"> - -<#setting time_zone="GMT+02"> -<@assertEquals actual=sqlTime?iso_local expected="22:38:05" /> -<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" /> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl index c2d7ad4..4dc191b 100644 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl +++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl @@ -16,8 +16,148 @@ specific language governing permissions and limitations under the License. --> -<#include "dateformat-iso-bi-common.ftl"> +<#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+02:00" /> -<@assertEquals actual=sqlTime?iso_utc expected="20:38:05Z" /> +<@assertEquals actual=sqlTime?iso_local expected="22:38:05" /> +<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" /> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl index 8374a5e..2839dec 100644 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl +++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl @@ -92,16 +92,9 @@ ${({} + { "a" : "foo" }).a}, ${({ "a" : "bar" } + {}).a} <@noOutput> <#assign m = { 'a': 1, 'b', 2, 'a': 3 }> -<#if iciIntValue gte 2003021> - <@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'] /> -<#else> - <@assertEquals expected="a, b, a" actual=m?keys?join(', ') /> - <@assertEquals expected="1, 2, 3" actual=m?values?join(', ') /> - <@assertEquals expected=3 actual=m['a'] /> - <@assertEquals expected=2 actual=m['b'] /> -</#if> +<@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/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl index ffdf8fb..1c09b68 100644 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl +++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl @@ -34,17 +34,9 @@ ${double3?c} ${double4?c} ${bigDecimal?c} ${bigDecimal2?c} -<#if iciIntValue gte 2003021> - <@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 /> -<#else> - <#setting locale = "en_US"> - <#setting number_format = "0.#"> - <@assertEquals expected="INF"?number?string actual="INF"?number?c /> - <@assertEquals expected="-INF"?number?string actual="-INF"?number?c /> - <@assertEquals expected="NaN"?number?string actual="NaN"?number?c /> -</#if> \ No newline at end of file +<@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/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl ---------------------------------------------------------------------- diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl deleted file mode 100644 index b65be17..0000000 --- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl +++ /dev/null @@ -1,285 +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. ---> -<#-- The parts of the IcI 2.3.20 tests that give the same result regardless of method introspection order --> -<#-- Note that the point of 2.3.20 tests is to check if bugs fixed in 2.3.21 are still emulated in pre-2.3.21 mode --> - -<#include "overloaded-methods-2-common.ftl"> - -<@assertFails message="no compatible overloaded">${obj.mNull1(null)}</@> -<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" /> -<@assertEquals actual=obj.mNull2(null) expected="mNull2(Object a1 = null)" /> -<@assertFails message="no compatible overloaded">${obj.mVarargs('a', null)}</@> -<@assertFails message="no compatible overloaded">${obj.mVarargs(null, 'a')}</@> -<@assertFails message="multiple compatible overloaded">${obj.mSpecificity('a', 'b')}</@> -<@assertFails message="multiple compatible overloaded">${obj.mBoolean(true)}</@> - -<@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 --> -<@assertFails message="no compatible overloaded">${obj.mNumBoxedVSBoxed(123.5)}</@> -<@assertFails message="no compatible overloaded">${obj.mNumBoxedVSBoxed(123?int)}</@> -<@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 --> - -<@assertFails message="multiple compatible overloaded">${obj.mIntPrimVSBoxed(123?int)}</@> - -<@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)" /> -<@assertFails message="no compatible overloaded">${obj.mNumPrimVSPrim(123?double)}</@> -<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(short a1 = -7616)" /> <#-- overflow due to bad choice --> - -<@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)" /> -<@assertFails message="multiple compatible overloaded">${obj.mNumPrimAll(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)" /> - -<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?byte)}</@> -<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" /> -<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?int)}</@> -<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" /> -<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?float)}</@> -<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" /> - -<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123?int)}</@> -<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123?long)}</@> -<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.0)" /> -<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123)}</@> -<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(Number a1 = 123)" /> -<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" /> - -<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" /> -<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" /> -<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.0)" /> -<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" /> -<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" /> -<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" /> - -<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(int a1 = 1)" /><#-- Yes, buggy... --> -<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" /> - -<#-- BigDecimal conversions chose the smallest target type before IcI 2.3.31, increasing the risk of overflows: --> -<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" /> -<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" /> -<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(short 1)" /> -<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" /> -<@assertEquals actual=obj.nIntAndShort(1?int) expected="nIntAndShort(int 1)" /> -<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(short 1)" /> -<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" /> -<@assertEquals actual=obj.nLongAndShort(1?long) expected="nLongAndShort(long 1)" /> - -<#-- Usual wrong choice on null: --> -<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(Object s = null, Object... xs = [1, 2, 3.5])' /> - -<#-- Some bugs that cause loosing of decimals will occur here... --> -<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1, 2, 3.5)}</@> -<@assertEquals actual=obj.varargs1('s', 1, 2, 'c') expected='varargs1(String s = "s", Object... xs = [1, 2, c])' /> -<@assertEquals actual=obj.varargs1('s', 1, 'b', 3) expected='varargs1(String s = "s", Object... xs = [1, b, 3])' /> -<@assertEquals actual=obj.varargs1('s', 'a', 2, 3) expected='varargs1(String s = "s", Object... xs = [a, 2, 3])' /> -<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1, 2, 3)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1.1, 2.1, 3.1)}</@> -<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' /> -<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.varargs1('s', 1?double, 2?byte, 3?byte) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' /></@> -<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' /> -<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1?double, 2?double, 3?double)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs1('s')}</@> - -<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(int... xs = [1, 2, 3])' /> -<@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(double... xs = [1.0, 2.0, 3.0])' /> - -<@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(Object... xs = [null, b, null])' /> -<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Object... 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(Object... xs = [null, null, null])' /> -<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' /> - -<@assertFails message="no compatible overloaded">${obj.varargs4(null, null, null)}</@> - -<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3, 4, 5)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3, 4)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2)}</@> -<@assertFails message="multiple compatible overloaded">${obj.varargs5(1)}</@> -<@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])' /> - -<@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)' /> -<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1?double)}</@> -<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@> -<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(null)}</@> - -<@assertEquals actual=obj.mNullAmbiguous2(null) expected='mNullAmbiguous(Object o = null)' /> - -<@assertFails message="no compatible overloaded">${obj.mNullNonAmbiguous(null)}</@> - -<@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)' /> - -<@assertFails message="no compatible overloaded">${obj.mRareWrappings2(obj.adaptedNumber)}</@> - -<#-- 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)' /> - -<@assertFails message="no compatible overloaded"><@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)' /> - -<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' /></@> -<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' /> - -<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@> -<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@> - -<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" /> -<@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(['a', 'b'])}</@> -<#if !dow> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVsListPreference(obj.javaObjectArray)}</@> -</#if> -<@assertFails message="no compatible overloaded">${obj.mIntArrayVsIntegerArrayPreference([1, 2])}</@> - -<#if dow> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray)}</@> -<#else> - <@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])" /> -</#if> - -<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded([1, 2], 3)}</@> -<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3)}</@> -<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3)}</@> -<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded(obj.javaByteList, 3)}</@> - -<@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(['a', 'b'])}</@> -<#if dow> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(obj.javaStringList)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(obj.javaStringArray)}</@> -<#else> - <@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [[a, b]])" /> <#-- toString() accident... --> - <@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" /> -</#if> -<@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(['a'])}</@> - -<#if dow> - <#-- As with DOW we never end up with array-s after unwrapping, they just work like Lists: --> - <@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" /> - <@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" /> - <@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" /> - <@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]])" /> -<#else> - <#-- Pure BeansWrapper unwraps to array-s, but before IcI 2.3.21 it couldn't treat them as Lists: --> - <@assertFails message="no compatible overloaded">${obj.mListOrString(obj.javaStringArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mListListOrString(obj.javaStringArrayArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mListOrString(obj.javaIntArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray)}</@> - <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList)}</@> -</#if> - -<@assertFails message="no compatible overloaded">${obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays)}</@> -<@assertFails message="no compatible overloaded">${obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays)}</@> - -<@assertFails message="no compatible overloaded">${obj.mMapOrBoolean(obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBoolean(obj.booleanAndScalarModel)}</@> - -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels)}</@> - -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels)}</@> - -<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" /> -<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" /></@> -<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" /> -<@assertFails message="no compatible overloaded">${obj.mDateOrArray(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mStringOrArray(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mBooleanOrArray(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mMapOrArray(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mListOrArray(obj.allModels)}</@> -<@assertFails message="no compatible overloaded">${obj.mSetOrArray(obj.allModels)}</@> - -<@assertFails message="no compatible overloaded">${obj.mCharOrCharacterOverloaded(null)}</@> -<@assertFails message="no compatible overloaded">${obj.mCharOrBooleanOverloaded('c')}</@> -<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" /> - -<@assertFails message="no compatible overloaded">${obj.mCharOrStringOverloaded('c', true)}</@> -<@assertFails message="no compatible overloaded">${obj.mCharacterOrStringOverloaded('c', true)}</@> -<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(String c)" /> -<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(String c)" /> - -<#-- 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(Object... fields) on input: fields=[{name=Billy, lastName=Pilgrim}, null]" />
