ICU-4094 Add API/Method Coverage tests for ICU4J

X-SVN-Rev: 16658
This commit is contained in:
GCL Shanghai 2004-10-28 17:47:31 +00:00
parent 0fe606aefb
commit 82239ea37e
3 changed files with 18 additions and 5 deletions

View File

@ -1080,6 +1080,9 @@ public class CollationAPITest extends TestFmwk {
log(list[i].toString());
log(" , the display name is : ");
logln(list[i].getDisplayName());
logln(" ...... Or display as: " + Collator.getDisplayName(list[i]));
logln(" ...... and display in Chinese: " +
Collator.getDisplayName(list[i],Locale.CHINA));
}
}
}

View File

@ -1877,6 +1877,11 @@ public class CollationMiscTest extends TestFmwk {
preZeroTestStrings[j],0);
}
}
//cover setNumericCollationDefault, getNumericCollation
assertTrue("The Numeric Collation setting is on", coll.getNumericCollation());
coll.setNumericCollationDefault();
logln("After set Numeric to default, the setting is: " + coll.getNumericCollation());
}
public void Test3249()

View File

@ -171,17 +171,17 @@ public class CollationServiceTest extends TestFmwk {
CollatorFactory delegate;
TestFactoryWrapper(CollatorFactory delegate) {
this.delegate = delegate;
this.delegate = delegate;
}
public Collator createCollator(ULocale loc) {
return delegate.createCollator(loc);
public Collator createCollator(ULocale loc) {
return delegate.createCollator(loc);
}
// use CollatorFactory getDisplayName(ULocale, ULocale) for coverage
public Set getSupportedLocaleIDs() {
return delegate.getSupportedLocaleIDs();
public Set getSupportedLocaleIDs() {
return delegate.getSupportedLocaleIDs();
}
}
@ -325,5 +325,10 @@ public class CollationServiceTest extends TestFmwk {
}
assertTrue("getFunctionalEquivalent(fr_FR).isAvailable==false",
isAvailable[0] == false);
equiv = Collator.getFunctionalEquivalent(KW[0], new ULocale("zh_Hans"));
if (assertTrue("getFunctionalEquivalent(zh_Hans)!=null", equiv!=null)) {
assertEquals("getFunctionalEquivalent(zh_Hans)", "zh", equiv.toString());
}
}
}