Exemplo n.º 1
0
 @Test
 public void testGetLocalizedElement() {
   // This should be independent of the actual build locale.
   LocalizedString[] elements = new LocalizedString[3];
   elements[0] = new LocalizedString("Hello World", "en");
   elements[1] = new LocalizedString("你好世界", "cn");
   elements[2] = new LocalizedString("Nom de plume!", "fr");
   LocalizedString testMatch = new LocalizedString("Nom de plume!", "fr");
   String[] locales = {"es", "fr", "en"};
   LocalizedString bestMatch = LocalizationUtils.getLocalizedElement(elements, locales);
   assertTrue(
       "Localized element best match returned correctly",
       bestMatch.getValue().equals(testMatch.getValue()));
 }