I18nUtil { public static String getMessage(String key) { return getMessage(key.trim(), DEFAULTLOCALE); }  static Locale getDefaultLocale(); static Locale getEPersonLocale(EPerson ep); static Locale[] getSupportedLocales(); static Locale getSupportedLocale(Locale locale); static String getInputFormsFileName(Locale locale); static String getMessage(String key); static String getMessage(String key, Locale locale); static String getMessage(String key, Context c); static String getDefaultLicense(Context context); static String getEmailFilename(Locale locale, String name); static Locale[] parseLocales(String[] locales); static final Locale DEFAULTLOCALE; }
@Test public void testGetMessage_String_Locale() { System.out.println("getMessage"); String key, expResult, result; Locale locale = Locale.US; key = "jsp.general.home"; expResult = "DSpace Home"; result = I18nUtil.getMessage(key, locale); assertEquals("Returns the translation of the key if it is defined", expResult, result); key = expResult = "bogus key"; result = I18nUtil.getMessage(key, locale); assertEquals("Returns the key if it is not defined", expResult, result); }