1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.fit.core;
20
21 import javax.sql.DataSource;
22 import org.springframework.beans.factory.annotation.Value;
23 import org.springframework.context.annotation.Bean;
24 import org.springframework.context.annotation.Configuration;
25 import org.springframework.context.annotation.PropertySource;
26 import org.springframework.jdbc.datasource.DriverManagerDataSource;
27
28 @PropertySource("classpath:test.properties")
29 @Configuration(proxyBeanMethods = false)
30 public class CoreITContext {
31
32 @Value("${testdb.driver}")
33 private String driverClassName;
34
35 @Value("${testdb.url}")
36 private String url;
37
38 @Value("${testdb.username}")
39 private String username;
40
41 @Value("${testdb.password}")
42 private String password;
43
44 @Bean
45 public DataSource testDataSource() {
46 DriverManagerDataSource ds = new DriverManagerDataSource();
47 ds.setDriverClassName(driverClassName);
48 ds.setUrl(url);
49 ds.setUsername(username);
50 ds.setPassword(password);
51 return ds;
52 }
53 }