@@ -0,0 +1,2590 @@
+/*%0A * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A *%0A * WSO2 Inc. licenses this file to you under the Apache License,%0A * Version 2.0 (the %22License%22); you may not use this file except%0A * in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage org.wso2.carbon.uis.api;%0A%0Aimport com.google.common.collect.ImmutableSet;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.Locale;%0Aimport java.util.Properties;%0Aimport java.util.Set;%0A%0A/**%0A * Test cases for %7B@link I18nResource%7D class.%0A *%0A * @since 0.10.5%0A */%0Apublic class I18nResourceTest %7B%0A%0A    @Test%0A    public void testGetMessage() %7B%0A        Properties properties = new Properties();%0A        properties.put(%22welcome%22, %22Hello!%22);%0A        properties.put(%22welcome-name%22, %22Hello %7B0%7D!%22);%0A        I18nResource i18nResource = new I18nResource(Locale.US, properties);%0A%0A        Assert.assertEquals(i18nResource.getMessage(%22bye%22, null, %22Bye!%22), %22Bye!%22);%0A        Assert.assertEquals(i18nResource.getMessage(%22welcome%22, null, null), %22Hello!%22);%0A        Assert.assertEquals(i18nResource.getMessage(%22welcome-name%22, new Object%5B%5D%7B%22Alice%22%7D, null), %22Hello Alice!%22);%0A    %7D%0A%0A    @Test%0A    public void testGetMatchingLocale() %7B%0A        Set%3CLocale%3E availableLocales = ImmutableSet.of(Locale.FRENCH, Locale.US, Locale.CANADA);%0A%0A        Assert.assertEquals(I18nResource.getMatchingLocale(null, availableLocales), null);%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22%22, availableLocales), null);%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22foo%22, availableLocales), null);%0A%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22en%22, availableLocales), Locale.US);%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22en-US%22, availableLocales), Locale.US);%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22fr, en;q=0.9, en-GB;q=0.8, en-US;q=0.7%22,%0A                                                           availableLocales), Locale.FRENCH);%0A        Assert.assertEquals(I18nResource.getMatchingLocale(%22si, en;q=0.9, en-GB;q=0.8, en-US;q=0.7, en-CA;q=0.5%22,%0A                                                           availableLocales), Locale.US);%0A    %7D%0A%7D

add test cases for I18nResource class