2 *******************************************************************************
\r
3 * Copyright (C) 2005, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 import java.util.MissingResourceException;
\r
9 import com.ibm.icu.dev.test.TestFmwk;
\r
10 import com.ibm.icu.util.UResourceBundle;
\r
12 * Eclipse expects the java files in a package-like directory structure to have a package declaration at the top of the file.
\r
13 * To fool Eclipse this file has an "jpp" extension. The ant build script copies this file to the default package and renames it
\r
19 public class TestDefaultPackageLoading extends TestFmwk{
\r
20 public static void main(String[] args){
\r
21 new TestDefaultPackageLoading().run(args);
\r
23 public void TestResourceBundleLoading(){
\r
25 UResourceBundle bundle = UResourceBundle.getBundleInstance("TestData", "en");
\r
26 String aaa = bundle.getString("aaa");
\r
27 if(!aaa.equals("testcircularalias/aab")){
\r
28 errln("Did not get the expected data");
\r
30 }catch (MissingResourceException ex){
\r
31 errln("could not load data "+ex.getMessage());
\r
34 public void TestResFileLoading(){
\r
36 UResourceBundle bundle = UResourceBundle.getBundleInstance("", "te");
\r
37 String aaa = bundle.getString("string_only_in_te");
\r
38 if(!aaa.equals("TE")){
\r
39 errln("Did not get the expected data");
\r
41 }catch (MissingResourceException ex){
\r
42 errln("could not load data "+ex.getMessage());
\r
45 public void TestJB3767(){
\r
47 UResourceBundle bundle = UResourceBundle.getBundleInstance("com.ibm.icu.dev.data.TestData", "bge");
\r
48 String aaa = bundle.getString("string_only_in_te");
\r
49 if(!aaa.equals("TE")){
\r
50 errln("Did not get the expected data");
\r
52 logln("Got : " + bundle.getULocale().getName());
\r
53 }catch (MissingResourceException ex){
\r
54 errln("could not load data "+ex.getMessage());
\r