catch (Exception e) {
}
}
ULocale fu_FU = new ULocale("fu_FU");
NumberFormat f0 = NumberFormat.getIntegerInstance(SWAP_LOC);
NumberFormat f1 = NumberFormat.getIntegerInstance(SRC_LOC);
NumberFormat f2 = NumberFormat.getCurrencyInstance(SRC_LOC);
Object key = NumberFormat.registerFactory(new TestFactory());
Object key2 = NumberFormat.registerFactory(new TestFactory(fu_FU, ULocale.GERMANY));
if (!Arrays.asList(NumberFormat.getAvailableULocales()).contains(fu_FU)) {
errln("did not list fu_FU");
}
NumberFormat f3 = NumberFormat.getCurrencyInstance(SRC_LOC);
NumberFormat f4 = NumberFormat.getIntegerInstance(SRC_LOC);
NumberFormat.unregister(key); // restore for other tests
NumberFormat f5 = NumberFormat.getCurrencyInstance(SRC_LOC);
NumberFormat.unregister(key2);
float n = 1234.567f;
logln("f0 swap int: " + f0.format(n));
logln("f1 src int: " + f1.format(n));
logln("f2 src cur: " + f2.format(n));
logln("f3 reg cur: " + f3.format(n));
logln("f4 reg int: " + f4.format(n));
logln("f5 unreg cur: " + f5.format(n));
if (!f3.format(n).equals(f0.format(n))) {
errln("registered service did not match");
}
if (!f4.format(n).equals(f1.format(n))) {
errln("registered service did not inherit");
}
if (!f5.format(n).equals(f2.format(n))) {
errln("unregistered service did not match original");
}
// coverage
NumberFormat f6 = NumberFormat.getNumberInstance(fu_FU);
if (f6 == null) {
errln("getNumberInstance(fu_FU) returned null");
}
}