Package de.danet.an.util

Examples of de.danet.an.util.ResourceBundleAsMap


     * Test locale and loading all resource entries
     */
    public void getAllResources() throws Exception {
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);

  // Make sure that german property file is used
  assertTrue(bundle.getLocale().toString().equals("de"));
  int i = segmap.size();
View Full Code Here


  List resultList = new ArrayList();
  resultList.addAll(Arrays.asList(resultKeys));
 
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);
  Set myKeySet = segmap.keySet("danet.oss");
  int i = 0;
  assertTrue(myKeySet.containsAll(resultList));
  i = myKeySet.size();
View Full Code Here

  List resultList = new ArrayList();
  resultList.addAll(Arrays.asList(resultKeys));

  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);
  int i = 0;
  Set myKeySet = segmap.keySet("danet.oss.an");
  assertTrue(myKeySet.containsAll(resultList));
  i = myKeySet.size();
View Full Code Here

  List resultList = new ArrayList();
  resultList.addAll(Arrays.asList(resultKeys));

  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);
  int i = 0;
  Set myKeySet = segmap.keySet("telekom");
  assertTrue(myKeySet.containsAll(resultList));
  i = myKeySet.size();
View Full Code Here

     * Test loading all resource entries in empty path
     */
    public void getKeysOfEmptyPath() throws Exception {
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);
  int i = 0;
  Set myKeySet = segmap.keySet();
  i = myKeySet.size();
  // Verfiy that all entries have been found
View Full Code Here

     * Test loading all resource entries in empty path
     */
    public void getValues() throws Exception {
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);

  // oss.an has its own PKW resource
  assertTrue(segmap.get("danet.oss.an.poolPKW").equals("DA-AN 964"));
  // oss.sm uses the PKW resource of oss
View Full Code Here

     * Test caching of key list to given path
     */
    public void testKeyListCache() throws Exception {
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);
  Set keyList1 = segmap.keySet("telekom");
  Set keyList2 = segmap.keySet("telekom");
  Set keyList3 = segmap.keySet("danet");
  Set keyList4 = segmap.keySet("telekom.t-data");
View Full Code Here

     * Test caching of value to given key
     */
    public void testValueCache() throws Exception {
  ResourceBundle bundle
      = ResourceBundle.getBundle("util.I18nTest", Locale.GERMANY);
  ResourceBundleAsMap rbm = new ResourceBundleAsMap(bundle);
  SegmentedMap segmap = new SegmentedMap(rbm);

  String pkw1 = (String)segmap.get("danet.oss.sm.poolPKW");
  String pkw2 = (String)segmap.get("danet.oss.poolPKW");
  String pkw3 = (String)segmap.get("danet.oss.sm.poolPKW");
View Full Code Here

    return res;
      }
      ResourceBundle bundle = ResourceBundle.getBundle
    (baseName, Locale.getDefault(),
     Thread.currentThread().getContextClassLoader());
      res = new SegmentedMap (new ResourceBundleAsMap (bundle));
      mapMap.put (key, res);
      return res;
  }
    }
View Full Code Here

TOP

Related Classes of de.danet.an.util.ResourceBundleAsMap

Copyright © 2018 www.massapicom. 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.