use of android.icu.util.UResourceBundle in project j2objc by google.
the class ICUResourceBundleTest method TestICUGetKeysAtTopLevel.
/**
* Test ICUResourceBundle.getKeys() for a whole bundle (top-level resource).
* JDK JavaDoc for ResourceBundle.getKeys() says that it returns
* "an Enumeration of the keys contained in this ResourceBundle and its parent bundles."
*/
@Test
public void TestICUGetKeysAtTopLevel() {
String baseName = "android/icu/dev/data/testdata";
UResourceBundle te_IN = UResourceBundle.getBundleInstance(baseName, "te_IN", testLoader);
UResourceBundle te = UResourceBundle.getBundleInstance(baseName, "te", testLoader);
Set<String> te_set = setFromEnumeration(te.getKeys());
Set<String> te_IN_set = setFromEnumeration(te_IN.getKeys());
assertTrue("te.getKeys().contains(string_only_in_Root)", te_set.contains("string_only_in_Root"));
assertTrue("te.getKeys().contains(string_only_in_te)", te_set.contains("string_only_in_te"));
assertFalse("te.getKeys().contains(string_only_in_te_IN)", te_set.contains("string_only_in_te_IN"));
assertTrue("te_IN.getKeys().contains(string_only_in_Root)", te_IN_set.contains("string_only_in_Root"));
assertTrue("te_IN.getKeys().contains(string_only_in_te)", te_IN_set.contains("string_only_in_te"));
assertTrue("te_IN.getKeys().contains(string_only_in_te_IN)", te_IN_set.contains("string_only_in_te_IN"));
// TODO: Check for keys of alias resource items
}
Aggregations