2 *******************************************************************************
3 * Copyright (C) 2005, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 import java.util.MissingResourceException;
9 import com.ibm.icu.dev.test.TestFmwk;
10 import com.ibm.icu.util.UResourceBundle;
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
19 public class TestDefaultPackageLoading extends TestFmwk{
20 public static void main(String[] args){
21 new TestDefaultPackageLoading().run(args);
23 public void TestResourceBundleLoading(){
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");
30 }catch (MissingResourceException ex){
31 errln("could not load data "+ex.getMessage());
34 public void TestResFileLoading(){
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");
41 }catch (MissingResourceException ex){
42 errln("could not load data "+ex.getMessage());
45 public void TestJB3767(){
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");
52 logln("Got : " + bundle.getULocale().getName());
53 }catch (MissingResourceException ex){
54 errln("could not load data "+ex.getMessage());