@Test public void default_matching_is_case_insensitive() { ComponentResources resources = mockComponentResources(); ComponentModel model = mockComponentModel(); SymbolSource symbolSource = mockSymbolSource(); ComponentModelSource modelSource = mockComponentModelSource(); String key = "foo.bar"; String value = "zaphod"; String completeId = "foo.Bar"; train_getCompleteId(resources, completeId); train_getComponentModel(resources, model); train_getMeta(model, key, null); train_getContainerResources(resources, null); train_getPageName(resources, "foo/Bar"); train_expandSymbols(symbolSource, value, value); replay(); Map<String, String> configuration = newMap(); configuration.put(key.toUpperCase(), value); MetaDataLocator locator = new MetaDataLocatorImpl(symbolSource, typeCoercer, modelSource, configuration); assertSame(locator.findMeta(key, resources, String.class), value); verify(); train_getCompleteId(resources, completeId); replay(); assertSame(locator.findMeta(key, resources, String.class), value); verify(); }
public <T> T findMeta(String key, final ComponentResources resources, Class<T> expectedType) { String value = getSymbolExpandedValueFromCache(key, resources.getCompleteId() + "/" + key, new ValueLocator() { public String valueForKey(String key) { return locate(key, resources); } }); return typeCoercer.coerce(value, expectedType); }
MetaDataLocatorImpl implements MetaDataLocator { public <T> T findMeta(String key, final ComponentResources resources, Class<T> expectedType) { String value = getSymbolExpandedValueFromCache(key, resources.getCompleteId() + "/" + key, new ValueLocator() { public String valueForKey(String key) { return locate(key, resources); } }); return typeCoercer.coerce(value, expectedType); } }
MetaDataLocatorImpl implements MetaDataLocator { public <T> T findMeta(String key, final ComponentResources resources, Class<T> expectedType) { String value = getSymbolExpandedValueFromCache(key, resources.getCompleteId() + "/" + key, new ValueLocator() { public String valueForKey(String key) { return locate(key, resources); } }); return typeCoercer.coerce(value, expectedType); } MetaDataLocatorImpl(SymbolSource symbolSource, TypeCoercer typeCoercer,
                               ComponentModelSource modelSource, Map<String, String> configuration); }
MetaDataLocatorImpl implements MetaDataLocator { public <T> T findMeta(String key, final ComponentResources resources, Class<T> expectedType) { String value = getSymbolExpandedValueFromCache(key, resources.getCompleteId() + "/" + key, new ValueLocator() { public String valueForKey(String key) { return locate(key, resources); } }); return typeCoercer.coerce(value, expectedType); } MetaDataLocatorImpl(SymbolSource symbolSource, TypeCoercer typeCoercer,
                               ComponentModelSource modelSource, Map<String, String> configuration); @PostInjection void setupInvalidation(@ComponentClasses InvalidationEventHub invalidationEventHub); T findMeta(String key, final ComponentResources resources, Class<T> expectedType); T findMeta(String key, final String pageName, Class<T> expectedType); }
MetaDataLocatorImpl implements MetaDataLocator { public <T> T findMeta(String key, final ComponentResources resources, Class<T> expectedType) { String value = getSymbolExpandedValueFromCache(key, resources.getCompleteId() + "/" + key, new ValueLocator() { public String valueForKey(String key) { return locate(key, resources); } }); return typeCoercer.coerce(value, expectedType); } MetaDataLocatorImpl(SymbolSource symbolSource, TypeCoercer typeCoercer,
                               ComponentModelSource modelSource, Map<String, String> configuration); @PostInjection void setupInvalidation(@ComponentClasses InvalidationEventHub invalidationEventHub); T findMeta(String key, final ComponentResources resources, Class<T> expectedType); T findMeta(String key, final String pageName, Class<T> expectedType);  }