Search in sources :

Example 1 with PropertyFileConnectionStringProvider

use of com.ctrip.platform.dal.dao.configure.file.PropertyFileConnectionStringProvider in project dal by ctripcorp.

the class PropertyFileConnectionStringProviderTest method testPropertyFileConnectionStringProvider.

@Test
public void testPropertyFileConnectionStringProvider() throws Exception {
    PropertyFileConnectionStringProvider provider = new PropertyFileConnectionStringProvider();
    Set<String> names = new HashSet<>();
    names.add(NAME);
    Map<String, DataSourceConfigure> map = provider.getConnectionStrings(names);
    DataSourceConfigure configure = map.get(NAME);
    Assert.assertEquals(configure.getUserName(), "testUser");
    Assert.assertEquals(configure.getPassword(), "testPassword");
    Assert.assertEquals(configure.getConnectionUrl(), "jdbc:mysql://testIP:3306/testDb");
    Assert.assertEquals(configure.getDriverClass(), "com.mysql.jdbc.Driver");
}
Also used : PropertyFileConnectionStringProvider(com.ctrip.platform.dal.dao.configure.file.PropertyFileConnectionStringProvider) DataSourceConfigure(com.ctrip.platform.dal.dao.configure.DataSourceConfigure) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

DataSourceConfigure (com.ctrip.platform.dal.dao.configure.DataSourceConfigure)1 PropertyFileConnectionStringProvider (com.ctrip.platform.dal.dao.configure.file.PropertyFileConnectionStringProvider)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1