List of usage examples for org.springframework.beans.factory.config PropertyPlaceholderConfigurer PropertyPlaceholderConfigurer
PropertyPlaceholderConfigurer
From source file:com.kixeye.chassis.support.test.eureka.ChassisEurekaTestConfiguration.java
@Bean static public PropertyPlaceholderConfigurer archaiusPropertyPlaceholderConfigurer() throws IOException, ConfigurationException { ConfigurationManager.loadPropertiesFromResources("chassis-test.properties"); ConfigurationManager.loadPropertiesFromResources("chassis-default.properties"); return new PropertyPlaceholderConfigurer() { @Override/*from w w w . j a v a 2 s . c o m*/ protected String resolvePlaceholder(String placeholder, Properties props, int systemPropertiesMode) { return DynamicPropertyFactory.getInstance().getStringProperty(placeholder, "null").get(); } }; }
From source file:com.github.cherimojava.orchidae.config.cfgTest.java
@Bean public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() { return new PropertyPlaceholderConfigurer(); }
From source file:com.notemyweb.config.MainConfig.java
@Bean public PropertyPlaceholderConfigurer createPlaceHolders() throws Exception { PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer(); Properties properties = new FusionConfig().getFusionProperties(NotesUtil.getEnv()); propertyPlaceholderConfigurer.setProperties(properties); propertyPlaceholderConfigurer/* w w w.jav a 2s . co m*/ .setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE); return propertyPlaceholderConfigurer; }
From source file:ch.vorburger.mariadb4j.tests.springframework.MariaDB4jSpringServiceTestSpringConfiguration.java
@Bean PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() { PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); Properties properties = new Properties(); configureProperties(properties);/* w w w . j a va 2 s. c o m*/ ppc.setProperties(properties); return ppc; }
From source file:no.dusken.aranea.spring.AraneaContextLoaderListener.java
public void addDeveloperModeReplacer(ConfigurableWebApplicationContext wac) { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); final Properties properties = new Properties(); properties.setProperty("developerMode", Boolean.toString(System.getProperty("developerMode") != null)); configurer.setProperties(properties); configurer.setIgnoreUnresolvablePlaceholders(true); wac.addBeanFactoryPostProcessor(configurer); }
From source file:com.thinkbiganalytics.metadata.sla.TestConfiguration.java
@Bean public PropertyPlaceholderConfigurer jiraPropertiesConfigurer() { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); configurer.setLocations(new ClassPathResource("/conf/sla.email.properties")); configurer.setIgnoreUnresolvablePlaceholders(true); configurer.setIgnoreResourceNotFound(true); return configurer; }
From source file:com.github.ffremont.microservices.springboot.node.tasks.SimpleTestConfiguration.java
@Bean public PropertyPlaceholderConfigurer getProps() throws IOException { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); Properties props = new Properties(); Map myMap = new HashMap<>(); myMap.put("app.base", Files.createTempDirectory("appBaseNode").toString()); myMap.put("app.cluster", "myCuster"); myMap.put("app.node", "myNode"); myMap.put("app.master.host", "localhost"); myMap.put("app.master.port", "9999"); myMap.put("app.master.contextRoot", "/test"); myMap.put("app.master.user", ""); myMap.put("app.master.pwd", ""); props.putAll(myMap);/* www . j av a2 s. c o m*/ configurer.setProperties(props); return configurer; }
From source file:com.baidu.cc.spring.ConfigCenterPropertyExtractorTest.java
/** * test property extractor//from w w w .j ava2s . co m * this test method is ignored due to local environment required. * * @throws Exception throw out all exception to break unit test and mark failed. */ @Ignore @Test public void testPropertyExtractorNoMock() throws Exception { PropertyPlaceholderConfigurer extractor = new PropertyPlaceholderConfigurer(); ClassPathResource cpr = new ClassPathResource("/com/baidu/cc/spring/test.properties"); extractor.setLocation(cpr); ConfigCenterPropertyPlaceholderConfigurer importer; importer = new ConfigCenterPropertyPlaceholderConfigurer(); importer.setCcUser("test1"); importer.setCcPassword("123"); importer.setCcVersion(586); importer.setCcServerUrl("http://localhost:8080/rpc/ExtConfigServerService"); importer.setReadTimeout(5000); //initial importer ConfigCenterPropertyPlaceholderConfigurerTest test = new ConfigCenterPropertyPlaceholderConfigurerTest(); importer.setApplicationContext(test.appContext); DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); importer.postProcessBeanFactory(beanFactory); ConfigCenterPropertyExtractor ccpe = new ConfigCenterPropertyExtractor(); ccpe.setCcVersion(586); ccpe.setExtractor(extractor); ccpe.setImporter(importer); ccpe.afterPropertiesSet(); }
From source file:org.rivetlogic.utils.IntegrationUtils.java
public static BeanFactory getBeanFactory() throws IOException { if (beanFactory == null) { synchronized (beanFactoryLockObj) { if (beanFactory == null) { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); AbstractApplicationContext context = new ClassPathXmlApplicationContext( "application-context.xml"); Resource resource = new FileSystemResource("cma-cfg.properties"); Properties properties = new Properties(); properties.load(resource.getInputStream()); configurer.setProperties(properties); context.addBeanFactoryPostProcessor(configurer); context.refresh();//from w w w. j a v a 2 s . c o m beanFactory = context.getBeanFactory(); } } } return beanFactory; }
From source file:org.ow2.proactive.scheduling.api.graphql.service.AuthenticationServiceTestConfig.java
@Bean public PropertyPlaceholderConfigurer properties() throws Exception { PropertyPlaceholderConfigurer placeholderConfigurer = new PropertyPlaceholderConfigurer(); placeholderConfigurer.setLocation(new ClassPathResource("application-test.properties")); return placeholderConfigurer; }