mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
fixed failing test case
git-svn-id: https://svn.apache.org/repos/asf/incubator/webwork2@396245 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -282,16 +282,30 @@ public class UrlHelperTest extends StrutsTestCase {
|
||||
}
|
||||
|
||||
public void testTranslateAndEncode() throws Exception {
|
||||
String result = UrlHelper.translateAndEncode("\u65b0\u805e");
|
||||
String expectedResult = "%E6%96%B0%E8%81%9E";
|
||||
Object defaultI18nEncoding = Configuration.get(StrutsConstants.STRUTS_I18N_ENCODING);
|
||||
try {
|
||||
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
|
||||
String result = UrlHelper.translateAndEncode("\u65b0\u805e");
|
||||
String expectedResult = "%E6%96%B0%E8%81%9E";
|
||||
|
||||
assertEquals(result, expectedResult);
|
||||
assertEquals(result, expectedResult);
|
||||
}
|
||||
finally {
|
||||
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, defaultI18nEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
public void testTranslateAndDecode() throws Exception {
|
||||
String result = UrlHelper.translateAndDecode("%E6%96%B0%E8%81%9E");
|
||||
String expectedResult = "\u65b0\u805e";
|
||||
Object defaultI18nEncoding = Configuration.get(StrutsConstants.STRUTS_I18N_ENCODING);
|
||||
try {
|
||||
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
|
||||
String result = UrlHelper.translateAndDecode("%E6%96%B0%E8%81%9E");
|
||||
String expectedResult = "\u65b0\u805e";
|
||||
|
||||
assertEquals(result, expectedResult);
|
||||
assertEquals(result, expectedResult);
|
||||
}
|
||||
finally {
|
||||
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, defaultI18nEncoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user