use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class ConfigFilterTest3 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setFilters("config");
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class LogFilterTest2 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:derby:classpath:petstore-db");
dataSource.setFilters("log4j");
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class LogFilterTest5 method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:derby:classpath:petstore-db");
dataSource.setFilters("log4j2");
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class StatFilterResultSetMultiCloseTest method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setFilters("stat");
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(100);
dataSource.init();
}
use of com.alibaba.druid.pool.DruidDataSource in project druid by alibaba.
the class ConfigFilterTest method testInitDecrypt.
@Test
public void testInitDecrypt() throws SQLException {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setDriver(MockDriver.instance);
dataSource.setUrl("");
dataSource.setUsername("test");
dataSource.setPassword(encryptedString);
dataSource.setFilters("config");
dataSource.setConnectionProperties("config.decrypt=true");
try {
dataSource.init();
Assert.assertEquals("The password is " + dataSource.getPassword() + ", is not xiaoyu", "xiaoyu", dataSource.getPassword());
} finally {
JdbcUtils.close(dataSource);
}
}
Aggregations