Examples of LocalizedTextsContainerImple


Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

  }
 
  public static class SettingTextsToUITexts extends TestCase {
   
    public void test_setting_and_getting_a_texts() {
      LocalizedTextsContainerImple uit = new LocalizedTextsContainerImple("FI", "SE");
      uit.setText("test", "testiarvo", "FI");
      uit.setText("test", "testvarde", "SE");
      assertEquals("testiarvo", uit.getText("test", "FI"));
      assertEquals("testvarde", uit.getText("test", "SE"));
    }
View Full Code Here

Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

      assertEquals("testiarvo", uit.getText("test", "FI"));
      assertEquals("testvarde", uit.getText("test", "SE"));
    }
   
    public void test_it_accepts_two_same_langugaes() {
      new LocalizedTextsContainerImple("FI", "FI");
    }
View Full Code Here

Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

      new LocalizedTextsContainerImple("FI", "FI");
    }
   
    public void test_it_doesnt_accept_empty_language() {
      try {
        new LocalizedTextsContainerImple("FI", "");
        fail("Should have thrown an exception");
      } catch (IllegalArgumentException e) {
      }
    }
View Full Code Here

Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

      }
    }
   
    public void test_it_doesnt_accept_null() {
      try {
        new LocalizedTextsContainerImple((String[]) null);
        fail("Should have thrown an exception");
      } catch (Exception e) {
      }
    }
View Full Code Here

Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

      } catch (Exception e) {
      }
    }
   
    public void test_it_fails_when_asking_for_language_or_text_that_doesnt_exist() {
      LocalizedTextsContainerImple uit = new LocalizedTextsContainerImple("EN");
      uit.setText("test", "test", "EN");
      try {
        uit.getText("foo", "EN");
        fail("Should have thrown an exception");
      } catch (IllegalArgumentException e) {
      }
      try {
        uit.getText("test", "FO");
        fail("Should have thrown an exception");
      } catch (IllegalArgumentException e) {
      }
    }
View Full Code Here

Examples of fi.luomus.commons.languagesupport.LocalizedTextsContainerImple

      } catch (IllegalArgumentException e) {
      }
    }
   
    public void test_gettingAll() {
      LocalizedTextsContainerImple uit = new LocalizedTextsContainerImple("FI", "EN");
      uit.setText("foo", "bar", "EN");
      uit.setText("dog", "cat", "EN");
      uit.setText("foo", "tanko", "FI");
      uit.setText("dog", "kissa", "FI");
     
      Map<String, String> fi = uit.getAllTexts("FI");
      Map<String, String> en = uit.getAllTexts("EN");
      try {
        uit.getAllTexts("UN");
        fail("Should have thrown an exception");
      } catch (IllegalArgumentException e) {
      }
      assertEquals("bar", en.get("foo"));
      assertEquals("cat", en.get("dog"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.