2 |
|
|
3 |
import static org.junit.Assert.assertEquals; |
import static org.junit.Assert.assertEquals; |
4 |
import static org.junit.Assert.assertFalse; |
import static org.junit.Assert.assertFalse; |
5 |
|
import static org.junit.Assert.assertNotNull; |
6 |
import static org.junit.Assert.assertTrue; |
import static org.junit.Assert.assertTrue; |
7 |
|
|
8 |
import java.util.ArrayList; |
import java.util.ArrayList; |
9 |
import java.util.List; |
import java.util.List; |
10 |
import java.util.Locale; |
import java.util.Locale; |
11 |
|
import java.util.Set; |
12 |
|
|
13 |
import org.junit.BeforeClass; |
import org.junit.BeforeClass; |
14 |
import org.junit.Test; |
import org.junit.Test; |
54 |
} |
} |
55 |
|
|
56 |
@Test |
@Test |
|
public void testGetFirstLocaleForLang() { |
|
|
assertEquals(new Locale("de_DE"), I8NUtil.getFirstLocaleForLang("po")); |
|
|
} |
|
|
|
|
|
@Test |
|
57 |
public void testGetLocalesForLang() { |
public void testGetLocalesForLang() { |
58 |
List<Locale> locales = I8NUtil.getLocalesForLang("en"); |
List<Locale> locales = I8NUtil.getLocalesForLang("en"); |
59 |
|
|
61 |
assertTrue(locales.contains(new Locale("en", "sg"))); |
assertTrue(locales.contains(new Locale("en", "sg"))); |
62 |
} |
} |
63 |
|
|
64 |
|
@Test |
65 |
|
public void testGetLanguageCodes() { |
66 |
|
Set<String> languageCodes = I8NUtil.getLanguageCodes(); |
67 |
|
|
68 |
|
assertTrue(languageCodes.contains("kj")); |
69 |
|
} |
70 |
|
|
71 |
|
@Test |
72 |
|
public void testGetFirstLocaleForLang() { |
73 |
|
Locale tjLocaleSelfmade = I8NUtil.getFirstLocaleForLang("kj"); |
74 |
|
assertNotNull(tjLocaleSelfmade); |
75 |
|
System.out.println(tjLocaleSelfmade); |
76 |
|
} |
77 |
} |
} |