Browse Source

更新单元测试

feature/big-screen
Yvan 4 years ago
parent
commit
63ce4a6d72
  1. 17
      designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java

17
designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java

@ -2,6 +2,7 @@ package com.fr.design;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.easymock.EasyMock;
import java.util.Locale; import java.util.Locale;
@ -20,8 +21,18 @@ public class DesignerEnvManagerTest extends TestCase{
} }
public void testCheckLocale() { public void testCheckLocale() {
DesignerEnvManager envManager = new DesignerEnvManager(); DesignerEnvManager envManager = EasyMock.createMock(DesignerEnvManager.class);
Locale checkLocale = Reflect.on(envManager).call("checkLocale", Locale.getDefault()).get(); Reflect on = Reflect.on(envManager);
assertEquals(Locale.SIMPLIFIED_CHINESE, checkLocale);
//验证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());
} }
} }

Loading…
Cancel
Save