Search in sources :

Example 6 with PropertiesParam

use of org.exoplatform.container.xml.PropertiesParam in project kernel by exoplatform.

the class TestPropertyManagerConfigurator method testFromXML.

public void testFromXML() throws Exception {
    reset();
    URL propertiesURL = TestPropertyManagerConfigurator.class.getResource("property-configurator.xml");
    assertNotNull(propertiesURL);
    System.setProperty(PropertyManager.PROPERTIES_URL, propertiesURL.toString());
    System.setProperty("property_2", "property_value_2");
    PropertiesParam propertiesParam = new PropertiesParam();
    InitParams params = new InitParams();
    params.put("properties", propertiesParam);
    new PropertyConfigurator(params, new ConfigurationManagerImpl(new HashSet<String>()));
    Map<String, String> additions = reset();
    assertEquals("property_value_1", additions.get("property_1"));
    assertEquals("property_value_2", additions.get("property_2"));
    assertEquals("${property_3}", additions.get("property_3"));
    assertEquals("property_value_1-property_value_2", additions.get("property_4"));
}
Also used : InitParams(org.exoplatform.container.xml.InitParams) PropertiesParam(org.exoplatform.container.xml.PropertiesParam) ConfigurationManagerImpl(org.exoplatform.container.configuration.ConfigurationManagerImpl) URL(java.net.URL) HashSet(java.util.HashSet)

Aggregations

PropertiesParam (org.exoplatform.container.xml.PropertiesParam)6 InitParams (org.exoplatform.container.xml.InitParams)5 HashSet (java.util.HashSet)4 ConfigurationManagerImpl (org.exoplatform.container.configuration.ConfigurationManagerImpl)4 URL (java.net.URL)3 InputStream (java.io.InputStream)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Component (org.exoplatform.container.xml.Component)1 ComponentLifecyclePlugin (org.exoplatform.container.xml.ComponentLifecyclePlugin)1 ComponentPlugin (org.exoplatform.container.xml.ComponentPlugin)1 Configuration (org.exoplatform.container.xml.Configuration)1 ContainerLifecyclePlugin (org.exoplatform.container.xml.ContainerLifecyclePlugin)1 ExternalComponentPlugins (org.exoplatform.container.xml.ExternalComponentPlugins)1 ManageableComponents (org.exoplatform.container.xml.ManageableComponents)1 ObjectParameter (org.exoplatform.container.xml.ObjectParameter)1 ValuesParam (org.exoplatform.container.xml.ValuesParam)1 IBindingFactory (org.jibx.runtime.IBindingFactory)1 IUnmarshallingContext (org.jibx.runtime.IUnmarshallingContext)1