freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [4/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.
Date Mon, 20 Feb 2017 10:14:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java
deleted file mode 100644
index 28f7024..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003020 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003020() {
-        super(Configuration.VERSION_2_3_20, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java
deleted file mode 100644
index 9cbc8ee..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003021 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003021() {
-        super(Configuration.VERSION_2_3_21, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java
deleted file mode 100644
index 8a9692e..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003022 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003022() {
-        super(Configuration.VERSION_2_3_22, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java
new file mode 100644
index 0000000..60a331a
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.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.model.impl.beans;
+
+import org.apache.freemarker.core.Configuration;
+
+public class DefaultObjectWrapperInc extends DefaultObjectWrapperWithSortedMethods {
+
+    public DefaultObjectWrapperInc() {
+        super(Configuration.VERSION_3_0_0, false);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java
deleted file mode 100644
index 5bef55c..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003020 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003020() {
-        super(Configuration.VERSION_2_3_20, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java
deleted file mode 100644
index fd3f6a7..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003021 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003021() {
-        super(Configuration.VERSION_2_3_21, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java
deleted file mode 100644
index 3107c76..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003022 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003022() {
-        super(Configuration.VERSION_2_3_22, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
index f8912eb..bcaf81a 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
@@ -19,7 +19,13 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 
@@ -29,7 +35,6 @@ import org.apache.freemarker.core.model.TemplateMethodModelEx;
 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.beans.BeansWrapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -39,7 +44,7 @@ public class EnumModelsTest {
     
     @Test
     public void modelCaching() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         TemplateHashModel enums = bw.getEnumModels();
         TemplateHashModel e = (TemplateHashModel) enums.get(E.class.getName());
         assertNotNull(e);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
index 37791d1..8b097a0 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
@@ -18,29 +18,31 @@
  */
 
 package org.apache.freemarker.core.model.impl.beans;
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.util.Collections;
 import java.util.Date;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.ast.HTMLOutputFormat;
 import org.apache.freemarker.core.ast.TemplateHTMLOutputModel;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
 import org.junit.Test;
 
 public class ErrorMessagesTest {
 
     @Test
     public void getterMessage() throws TemplateModelException {
-        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
         TemplateHashModel thm= (TemplateHashModel) bw.wrap(new TestBean());
         
         try {
@@ -58,68 +60,66 @@ public class ErrorMessagesTest {
     public void markupOutputParameter() throws Exception {
         TemplateHTMLOutputModel html = HTMLOutputFormat.INSTANCE.fromMarkup("<p>a");
 
-        for (Version ici : new Version[] { Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_24 }) {
-            BeansWrapper bw = new BeansWrapperBuilder(ici).build();
-            TemplateHashModel thm = (TemplateHashModel) bw.wrap(new TestBean());
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m1");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("String"), containsString("convert"), containsString("markup_output"),
-                            containsString("Tip:"), containsString("?markup_string")));
-                }
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        TemplateHashModel thm = (TemplateHashModel) bw.wrap(new TestBean());
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m1");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("String"), containsString("convert"), containsString("markup_output"),
+                        containsString("Tip:"), containsString("?markup_string")));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m2");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("Date"), containsString("convert"), containsString("markup_output"),
-                            not(containsString("?markup_string"))));
-                }
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m2");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("Date"), containsString("convert"), containsString("markup_output"),
+                        not(containsString("?markup_string"))));
             }
-            
-            for (String methodName : new String[] { "mOverloaded", "mOverloaded3" }) {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get(methodName);
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("No compatible overloaded"),
-                            containsString("String"), containsString("markup_output"),
-                            containsString("Tip:"), containsString("?markup_string")));
-                }
+        }
+        
+        for (String methodName : new String[] { "mOverloaded", "mOverloaded3" }) {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get(methodName);
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("No compatible overloaded"),
+                        containsString("String"), containsString("markup_output"),
+                        containsString("Tip:"), containsString("?markup_string")));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded2");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("No compatible overloaded"),
-                            containsString("Integer"), containsString("markup_output"),
-                            not(containsString("?markup_string"))));
-                }
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded2");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("No compatible overloaded"),
+                        containsString("Integer"), containsString("markup_output"),
+                        not(containsString("?markup_string"))));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded4");
-                Object r = m.exec(Collections.singletonList(html));
-                if (r instanceof TemplateScalarModel) {
-                    r = ((TemplateScalarModel) r).getAsString();
-                }
-                assertEquals("<p>a", r);
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded4");
+            Object r = m.exec(Collections.singletonList(html));
+            if (r instanceof TemplateScalarModel) {
+                r = ((TemplateScalarModel) r).getAsString();
             }
+            assertEquals("<p>a", r);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
index b91101e..0bc9168 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
@@ -26,10 +26,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.freemarker.core.model.impl.beans.ArgumentTypes;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
-import org.apache.freemarker.core.model.impl.beans.ReflectionCallableMemberDescriptor;
-
 import junit.framework.TestCase;
 
 @SuppressWarnings("boxing")
@@ -40,21 +36,21 @@ public class IsApplicableTest extends TestCase {
     }
     
     public void testSingle() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object() }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object() });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, String.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, Integer.class);
         assertNotApplicable(ats, Integer.TYPE);
         
