@@ -57,7 +57,7 @@ public void testTemplateLoaderBaseOnFile() throws Exception {
57
57
servletContext .setAttribute (FreemarkerManager .CONFIG_SERVLET_CONTEXT_KEY , null );
58
58
59
59
String tmpPath = "file://" + FileUtils .getTempDirectoryPath ();
60
-
60
+
61
61
// when
62
62
manager .load (servletContext , tmpPath );
63
63
@@ -70,7 +70,7 @@ public void testIncompatibleImprovementsByOverriding() throws Exception {
70
70
FreemarkerManager manager = new FreemarkerManager () {
71
71
@ Override
72
72
protected Version getFreemarkerVersion (ServletContext servletContext ) {
73
- return Configuration .VERSION_2_3_0 ;
73
+ return Configuration .VERSION_2_3_33 ;
74
74
}
75
75
};
76
76
container .inject (manager );
@@ -79,7 +79,7 @@ protected Version getFreemarkerVersion(ServletContext servletContext) {
79
79
manager .init (servletContext );
80
80
81
81
// then
82
- assertEquals (Configuration .VERSION_2_3_0 , manager .config .getIncompatibleImprovements ());
82
+ assertEquals (Configuration .VERSION_2_3_33 , manager .config .getIncompatibleImprovements ());
83
83
}
84
84
85
85
public void testIncompatibleImprovementsWithTemplate () throws Exception {
@@ -91,26 +91,27 @@ public void testIncompatibleImprovementsWithTemplate() throws Exception {
91
91
92
92
// when
93
93
Writer out = new StringWriter ();
94
- Map <String , String > model = new HashMap <>();
94
+ Map <String , String > model = new HashMap <>();
95
95
model .put ("error" , "It's an error message" );
96
96
97
97
tpl .process (model , out );
98
98
99
99
// then
100
+ assertEquals (Configuration .VERSION_2_3_33 , configuration .getIncompatibleImprovements ());
100
101
assertEquals ("<input type=\" text\" onclick=\" this.alert('It's an error message')\" />" , out .toString ());
101
102
}
102
103
103
104
public void testIncompatibleImprovementsByServletContext () throws Exception {
104
105
// given
105
- servletContext .setInitParameter ("freemarker.incompatible_improvements" , "2.3.0 " );
106
+ servletContext .setInitParameter ("freemarker.incompatible_improvements" , "2.3.32 " );
106
107
FreemarkerManager manager = new FreemarkerManager ();
107
108
container .inject (manager );
108
109
109
110
// when
110
111
manager .init (servletContext );
111
112
112
113
// then
113
- assertEquals (Configuration .VERSION_2_3_0 , manager .config .getIncompatibleImprovements ());
114
+ assertEquals (Configuration .VERSION_2_3_32 , manager .config .getIncompatibleImprovements ());
114
115
}
115
116
}
116
117
@@ -119,5 +120,5 @@ class DummyFreemarkerManager extends FreemarkerManager {
119
120
public void load (StrutsMockServletContext servletContext , String path ) {
120
121
createTemplateLoader (servletContext , path );
121
122
}
122
-
123
+
123
124
}
0 commit comments