* <li>the key is not found in any resource bundle.</li>
* <ul>
*/
public void testMessageExtension() {
fExtReg.registerResourceBundle("org.apache.woden.wsdl20.extensions.resources.ExtensionMessages");
ErrorReporter errorReporter = fExtReg.getErrorReporter();
// verify formatting of a message in core resource bundle
assertEquals("Unexpected core message",
"The feature name \"foo\" is not recognized.",
errorReporter.getFormattedMessage("WSDL006", new Object[]{"foo"}));
// verify formatting of a message in extension resource bundle
assertEquals("Unexpected extension message",
"Attribute \"count\" in element \"ext\" must contain \"int\".",
errorReporter.getFormattedMessage("EXT001", new Object[]{"count", "ext", "int"}));
// verify core format is not overridden by extension resource bundle
assertEquals("Unexpected core message",
"The property name must not be null when attempting to get or set a named property.",
errorReporter.getFormattedMessage("WSDL007", null));
// verify exception on unknown format key
String unknownKey = "_UNKNOWN_KEY_";
try {
errorReporter.getFormattedMessage(unknownKey, new Object[]{});
fail("Expected MissingResourceException for "+unknownKey);
} catch (MissingResourceException mre) {
assertEquals("Unexpected MissingResourceException key", unknownKey, mre.getKey());
}
}