-        ats = new ArgumentTypes(new Object[] { "" }, true);
+        ats = new ArgumentTypes(new Object[] { "" });
         assertApplicable(ats, Object.class);
         assertApplicable(ats, CharSequence.class);
         assertApplicable(ats, String.class);
         assertNotApplicable(ats, Integer.class);
         assertNotApplicable(ats, Integer.TYPE);
 
-        ats = new ArgumentTypes(new Object[] { 1 }, true);
+        ats = new ArgumentTypes(new Object[] { 1 });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -69,7 +65,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertApplicable(ats, BigInteger.class);
 
-        ats = new ArgumentTypes(new Object[] { new OverloadedNumberUtil.IntegerOrByte(1, (byte) 1) }, true);
+        ats = new ArgumentTypes(new Object[] { new OverloadedNumberUtil.IntegerOrByte(1, (byte) 1) });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -84,7 +80,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertApplicable(ats, BigInteger.class);
         
-        ats = new ArgumentTypes(new Object[] { 1.0f }, true);
+        ats = new ArgumentTypes(new Object[] { 1.0f });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -97,7 +93,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertNotApplicable(ats, BigInteger.class);
         
-        ats = new ArgumentTypes(new Object[] { null }, true);
+        ats = new ArgumentTypes(new Object[] { null });
         assertApplicable(ats, Object.class);
         assertApplicable(ats, String.class);
         assertApplicable(ats, Integer.class);
@@ -108,7 +104,7 @@ public class IsApplicableTest extends TestCase {
     }
     
     public void testMulti() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object(), "", 1, true }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object(), "", 1, true });
         assertApplicable(ats, Object.class, Object.class, Object.class, Object.class);
         assertApplicable(ats, Object.class, String.class, Number.class, Boolean.class);
         assertApplicable(ats, Object.class, CharSequence.class, Integer.class, Serializable.class);
@@ -121,7 +117,7 @@ public class IsApplicableTest extends TestCase {
     }    
 
     public void testNoParam() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { });
         assertApplicable(ats);
         assertNotApplicable(ats, Object.class);
     }
@@ -134,7 +130,7 @@ public class IsApplicableTest extends TestCase {
             new Object[] { "" },
         };
         for (Object[] args : argLists) {
-            ArgumentTypes ats = new ArgumentTypes(args, true);
+            ArgumentTypes ats = new ArgumentTypes(args);
             assertApplicable(ats, true, String.class, int[].class);
             assertApplicable(ats, true, String.class, Integer[].class);
             assertApplicable(ats, true, Object.class, Comparable[].class);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
index 21d0cb0..d88777f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
@@ -22,15 +22,10 @@ package org.apache.freemarker.core.model.impl.beans;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 
-import junit.framework.TestCase;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.OverloadedFixArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.OverloadedMethodsSubset;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
 import org.junit.Assert;
 
+import junit.framework.TestCase;
+
 public class MiscNumericalOperationsTest extends TestCase {
 
     public MiscNumericalOperationsTest(String name) {
@@ -40,57 +35,50 @@ public class MiscNumericalOperationsTest extends TestCase {
     public void testForceUnwrappedNumberToType() {
         // Usual type to to all other types:
         Double n = Double.valueOf(123.75);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.class, false), Short.valueOf(n.shortValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.TYPE, false), Short.valueOf(n.shortValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.class, false), Byte.valueOf(n.byteValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.TYPE, false), Byte.valueOf(n.byteValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.class, false), Integer.valueOf(n.intValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.TYPE, false), Integer.valueOf(n.intValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.class, false), Long.valueOf(n.longValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.TYPE, false), Long.valueOf(n.longValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.class, false), Float.valueOf(n.floatValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.TYPE, false), Float.valueOf(n.floatValue()));
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.class, false) == n);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.TYPE, false) == n);
-        try {
-            assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class, false), new BigInteger("123"));
-            fail();
-        } catch (NumberFormatException e) {
-            // expected
-        }
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class, true), new BigInteger("123"));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigDecimal.class, false), new BigDecimal("123.75"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.class), Short.valueOf(n.shortValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.TYPE), Short.valueOf(n.shortValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.class), Byte.valueOf(n.byteValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.TYPE), Byte.valueOf(n.byteValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.class), Integer.valueOf(n.intValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.TYPE), Integer.valueOf(n.intValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.class), Long.valueOf(n.longValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.TYPE), Long.valueOf(n.longValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.class), Float.valueOf(n.floatValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.TYPE), Float.valueOf(n.floatValue()));
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.class) == n);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.TYPE) == n);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class), new BigInteger("123"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigDecimal.class), new BigDecimal("123.75"));
         
         // Cases of conversion to BigDecimal:
         BigDecimal bd = new BigDecimal("123");
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigInteger("123"), BigDecimal.class, false), bd);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bd, BigDecimal.class, false) == bd);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigDecimal.class, false), bd);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123), BigDecimal.class, false), bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigInteger("123"), BigDecimal.class), bd);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bd, BigDecimal.class) == bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigDecimal.class), bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123), BigDecimal.class), bd);
         
         // Cases of conversion to BigInteger:
         BigInteger bi = new BigInteger("123");
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigDecimal("123.6"), BigInteger.class, true), bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigDecimal("123.6"), BigInteger.class), bi);
         assertEquals(BeansWrapper.forceUnwrappedNumberToType(
-                new OverloadedNumberUtil.IntegerBigDecimal(new BigDecimal("123")), BigInteger.class, true), bi);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bi, BigInteger.class, true) == bi);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigInteger.class, true), bi);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123.6), BigInteger.class, true), bi);
+                new OverloadedNumberUtil.IntegerBigDecimal(new BigDecimal("123")), BigInteger.class), bi);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bi, BigInteger.class) == bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigInteger.class), bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123.6), BigInteger.class), bi);
 
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Number.class, true) == n);
-        assertNull(BeansWrapper.forceUnwrappedNumberToType(n, RationalNumber.class, true));
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Number.class) == n);
+        assertNull(BeansWrapper.forceUnwrappedNumberToType(n, RationalNumber.class));
         RationalNumber r = new RationalNumber(1, 2);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, RationalNumber.class, true) == r);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, Number.class, true) == r);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, Double.class, true), Double.valueOf(0.5));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigDecimal.class, true), new BigDecimal("0.5"));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigInteger.class, true), BigInteger.ZERO);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, RationalNumber.class) == r);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, Number.class) == r);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, Double.class), Double.valueOf(0.5));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigDecimal.class), new BigDecimal("0.5"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigInteger.class), BigInteger.ZERO);
     }
     
     @SuppressWarnings("boxing")
     public void testForceNumberArgumentsToParameterTypes() {
-        OverloadedMethodsSubset oms
-                = new OverloadedFixArgsMethods(new BeansWrapper(Configuration.VERSION_2_3_21).is2321Bugfixed());
+        OverloadedMethodsSubset oms = new OverloadedFixArgsMethods();
         Class[] paramTypes = new Class[] { Short.TYPE, Short.class, Double.TYPE, BigDecimal.class, BigInteger.class };
         Object[] args;
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
index c460df6..2f179e9 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
@@ -19,12 +19,13 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -34,8 +35,8 @@ public class ModelCacheTest {
     
     @Test
     public void modelCacheOff() throws Exception {
-        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
-        assertFalse(bw.getUseCache());  // default is off
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        assertFalse(bw.getUseModelCache());  // default is off
         
         String s = "foo";
         assertNotSame(bw.wrap(s), bw.wrap(s));
@@ -46,9 +47,9 @@ public class ModelCacheTest {
     
     @Test
     public void modelCacheOn() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
-        bw.setUseCache(true);
-        assertTrue(bw.getUseCache());
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
+        bw.setUseModelCache(true);
+        assertTrue(bw.getUseModelCache());
         
         String s = "foo";
         assertSame(bw.wrap(s), bw.wrap(s));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
index 9d4b3eb..596b3e7 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
@@ -27,8 +27,6 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.apache.freemarker.core.model.impl.beans.ArgumentTypes;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
 import org.apache.freemarker.core.util._NumberUtil;
 
 import junit.framework.TestCase;
@@ -397,7 +395,7 @@ public class ParameterListPreferabilityTest extends TestCase {
                 true);
         
         
-        // Different fixed prefix length; in the case of ambiguity, the one with higher fixed param count wins.
+        // Different oms prefix length; in the case of ambiguity, the one with higher oms param count wins.
         testAllCmpPermutationsInc(
                 new Class[][] {
                     new Class[] { String.class, int.class, int.class, int[].class },
@@ -420,7 +418,7 @@ public class ParameterListPreferabilityTest extends TestCase {
      * @param sortedSignatures method signatures sorted by decreasing specificity
      */
     private void testAllCmpPermutationsInc(Class[][] sortedSignatures, Object[] args, boolean varargs) {
-        final ArgumentTypes argTs = new ArgumentTypes(args, true);
+        final ArgumentTypes argTs = new ArgumentTypes(args);
         for (int i = 0; i < sortedSignatures.length; i++) {
             for (int j = 0; j < sortedSignatures.length; j++) {
                 assertEquals("sortedSignatures[" + i + "] <==> sortedSignatures [" + j + "]",
@@ -434,7 +432,7 @@ public class ParameterListPreferabilityTest extends TestCase {
     }
 
     private void testAllCmpPermutationsEqu(Class[][] signatures, Object[] args) {
-        final ArgumentTypes argTs = new ArgumentTypes(args, true);
+        final ArgumentTypes argTs = new ArgumentTypes(args);
         for (int i = 0; i < signatures.length; i++) {
             for (int j = 0; j < signatures.length; j++) {
                 assertEquals("sortedSignatures[" + i + "] <==> sortedSignatures [" + j + "]",

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
index 3db26a0..a6b82b6 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
@@ -19,8 +19,14 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 
@@ -30,7 +36,6 @@ import org.apache.freemarker.core.model.TemplateMethodModelEx;
 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.beans.BeansWrapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -40,7 +45,7 @@ public class StaticModelsTest {
 
     @Test
     public void modelCaching() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         TemplateHashModel statics = bw.getStaticModels();
         TemplateHashModel s = (TemplateHashModel) statics.get(S.class.getName());
         assertNotNull(s);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
index 0730b3a..301e08f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
@@ -35,12 +35,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.OverloadedFixArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.OverloadedMethodsSubset;
-import org.apache.freemarker.core.model.impl.beans.OverloadedVarArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.ReflectionCallableMemberDescriptor;
-import org.apache.freemarker.core.model.impl.beans.TypeFlags;
 
 import junit.framework.TestCase;
 
@@ -50,7 +44,7 @@ public class TypeFlagsTest extends TestCase {
         super(name);
     }
     
-    private final BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21); 
+    private final BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0); 
 
     public void testSingleNumType() {
         checkTypeFlags(SingleNumTypeC.class, "mInt",
@@ -641,7 +635,7 @@ public class TypeFlagsTest extends TestCase {
         });
         
         final OverloadedMethodsSubset oms = cl.getName().indexOf("VarArgs") == -1
-                ? new OverloadedFixArgsMethods(bw.is2321Bugfixed()) : new OverloadedVarArgsMethods(bw.is2321Bugfixed());
+                ? new OverloadedFixArgsMethods() : new OverloadedVarArgsMethods();
         for (Method m : filteredMethods) {
             oms.addCallableMemberDescriptor(new ReflectionCallableMemberDescriptor(m, m.getParameterTypes()));
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
index 0660228..a604b33 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
@@ -35,6 +35,7 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
 import org.apache.freemarker.core.ast.ParseException;
+import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateLookupStrategy;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormat;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateResolver;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
@@ -54,7 +55,9 @@ public class DefaultTemplateResolverTest {
     public void testCachedException() throws Exception {
         MockTemplateLoader loader = new MockTemplateLoader();
         DefaultTemplateResolver tr = new DefaultTemplateResolver(
-                loader, new StrongCacheStorage(), new Configuration(Configuration.VERSION_3_0_0));
+                loader, new StrongCacheStorage(),
+                DefaultTemplateLookupStrategy.INSTANCE, DefaultTemplateNameFormat.INSTANCE,
+                new Configuration(Configuration.VERSION_3_0_0));
         tr.setTemplateUpdateDelayMilliseconds(1000L);
         loader.setThrowException(true);
         try {
@@ -89,7 +92,9 @@ public class DefaultTemplateResolverTest {
     @Test
     public void testCachedNotFound() throws Exception {
         MockTemplateLoader loader = new MockTemplateLoader();
-        DefaultTemplateResolver cache = new DefaultTemplateResolver(loader, new StrongCacheStorage(), new Configuration());
+        DefaultTemplateResolver cache = new DefaultTemplateResolver(
+                loader, new StrongCacheStorage(), DefaultTemplateLookupStrategy.INSTANCE,
+                DefaultTemplateNameFormat.INSTANCE, new Configuration());
         cache.setTemplateUpdateDelayMilliseconds(1000L);
         cache.setLocalizedLookup(false);
         assertNull(cache.getTemplate("t", Locale.getDefault(), null, "", true).getTemplate());
@@ -273,7 +278,7 @@ public class DefaultTemplateResolverTest {
     
     @Test
     public void testWrongEncodingReload() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -337,7 +342,7 @@ public class DefaultTemplateResolverTest {
 
     @Test
     public void testNoWrongEncodingForTemplateLoader2WithReader() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -384,7 +389,7 @@ public class DefaultTemplateResolverTest {
     public void testEncodingSelection() throws IOException {
         Locale hungary = new Locale("hu", "HU"); 
                 
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setDefaultEncoding("utf-8");
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -452,28 +457,23 @@ public class DefaultTemplateResolverTest {
     }
     
     @Test
-    public void testTemplateNameFormatExceptionAndBackwardCompatibility() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
-        
-        assertNull(cfg.getTemplate("../x", null, null, null, true, true));
+    public void testTemplateNameFormatException() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
-            cfg.getTemplate("../x");
+            cfg.getTemplate("../x", null, null, null, true, true);
             fail();
-        } catch (TemplateNotFoundException e) {
+        } catch (MalformedTemplateNameException e) {
             // expected
         }
-        
-        // [2.4] Test it with IcI 2.4
-        
-        cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
-            cfg.getTemplate("../x", null, null, null, true, true);
+            cfg.getTemplate("../x");
             fail();
         } catch (MalformedTemplateNameException e) {
             // expected
         }
         try {
-            cfg.getTemplate("../x");
+            cfg.getTemplate("\\x");
             fail();
         } catch (MalformedTemplateNameException e) {
             // expected

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
index 34a4a99..b11e0c7 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
@@ -18,8 +18,12 @@
  */
 package org.apache.freemarker.core.templateresolver;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
@@ -39,7 +43,7 @@ public class FileTemplateLoaderTest {
     
     private File templateRootDir;
     
-    Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+    private Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
     
     @Before
     public void setup() throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
index 1401781..84a88d1 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
@@ -31,19 +31,11 @@ import java.util.List;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.ast.TemplateConfiguration;
-import org.apache.freemarker.core.templateresolver.ConditionalTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
-import org.apache.freemarker.core.templateresolver.FirstMatchTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.MergingTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.PathGlobMatcher;
-import org.apache.freemarker.core.templateresolver.TemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.TemplateConfigurationFactoryException;
-import org.apache.freemarker.core.templateresolver.TemplateLoadingSource;
 import org.junit.Test;
 
 public class TemplateConfigurationFactoryTest {
     
-    private Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+    private Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
     @Test
     public void testCondition1() throws IOException, TemplateConfigurationFactoryException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
index 9ad98e7..611f8b2 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
@@ -32,6 +32,7 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
 import org.apache.freemarker.core.ast.ParseException;
+import org.apache.freemarker.core.templateresolver.impl.ByteArrayTemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormat;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormatFM2;
 import org.apache.freemarker.test.MonitoredTemplateLoader;
@@ -226,7 +227,7 @@ public class TemplateNameFormatTest {
     
     @Test
     public void assertBackslashNotSpecialWith23() throws MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("foo\\bar.ftl", "");
@@ -275,8 +276,9 @@ public class TemplateNameFormatTest {
     }
 
     @Test
-    public void assertBackslashNotAllowedWith24() throws MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+    public void assertBackslashNotAllowed() throws MalformedTemplateNameException, ParseException, IOException {
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        cfg.setTemplateLoader(new ByteArrayTemplateLoader());
         cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
             cfg.getTemplate("././foo\\bar.ftl", Locale.US);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java b/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
index aa55c8d..7599b79 100644
--- a/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
+++ b/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
@@ -36,7 +36,7 @@ public class GettingStartedExample {
         /* You should do this ONLY ONCE in the whole application life-cycle:        */    
     
         /* Create and adjust the configuration singleton */
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_24);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setClassForTemplateLoading(GettingStartedExample.class, "");
         cfg.setDefaultEncoding("UTF-8");
         cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java b/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
index 413f05d..1a7830b 100644
--- a/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
@@ -52,7 +52,6 @@ import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
 import org.apache.freemarker.core.templateresolver.FirstMatchTemplateConfigurationFactory;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.ByteArrayTemplateLoader;
-import org.apache.freemarker.servlet.FreemarkerServlet;
 import org.junit.Before;
 import org.junit.Test;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -547,7 +546,7 @@ public class FreemarkerServletTest {
         protected Configuration createConfiguration() {
             Configuration cfg = super.createConfiguration();
             // Needed for the TemplateConfiguration that sets outputEncoding:
-            cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
+            cfg.setIncompatibleImprovements(Configuration.VERSION_3_0_0);
 
             // Set a test runner environment independent default locale:
             cfg.setLocale(DEFAULT_LOCALE);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java b/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
index 8cfdf57..808fec4 100644
--- a/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
@@ -19,7 +19,10 @@
 
 package org.apache.freemarker.servlet.jsp;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.AbstractList;
@@ -32,7 +35,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.regex.Pattern;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -54,7 +56,6 @@ import org.apache.freemarker.test.servlet.WebAppTestCase;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -96,19 +97,10 @@ public class RealServletContainertTest extends WebAppTestCase {
                 + "&view=attributes.ftl");
 
         restartWebAppIfStarted(WEBAPP_BASIC);  // To clear the application scope attributes
-        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-2.3.22-future.txt", "tester"
+        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-modernModels.txt", "tester"
                 + "?action=" + AllKindOfContainersModel2Action.class.getName()
-                + "&view=attributes.ftl&viewServlet=freemarker-2.3.22-future");
-        
-        restartWebAppIfStarted(WEBAPP_BASIC);  // To clear the application scope attributes
-        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-2.3.0.txt", "tester"
-                + "?action=" + AllKindOfContainersModel2Action.class.getName()
-                + "&view=attributes.ftl&viewServlet=freemarker-2.3.0",
-                true,
-                ImmutableList.<Pattern>of(
-                        Pattern.compile("(?<=^Date-time: ).*", Pattern.MULTILINE), // Uses Date.toString, so plat. dep.
-                        Pattern.compile("(?<=^MyMap: ).*", Pattern.MULTILINE)  // Uses HashMap, so order unknown
-                        ));
+                + "&view=attributes.ftl&viewServlet=freemarker-modernModels");
+        // [FM3] Won't need the "modern" servlet as soon as DOW defaults change to recommended values
     }
 
     @Test
@@ -273,8 +265,6 @@ public class RealServletContainertTest extends WebAppTestCase {
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertDefaultsFreemarkerServlet"));
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
-                "tester?view=test.ftl&viewServlet=freemarker-assertDefaultsIcI2322FreemarkerServlet"));
-        assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertCustomizedDefaultsFreemarkerServlet"));
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertObjectWrapperDefaults1FreemarkerServlet"));
@@ -395,7 +385,7 @@ public class RealServletContainertTest extends WebAppTestCase {
 
         @Override
         protected void doAssertions(Configuration cfg) {
-            assertEquals(Configuration.VERSION_2_3_22, cfg.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
             
             assertSame(cfg.getTemplateExceptionHandler(), TemplateExceptionHandler.HTML_DEBUG_HANDLER);
             
@@ -404,7 +394,7 @@ public class RealServletContainertTest extends WebAppTestCase {
             {
                 ObjectWrapper ow = cfg.getObjectWrapper();
                 assertTrue(ow instanceof DefaultObjectWrapper);
-                assertEquals(Configuration.VERSION_2_3_22, ((DefaultObjectWrapper) ow).getIncompatibleImprovements());
+                assertEquals(Configuration.VERSION_3_0_0, ((DefaultObjectWrapper) ow).getIncompatibleImprovements());
             }
             
             {
@@ -416,32 +406,24 @@ public class RealServletContainertTest extends WebAppTestCase {
         }
         
     }
-
-    public static class AssertDefaultsIcI2322FreemarkerServlet extends AssertDefaultsFreemarkerServlet {
-
-        @Override
-        protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
-            return cfg;
-        }
-        
-    }
     
     public static class AssertCustomizedDefaultsFreemarkerServlet extends AssertingFreemarkerServlet {
 
         @Override
         protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_20);
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
             cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
             cfg.setLogTemplateExceptions(true);
-            cfg.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build());
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setUseModelCache(true);
+            cfg.setObjectWrapper(bwb.build());
             cfg.setTemplateLoader(new WebAppTemplateLoader(getServletContext()));
             return cfg;
         }
 
         @Override
         protected void doAssertions(Configuration cfg) {
-            assertEquals(Configuration.VERSION_2_3_20, cfg.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
             
             assertSame(cfg.getTemplateExceptionHandler(), TemplateExceptionHandler.RETHROW_HANDLER);
             
@@ -450,7 +432,8 @@ public class RealServletContainertTest extends WebAppTestCase {
             {
                 ObjectWrapper ow = cfg.getObjectWrapper();
                 assertSame(BeansWrapper.class, ow.getClass());
-                assertEquals(Configuration.VERSION_2_3_21, ((BeansWrapper) ow).getIncompatibleImprovements());
+                assertTrue(((BeansWrapper) ow).getUseModelCache());
+                assertEquals(Configuration.VERSION_3_0_0, ((BeansWrapper) ow).getIncompatibleImprovements());
             }
             
             {
@@ -468,12 +451,15 @@ public class RealServletContainertTest extends WebAppTestCase {
         protected void doAssertions(Configuration cfg) throws Exception {
             ObjectWrapper ow = cfg.getObjectWrapper();
             assertSame(BeansWrapper.class, ow.getClass());
-            assertEquals(Configuration.VERSION_2_3_21, ((BeansWrapper) ow).getIncompatibleImprovements());
+            assertTrue(((BeansWrapper) ow).getUseModelCache());
         }
 
         @Override
         protected ObjectWrapper createDefaultObjectWrapper() {
-            return new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setUseModelCache(true);
+            assertEquals(Configuration.VERSION_3_0_0, bwb.getIncompatibleImprovements());
+            return bwb.build();
         }
         
     }
@@ -483,8 +469,8 @@ public class RealServletContainertTest extends WebAppTestCase {
 
         @Override
         protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_20);
-            cfg.setObjectWrapper(new SimpleObjectWrapper(Configuration.VERSION_2_3_22));
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+            cfg.setObjectWrapper(new SimpleObjectWrapper(Configuration.VERSION_3_0_0));
             return cfg;
         }
         
@@ -492,7 +478,7 @@ public class RealServletContainertTest extends WebAppTestCase {
         protected void doAssertions(Configuration cfg) throws Exception {
             ObjectWrapper ow = cfg.getObjectWrapper();
             assertSame(SimpleObjectWrapper.class, ow.getClass());
-            assertEquals(Configuration.VERSION_2_3_22, ((BeansWrapper) ow).getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, ((BeansWrapper) ow).getIncompatibleImprovements());
         }
         
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java b/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
index 5825a56..bef3042 100644
--- a/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
@@ -19,7 +19,9 @@
 
 package org.apache.freemarker.servlet.jsp;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
 import java.net.URL;
@@ -32,15 +34,13 @@ import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 import javax.xml.parsers.SAXParserFactory;
 
-import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
-import org.apache.freemarker.servlet.jsp.JspTagModelBase;
-import org.apache.freemarker.servlet.jsp.TaglibFactory;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,8 +55,7 @@ public class TLDParsingTest {
 
     @Before
     public void before() throws Exception {
-        BeansWrapperBuilder builder = new BeansWrapperBuilder(new Version("2.3"));
-        wrapper = builder.build();
+        wrapper = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/TemplateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/TemplateTest.java b/src/test/java/org/apache/freemarker/test/TemplateTest.java
index 61ff22e..f4e74ec 100644
--- a/src/test/java/org/apache/freemarker/test/TemplateTest.java
+++ b/src/test/java/org/apache/freemarker/test/TemplateTest.java
@@ -135,7 +135,7 @@ public abstract class TemplateTest {
     }
     
     protected Configuration createConfiguration() throws Exception {
-        return new Configuration(Configuration.VERSION_2_3_0);
+        return new Configuration(Configuration.VERSION_3_0_0);
     }
     
     protected void addCommonTemplates() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
index 720dd27..19c9531 100644
--- a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
@@ -185,8 +185,12 @@ public class WebAppTestCase {
         final String expected;
         {
             ClassPathResource cpResource = findWebAppDirectoryResource(webAppName);
+            String expectedResource = cpResource.path + EXPECTED_DIR + expectedFileName;
             final InputStream in = cpResource.resolverClass.getResourceAsStream(
-                    cpResource.path + EXPECTED_DIR + expectedFileName);
+                    expectedResource);
+            if (in == null) {
+                throw new IOException("Test resource not found: " + expectedResource);
+            }
             try {
                 expected = TestUtil.removeTxtCopyrightComment(normalizeWS(IOUtils.toString(in, "utf-8"), compressWS));
             } finally {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/servlet/web.xml
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/servlet/web.xml b/src/test/java/org/apache/freemarker/test/servlet/web.xml
deleted file mode 100644
index 621472f..0000000
--- a/src/test/java/org/apache/freemarker/test/servlet/web.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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>2.3.21</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/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
index 8284f7d..c210728 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
@@ -46,7 +46,6 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.ast.ASTPrinter;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
@@ -80,7 +79,6 @@ 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.OverloadedMethods;
 import org.apache.freemarker.test.templatesuite.models.OverloadedMethods2;
 import org.apache.freemarker.test.templatesuite.models.VarArgTestModel;
 import org.apache.freemarker.test.util.AssertDirective;
@@ -183,7 +181,7 @@ public class TemplateTestCase extends FileTestCase {
         conf.setTemplateLoader(new CopyrightCommentRemoverTemplateLoader(
                 new FileTemplateLoader(new File(getTestClassDirectory(), "templates"))));
         
-        BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+        BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
         
         dataModel.put(ASSERT_VAR_NAME, AssertDirective.INSTANCE);
         dataModel.put(ASSERT_EQUALS_VAR_NAME, AssertEqualsDirective.INSTANCE);
@@ -407,8 +405,6 @@ public class TemplateTestCase extends FileTestCase {
           dataModel.put("bigDecimal", new BigDecimal("1305575275539.5"));
         } else if (simpleTestName.equals("varargs")) {
           dataModel.put("m", new VarArgTestModel());
-        } else if (simpleTestName.startsWith("overloaded-methods-") && !simpleTestName.startsWith("overloaded-methods-2-")) {
-          dataModel.put("obj", new OverloadedMethods());
         } else if (simpleTestName.startsWith("boolean-formatting")) {
           dataModel.put("beansBoolean", new BooleanModel(Boolean.TRUE, (BeansWrapper) conf.getObjectWrapper()));
           dataModel.put("booleanAndString", new BooleanAndStringTemplateModel());
@@ -436,13 +432,10 @@ public class TemplateTestCase extends FileTestCase {
             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-2-")) {
+        } else if (simpleTestName.startsWith("overloaded-methods")) {
             dataModel.put("obj", new OverloadedMethods2());
             final boolean dow = conf.getObjectWrapper() instanceof DefaultObjectWrapper;
             dataModel.put("dow", dow);
-            dataModel.put("dowPre22", dow
-                    && ((DefaultObjectWrapper) conf.getObjectWrapper()).getIncompatibleImprovements()
-                            .intValue() < _TemplateAPI.VERSION_INT_2_3_22);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
index 4ec5e15..e5be937 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
@@ -32,8 +32,6 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import junit.framework.TestSuite;
-
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.model.impl.dom.NodeModel;
@@ -46,6 +44,8 @@ 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.
@@ -274,7 +274,7 @@ public class TemplateTestSuite extends TestSuite {
     }
 
     private Version getMinIcIVersion() {
-        return Configuration.VERSION_2_3_0;
+        return Configuration.VERSION_3_0_0;
     }
 
     private Map<String, String> getCaseFMSettings(Element e) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java b/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
index 6e4ffbf..d8a337e 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
@@ -37,6 +37,7 @@ 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.DefaultObjectWrapperBuilder;
 import org.apache.freemarker.core.model.impl.SimpleCollection;
 import org.apache.freemarker.core.model.impl.SimpleHash;
@@ -128,7 +129,7 @@ public class Listables {
     public List<? extends TemplateHashModelEx> getEmptyHashes() throws TemplateModelException {
         List<TemplateHashModelEx> emptyMaps = new ArrayList<>();
         emptyMaps.addAll(getMapsWrappedAsEx2(Collections.emptyMap()));
-        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build()
+        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build()
                 .wrap(Collections.emptyMap()));
         return emptyMaps;
     }
@@ -139,11 +140,11 @@ public class Listables {
     private List<TemplateHashModelEx2> getMapsWrappedAsEx2(Map<?, ?> map) throws TemplateModelException {
         List<TemplateHashModelEx2> maps = new ArrayList<>();
         
-        maps.add((SimpleHash) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0).build().wrap(map));
+        DefaultObjectWrapper ow = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        maps.add(new SimpleHash(map, ow));
+        maps.add((DefaultMapAdapter) ow.wrap(map));
         
-        maps.add((DefaultMapAdapter) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build().wrap(map));
-        
-        BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_2_3_24);
+        BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
         bwb.setSimpleMapWrapper(true);
         maps.add((TemplateHashModelEx2) bwb.build().wrap(map));
 
@@ -152,7 +153,7 @@ public class Listables {
     
     public TemplateHashModelEx getHashNonEx2() {
         return new NonEx2MapAdapter(ImmutableMap.of("k1", 11, "k2", 22),
-                new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build());
+                new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build());
     }
     
     public static class NonEx2MapAdapter extends WrappingTemplateModel implements TemplateHashModelEx {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java b/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
new file mode 100644
index 0000000..66f36de
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
@@ -0,0 +1,41 @@
+package org.apache.freemarker.test.util;
+
+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(incompatibleImprovements);
+    }
+
+    @Override
+    public TemplateModel wrap(Object obj) throws TemplateModelException {
+        if (obj == null) {
+            return super.wrap(null);
+        }        
+        if (obj.getClass().isArray()) {
+            obj = convertArray(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);
+    }
+
+}


Mime
View raw message