ICU-6958 Increase code coverage by targeting RBNFChinesePostProcessor.java.

X-SVN-Rev: 26260
This commit is contained in:
John Vu 2009-07-09 15:25:55 +00:00
parent c9ad7a0d94
commit 2a5f342a6a
2 changed files with 16 additions and 1 deletions

View File

@ -126,7 +126,8 @@ final class CollatorServiceShim extends Collator.ServiceShim {
this.registerFactory(new CollatorFactory());
markDefault();
}
///CLOVER:OFF
// The following method can not be reached by testing
protected Object handleDefault(Key key, String[] actualIDReturn) {
if (actualIDReturn != null) {
actualIDReturn[0] = "root";
@ -138,6 +139,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
return null;
}
}
///CLOVER:ON
}
private static ICULocaleService service = new CService();
}

View File

@ -1153,4 +1153,17 @@ public class RbnfTest extends TestFmwk {
"was suppose to have an exception.");
} catch(Exception e){}
}
/* Test the method
* public void process(StringBuffer buf, NFRuleSet ruleSet)
*/
public void TestChineseProcess(){
String ruleWithChinese =
"%acounting:\n"
+ " 0 seconds; 1 second; =0= seconds;\n"
+ "%%post-process:com.ibm.icu.text.RBNFChinesePostProcessor\n";
RuleBasedNumberFormat rbnf = new RuleBasedNumberFormat(ruleWithChinese, ULocale.CHINESE);
String[] ruleNames = rbnf.getRuleSetNames();
rbnf.format(0.0,ruleNames[0]);
}
}