use of org.apache.struts.util.MessageResources in project sonarqube by SonarSource.
the class TagTestBase method putBundleInScope.
protected void putBundleInScope(int scope, boolean returnNull) {
MessageResourcesFactory factory = MessageResourcesFactory.createFactory();
MessageResources messageResources = new PropertyMessageResources(factory, "org.apache.struts.taglib.sample");
messageResources.setReturnNull(returnNull);
pageContext.setAttribute(Globals.MESSAGES_KEY, messageResources, scope);
}
use of org.apache.struts.util.MessageResources in project head by mifos.
the class MifosPropertyMessageResourcesIntegrationTest method testGetMessageLocaleString.
@Test
public void testGetMessageLocaleString() {
MifosPropertyMessageResourcesFactory factory = new MifosPropertyMessageResourcesFactory();
MessageResources resource = factory.createResources(FilePaths.ACCOUNTS_UI_RESOURCE_PROPERTYFILE);
// get a simple resource bundle entry
Assert.assertEquals("Admin", resource.getMessage(TestUtils.ukLocale(), "Account.Admin"));
// get a LookupValue
Assert.assertEquals("Branch Office", resource.getMessage(TestUtils.ukLocale(), ConfigurationConstants.BRANCHOFFICE));
}
Aggregations