Package org.impalaframework.spring.config

Examples of org.impalaframework.spring.config.DynamicPropertiesFactoryBean


import org.springframework.core.io.FileSystemResource;

public class DynamicPropertiesFactoryBeanTest extends TestCase {

    public void testProperties() throws Exception {
        DynamicPropertiesFactoryBean factoryBean = new DynamicPropertiesFactoryBean();
        factoryBean.setLocation(new FileSystemResource("../impala-core/files/reload/reloadable.properties"));
       
        Properties props = (Properties) factoryBean.getObject();
        System.out.println(props);
       
        Long lastModified = factoryBean.getLastModified();
        assertTrue(lastModified > 0L);
       
        factoryBean.getObject();
        System.out.println(props);
        assertEquals(lastModified, factoryBean.getLastModified());
    }  
View Full Code Here


        System.out.println(props);
        assertEquals(lastModified, factoryBean.getLastModified());
    }  
   
    public void notestManuallyProperties() throws Exception {
        DynamicPropertiesFactoryBean factoryBean = new DynamicPropertiesFactoryBean();
        factoryBean.setLocation(new FileSystemResource("../impala-core/files/reload/reloadable.properties"));
       
        while (true) {
            Properties props = (Properties) factoryBean.getObject();
            System.out.println(props);
            Long lastModified = factoryBean.getLastModified();
            System.out.println(lastModified);
            Thread.sleep(1000);
        }
    }
View Full Code Here

        super.tearDown();
        System.clearProperty("property.folder");
    }
   
    public void testDynamicProperties() throws Exception {
        DynamicPropertiesFactoryBean factoryBean = new DynamicPropertiesFactoryBean();
        factoryBean.setLocation(new ClassPathResource("reload/reloadable.properties"));
       
        DynamicPropertySource source = new DynamicPropertySource();
        doTest(factoryBean, source);
    }
View Full Code Here

        DynamicPropertySource source = new DynamicPropertySource();
        doTest(factoryBean, source);
    }
   
    public void testDynamicPropertiesWithExecutorService() throws Exception {
        DynamicPropertiesFactoryBean factoryBean = new DynamicPropertiesFactoryBean();
        factoryBean.setLocation(new ClassPathResource("reload/reloadable.properties"));
       
        DynamicPropertySource source = new DynamicPropertySource();
        source.setExecutorService(Executors.newScheduledThreadPool(2));
        doTest(factoryBean, source);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.spring.config.DynamicPropertiesFactoryBean

Copyright © 2018 www.massapicom. 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.