c3631ac062a1aca4e3a30f780c9bb9f9710f9dd0
[holmes/common.git] / holmes-actions / src / test / java / org / openo / holmes / common / utils / I18nProxyTest.java
1 /**\r
2  * Copyright 2016 ZTE Corporation.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 \r
18 package org.openo.holmes.common.utils;\r
19 \r
20 import static org.hamcrest.core.IsEqual.equalTo;\r
21 import static org.junit.Assert.assertThat;\r
22 \r
23 import java.util.Locale;\r
24 import java.util.Map;\r
25 import org.junit.Before;\r
26 import org.junit.Test;\r
27 \r
28 public class I18nProxyTest {\r
29 \r
30     private I18nProxy i18nProxy;\r
31 \r
32     @Before\r
33     public void setUp() {\r
34         i18nProxy = I18nProxy.getInstance();\r
35     }\r
36 \r
37     @Test\r
38     public void getValue_locale_and_key() {\r
39         String result = i18nProxy.getValue(new Locale("zh"), "test");\r
40         assertThat(result, equalTo(null));\r
41     }\r
42     @Test\r
43     public void getValueByArgs(){\r
44         String result = i18nProxy.getValueByArgs(new Locale("zh"), "test",new String[]{"1"});\r
45         assertThat(result,equalTo(null));\r
46     }\r
47     @Test\r
48     public void getValue_by_key(){\r
49         Map<String,String> result = i18nProxy.getValue("test");\r
50         assertThat(result, equalTo(null));\r
51     }\r
52     @Test\r
53     public void jsonI18n(){\r
54         String result = i18nProxy.jsonI18n("test");\r
55         assertThat(result,equalTo(null));\r
56     }\r
57     @Test\r
58     public void i18nWithArgs(){\r
59         String result = i18nProxy.i18nWithArgs("test",new String[]{});\r
60         assertThat(result,equalTo("null"));\r
61     }\r
62 }