Search in sources :

Example 1 with TestAllPropertiesMessageSource

use of org.molgenis.i18n.test.exception.TestAllPropertiesMessageSource in project molgenis by molgenis.

the class RestControllerV2Test method beforeClass.

@BeforeClass
public void beforeClass() {
    ResourceBundleMessageSource validationMessages = new ResourceBundleMessageSource();
    validationMessages.addBasenames("org.hibernate.validator.ValidationMessages");
    TestAllPropertiesMessageSource messageSource = new TestAllPropertiesMessageSource(new MessageFormatFactory());
    messageSource.addMolgenisNamespaces("data", "web");
    messageSource.setParentMessageSource(validationMessages);
    MessageSourceHolder.setMessageSource(messageSource);
}
Also used : MessageFormatFactory(org.molgenis.i18n.format.MessageFormatFactory) ResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource) TestAllPropertiesMessageSource(org.molgenis.i18n.test.exception.TestAllPropertiesMessageSource)

Example 2 with TestAllPropertiesMessageSource

use of org.molgenis.i18n.test.exception.TestAllPropertiesMessageSource in project molgenis by molgenis.

the class RestControllerTest method beforeClass.

@BeforeClass
public void beforeClass() {
    ResourceBundleMessageSource validationMessages = new ResourceBundleMessageSource();
    validationMessages.addBasenames("org.hibernate.validator.ValidationMessages");
    TestAllPropertiesMessageSource messageSource = new TestAllPropertiesMessageSource(new MessageFormatFactory());
    messageSource.addMolgenisNamespaces("data", "web");
    messageSource.setParentMessageSource(validationMessages);
    MessageSourceHolder.setMessageSource(messageSource);
}
Also used : MessageFormatFactory(org.molgenis.i18n.format.MessageFormatFactory) ResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource) TestAllPropertiesMessageSource(org.molgenis.i18n.test.exception.TestAllPropertiesMessageSource) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

MessageFormatFactory (org.molgenis.i18n.format.MessageFormatFactory)2 TestAllPropertiesMessageSource (org.molgenis.i18n.test.exception.TestAllPropertiesMessageSource)2 ResourceBundleMessageSource (org.springframework.context.support.ResourceBundleMessageSource)2 BeforeClass (org.testng.annotations.BeforeClass)1