String compareStrGer = "At <time> on 08.08.1997, you made a deposit of ";
compareStrGer += "456,83\u00a0";
compareStrGer += '\u00a4';
compareStrGer += ".";
MessageFormat msg = new MessageFormat(formatStr, Locale.ENGLISH);
result.setLength(0);
FieldPosition pos = new FieldPosition(0);
result = msg.format(
arguments,
result,
pos);
assertEquals("format", compareStrEng, result.toString());
msg.setLocale(Locale.ENGLISH);
assertEquals("getLocale", Locale.ENGLISH, msg.getLocale());
msg.setLocale(Locale.GERMAN);
assertEquals("getLocale", Locale.GERMAN, msg.getLocale());
msg.applyPattern(formatStr);
result.setLength(0);
result = msg.format(
arguments,
result,
pos);
assertEquals("format", compareStrGer, result.toString());
//Cover getULocale()
logln("Testing set/get ULocale ...");
msg.setLocale(ULocale.ENGLISH);
assertEquals("getULocale", ULocale.ENGLISH, msg.getULocale());
msg.setLocale(ULocale.GERMAN);
assertEquals("getULocale", ULocale.GERMAN, msg.getULocale());
msg.applyPattern(formatStr);
result.setLength(0);
result = msg.format(
arguments,
result,
pos);
assertEquals("format", compareStrGer, result.toString());
}