36 Locale locale = Locale.US;
38 Properties properties =
new Properties();
39 properties.setProperty(
"backToApplication",
"Back to application");
40 properties.setProperty(
"backToClient",
"Back to {0}");
41 properties.setProperty(
"client_admin-console",
"Admin Console");
42 properties.setProperty(
"realm_example-realm",
"Example Realm");
45 MessageFormatterMethod fmt =
new MessageFormatterMethod(locale, properties);
47 String msg = (String) fmt.exec(Arrays.asList(
"backToClient",
"${client_admin-console}"));
48 Assert.assertEquals(
"Back to Admin Console", msg);
50 msg = (String) fmt.exec(Arrays.asList(
"backToClient",
"client_admin-console"));
51 Assert.assertEquals(
"Back to client_admin-console", msg);
53 msg = (String) fmt.exec(Arrays.asList(
"backToClient",
"client '${client_admin-console}' from '${realm_example-realm}'."));
54 Assert.assertEquals(
"Back to client 'Admin Console' from 'Example Realm'.", msg);