123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- package com.gitblit.wicket;
-
- import org.junit.Test;
-
- import java.util.Locale;
- import java.util.ResourceBundle;
-
- import static org.junit.Assert.*;
-
- public class GitBlitWebAppResourceBundleTest
- {
- @Test
- public void testDefaultResource()
- {
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp");
- assertNotNull(bundle);
- assertEquals("default", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testCsResource()
- {
- Locale l = Locale.forLanguageTag("cs");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("čeština", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testDeResource()
- {
- Locale l = Locale.GERMAN;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Deutsch", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testEnResource()
- {
- Locale l = Locale.ENGLISH;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- // The "en" file is just a placeholder for the default one.
- assertEquals("default", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testEsResource()
- {
- Locale l = Locale.forLanguageTag("es");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Español", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testFrResource() throws Exception
- {
- Locale l = Locale.FRENCH;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("français", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testItResource() throws Exception
- {
- Locale l = Locale.ITALIAN;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Italiano", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testJaResource() throws Exception
- {
- Locale l = Locale.JAPANESE;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("にほんご", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testKoResource() throws Exception
- {
- Locale l = Locale.KOREAN;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("한국어", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testNlResource() throws Exception
- {
- Locale l = Locale.forLanguageTag("nl");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Nederlands", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testNoResource() throws Exception
- {
- Locale l = Locale.forLanguageTag("no");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Norsk", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testPlResource() throws Exception
- {
- Locale l = Locale.forLanguageTag("pl");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("polszczyzna", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testPtBrResource() throws Exception
- {
- Locale l = Locale.forLanguageTag("pt-BR");
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("Português", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testZhCnResource() throws Exception
- {
- Locale l = Locale.SIMPLIFIED_CHINESE;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("汉字", bundle.getString("gb.loadLang"));
- }
-
- @Test
- public void testZhTwResource() throws Exception
- {
- Locale l = Locale.TRADITIONAL_CHINESE;
- ResourceBundle bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", l);
- assertNotNull(bundle);
- assertEquals("漢字", bundle.getString("gb.loadLang"));
- }
- }
|