use of org.apache.tapestry5.internal.services.messages.PropertiesFileParserImpl in project tapestry-5 by apache.
the class ComponentMessagesSourceImplTest method no_app_catalog.
@Test
public void no_app_catalog() {
ComponentModel model = mockComponentModel();
ComponentModel parent = mockComponentModel();
train_getComponentClassName(model, "org.apache.tapestry5.internal.services.SubclassComponent");
train_getBaseResource(model, new ClasspathResource("org/apache/tapestry5/internal/services/SubclassComponent.class"));
train_getParentModel(model, parent);
train_getComponentClassName(parent, SIMPLE_COMPONENT_CLASS_NAME);
train_getBaseResource(parent, simpleComponentResource);
train_getParentModel(parent, null);
replay();
forceCacheClear();
Resource resource = simpleComponentResource.forFile("NoSuchAppCatalog.properties");
List<Resource> resources = Arrays.asList(resource);
ComponentMessagesSource source = new ComponentMessagesSourceImpl(true, resources, new PropertiesFileParserImpl(), resourceLocator, converter, componentRequestSelectorAnalyzer, threadLocale);
Messages messages = source.getMessages(model, Locale.ENGLISH);
assertEquals(messages.get("color"), "color");
assertEquals(messages.get("app-catalog-source"), "[[missing key: app-catalog-source]]");
assertEquals(messages.get("app-catalog-overridden"), "Overridden by Component");
verify();
}
Aggregations