use of org.exoplatform.container.configuration.ConfigurationManagerImpl in project kernel by exoplatform.
the class TestTemplateConfigurationHelper method testFilters.
public void testFilters() {
// create helper with predefined include and exclude patterns
TemplateConfigurationHelper helper = new TemplateConfigurationHelper(new String[] { "^foo-.*", "^jgroups-configuration" }, new String[] { "^foo-configuration" }, new ConfigurationManagerImpl());
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("foo-configuration", "");
parameters.put("foo-cache.loader", "");
parameters.put("foo-clustername", "");
parameters.put("max-volatile-size", "");
Map<String, String> preparedParameters = helper.prepareParameters(parameters);
assertEquals(2, preparedParameters.size());
// "foo-configuration" and "max-volatile-size" should be excluded
assertFalse(preparedParameters.containsKey("${foo-configuration}"));
assertFalse(preparedParameters.containsKey("${max-volatile-size}"));
assertTrue(preparedParameters.containsKey("${foo-cache.loader}"));
assertTrue(preparedParameters.containsKey("${foo-clustername}"));
}
Aggregations