Examples of addConfigurationListener()


Examples of com.netflix.config.ConcurrentCompositeConfiguration.addConfigurationListener()

     */
    @Test
    public void testUpdateProperties() throws InterruptedException {
        AbstractConfiguration.setDefaultListDelimiter(',');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test", "host,host1,host2");
        config.setProperty("test12", "host12");
        Map<String,Object> added = Maps.newHashMap();
        added.put("test.host","test,test1");
View Full Code Here

Examples of com.netflix.config.ConcurrentCompositeConfiguration.addConfigurationListener()

 
    @Test
    public void testAddorChangeProperty(){
        AbstractConfiguration.setDefaultListDelimiter(',');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test.host", "test,test1,test2");
        assertEquals(1, MyListener.count);
        dynamicPropertyUpdater.addOrChangeProperty("test.host", "test,test1,test2", config);
        assertEquals(3,((CopyOnWriteArrayList)(config.getProperty("test.host"))).size());
View Full Code Here

Examples of com.netflix.config.ConcurrentCompositeConfiguration.addConfigurationListener()

   
    @Test
    public void testAddorUpdatePropertyWithColonDelimiter(){
        AbstractConfiguration.setDefaultListDelimiter(':');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test.host", "test:test1:test2");
        assertEquals(1, MyListener.count);
        dynamicPropertyUpdater.addOrChangeProperty("test.host", "test:test1:test2", config);
        assertEquals(3,((CopyOnWriteArrayList)(config.getProperty("test.host"))).size());
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.addConfigurationListener()

 
    @Test
    public void testAddorChangeProperty(){
        AbstractConfiguration.setDefaultListDelimiter(',');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test.host", "test,test1,test2");
        assertEquals(1, MyListener.count);
        dynamicPropertyUpdater.addOrChangeProperty("test.host", "test,test1,test2", config);
        assertEquals(3,((CopyOnWriteArrayList)(config.getProperty("test.host"))).size());
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.addConfigurationListener()

   
    @Test
    public void testAddorUpdatePropertyWithColonDelimiter(){
        AbstractConfiguration.setDefaultListDelimiter(':');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test.host", "test:test1:test2");
        assertEquals(1, MyListener.count);
        dynamicPropertyUpdater.addOrChangeProperty("test.host", "test:test1:test2", config);
        assertEquals(3,((CopyOnWriteArrayList)(config.getProperty("test.host"))).size());
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.addConfigurationListener()

public class PropertyListenerTest {
   
    @Test
    public void testAddPropertyListener() {
        AbstractConfiguration config = ConfigurationManager.getConfigInstance();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        // config.addConfigurationListener(new MyListener());
        config.setProperty("xyz", "abcc");
        assertEquals(1, MyListener.count);
    }
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.addConfigurationListener()

     */
    @Test
    public void testUpdateProperties() throws InterruptedException {
        AbstractConfiguration.setDefaultListDelimiter(',');
        AbstractConfiguration config  = new ConcurrentCompositeConfiguration();
        config.addConfigurationListener(new ExpandedConfigurationListenerAdapter(new MyListener()));
        MyListener.resetCount();
        config.setProperty("test", "host,host1,host2");
        config.setProperty("test12", "host12");
        Map<String,Object> added = Maps.newHashMap();
        added.put("test.host","test,test1");
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.addConfigurationListener()

            }   
            contextValue = getValueFromConfig(DEPLOYMENT_SERVER_ID_PROPERTY);
            if (contextValue != null) {
                setDeploymentStack(contextValue);
            }   
            config.addConfigurationListener(configListener);
        }
    }
   
    /**
     * Get the deployment environment. If property "archaius.deployment.environment"
View Full Code Here

Examples of org.apache.commons.configuration.BaseConfiguration.addConfigurationListener()

    @Test
    public void testPerformance() {
        MyListener listener = new MyListener();
        BaseConfiguration baseConfig = new BaseConfiguration();
        baseConfig.addConfigurationListener(listener);
        HierarchicalConfiguration hConfig = new HierarchicalConfiguration();
        hConfig.addConfigurationListener(listener);
        ConcurrentMapConfiguration conf = new ConcurrentMapConfiguration();
        conf.addConfigurationListener(listener);
        testConfigurationSet(baseConfig);
View Full Code Here

Examples of org.apache.commons.configuration.HierarchicalConfiguration.addConfigurationListener()

    public void testPerformance() {
        MyListener listener = new MyListener();
        BaseConfiguration baseConfig = new BaseConfiguration();
        baseConfig.addConfigurationListener(listener);
        HierarchicalConfiguration hConfig = new HierarchicalConfiguration();
        hConfig.addConfigurationListener(listener);
        ConcurrentMapConfiguration conf = new ConcurrentMapConfiguration();
        conf.addConfigurationListener(listener);
        testConfigurationSet(baseConfig);
        testConfigurationSet(hConfig);
        testConfigurationSet(conf);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.