de.ppi.selenium.logevent.report.MessageSourceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webtest Show documentation
Show all versions of webtest Show documentation
Some additional helper for webtesting with selenium
package de.ppi.selenium.logevent.report;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* Default-Implementation.
*
*/
public class MessageSourceImpl implements MessageSource {
/**
* {@inheritDoc}
*/
@Override
public String getMessage(String key, Locale locale, Object... arguments) {
final ResourceBundle resourceBundle =
ResourceBundle.getBundle("WebTestMessages", locale);
final String message =
resourceBundle.containsKey(key) ? resourceBundle.getString(key)
: key;
MessageFormat messageFormat = new MessageFormat(message, locale);
return messageFormat.format(arguments);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy