diff --git a/designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java b/designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java index 1e16a1d7c9..2707d73dd5 100644 --- a/designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java +++ b/designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java @@ -2,6 +2,7 @@ package com.fr.design; import com.fr.invoke.Reflect; import junit.framework.TestCase; +import org.easymock.EasyMock; import java.util.Locale; @@ -20,8 +21,18 @@ public class DesignerEnvManagerTest extends TestCase{ } public void testCheckLocale() { - DesignerEnvManager envManager = new DesignerEnvManager(); - Locale checkLocale = Reflect.on(envManager).call("checkLocale", Locale.getDefault()).get(); - assertEquals(Locale.SIMPLIFIED_CHINESE, checkLocale); + DesignerEnvManager envManager = EasyMock.createMock(DesignerEnvManager.class); + Reflect on = Reflect.on(envManager); + + //验证zh-Hans-CN + Locale locale = Reflect.on(Locale.class).call("getInstance", "zh", "", "CN", "", null).get(); + assertEquals(Locale.SIMPLIFIED_CHINESE, locale); + + //验证其它语言 + assertEquals(Locale.SIMPLIFIED_CHINESE, on.call("checkLocale", Locale.SIMPLIFIED_CHINESE).get()); + assertEquals(Locale.TRADITIONAL_CHINESE, on.call("checkLocale", Locale.TRADITIONAL_CHINESE).get()); + assertEquals(Locale.US, on.call("checkLocale", Locale.US).get()); + assertEquals(Locale.JAPAN, on.call("checkLocale", Locale.JAPAN).get()); + assertEquals(Locale.KOREA, on.call("checkLocale", Locale.KOREA).get()); } }