2 * Copyright 2016 ZTE Corporation.
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
18 package org.openo.holmes.common.utils;
\r
20 import static org.hamcrest.core.IsEqual.equalTo;
\r
21 import static org.junit.Assert.assertThat;
\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
28 public class I18nProxyTest {
\r
30 private I18nProxy i18nProxy;
\r
33 public void setUp() {
\r
34 i18nProxy = I18nProxy.getInstance();
\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
43 public void getValueByArgs(){
\r
44 String result = i18nProxy.getValueByArgs(new Locale("zh"), "test",new String[]{"1"});
\r
45 assertThat(result,equalTo(null));
\r
48 public void getValue_by_key(){
\r
49 Map<String,String> result = i18nProxy.getValue("test");
\r
50 assertThat(result, equalTo(null));
\r
53 public void jsonI18n(){
\r
54 String result = i18nProxy.jsonI18n("test");
\r
55 assertThat(result,equalTo(null));
\r
58 public void i18nWithArgs(){
\r
59 String result = i18nProxy.i18nWithArgs("test",new String[]{});
\r
60 assertThat(result,equalTo("null"));
\r