]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_8_1_1/main/tests/core/src/com/ibm/icu/dev/test/util/TestDefaultPackageLoading.jpp
Added flags.
[Dictionary.git] / jars / icu4j-4_8_1_1 / main / tests / core / src / com / ibm / icu / dev / test / util / TestDefaultPackageLoading.jpp
1 /*
2  *******************************************************************************
3  * Copyright (C) 2005, International Business Machines Corporation and    *
4  * others. All Rights Reserved.                                                *
5  *******************************************************************************
6  */
7 import java.util.MissingResourceException;
8
9 import com.ibm.icu.dev.test.TestFmwk;
10 import com.ibm.icu.util.UResourceBundle;
11 /*
12  * Eclipse expects the java files in a package-like directory structure to have a package declaration at the top of the file.
13  * To fool Eclipse this file has an "jpp" extension. The ant build script copies this file to the default package and renames it
14  * before building.
15  */ 
16 /**
17  * @author ram
18  */
19 public class TestDefaultPackageLoading extends TestFmwk{
20     public static void main(String[] args){
21         new TestDefaultPackageLoading().run(args);
22     }
23     public void TestResourceBundleLoading(){
24         try{
25             UResourceBundle bundle = UResourceBundle.getBundleInstance("TestData", "en");
26             String aaa = bundle.getString("aaa");
27             if(!aaa.equals("testcircularalias/aab")){
28                 errln("Did not get the expected data");
29             }
30         }catch (MissingResourceException ex){
31             errln("could not load data "+ex.getMessage());
32         }
33     }
34     public void TestResFileLoading(){
35         try{
36             UResourceBundle bundle = UResourceBundle.getBundleInstance("", "te");
37             String aaa = bundle.getString("string_only_in_te");
38             if(!aaa.equals("TE")){
39                 errln("Did not get the expected data");
40             }
41         }catch (MissingResourceException ex){
42             errln("could not load data "+ex.getMessage());
43         }
44     }
45     public void TestJB3767(){
46         try{
47             UResourceBundle bundle = UResourceBundle.getBundleInstance("com.ibm.icu.dev.data.TestData", "bge");
48             String aaa = bundle.getString("string_only_in_te");
49             if(!aaa.equals("TE")){
50                 errln("Did not get the expected data");
51             }
52             logln("Got : " + bundle.getULocale().getName());
53         }catch (MissingResourceException ex){
54             errln("could not load data "+ex.getMessage());
55         }
56     }
57     
58 }