default:
return "UNKNOWN";
}
}
public void TestLoadingStatus(){
ICUResourceBundle bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "yi_IL");
int status = bundle.getLoadingStatus();
if(status != ICUResourceBundle.FROM_DEFAULT){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_DEFAULT)
+ " Got: " + getLSString(status));
}
bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "eo_DE");
status = bundle.getLoadingStatus();
if(status != ICUResourceBundle.FROM_FALLBACK){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_FALLBACK)
+ " Got: " + getLSString(status));
}
logln("Test to verify loading status of get(String)");
bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "te_IN");
UResourceBundle countries = bundle.get("Countries");
status = ((ICUResourceBundle)countries).getLoadingStatus();
if(status != ICUResourceBundle.FROM_FALLBACK){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_FALLBACK)
+ " Got: " + getLSString(status));
}
/*
UResourceBundle auxExemplar = bundle.get("AuxExemplarCharacters");
status = auxExemplar.getLoadingStatus();
if(status != UResourceBundle.FROM_ROOT){
errln("Did not get the expected value for loading status. Expected "+ getLSString(UResourceBundle.FROM_ROOT)
+ " Got: " + getLSString(status));
}
*/
logln("Test to verify loading status of get(int)");
ICUResourceBundle ms = (ICUResourceBundle)bundle.get("MeasurementSystem");
status = ms.getLoadingStatus();
if(status != ICUResourceBundle.FROM_ROOT){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_ROOT)
+ " Got: " + getLSString(status));
}
logln("Test to verify loading status of getwithFallback");
bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance("com/ibm/icu/dev/data/testdata", "sh_YU",testLoader);
ICUResourceBundle temp = (ICUResourceBundle)bundle.getWithFallback("a/a2");
status = temp.getLoadingStatus();
if(status != ICUResourceBundle.FROM_LOCALE){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_LOCALE)
+ " Got: " + getLSString(status));
}
temp = bundle.getWithFallback("a/a1");
status = temp.getLoadingStatus();
if(status != ICUResourceBundle.FROM_FALLBACK){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_FALLBACK)
+ " Got: " + getLSString(status));
}
temp = bundle.getWithFallback("a/a4");
status = temp.getLoadingStatus();
if(status != ICUResourceBundle.FROM_ROOT){
errln("Did not get the expected value for loading status. Expected "+ getLSString(ICUResourceBundle.FROM_ROOT)
+ " Got: " + getLSString(status));
}
}