mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@86 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,13 +1,37 @@
|
||||
package com.alibaba.druid.bvt.pool;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import javax.security.auth.callback.PasswordCallback;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
|
||||
public class PasswordCallbackTest extends TestCase {
|
||||
|
||||
public void test_0 () throws Exception {
|
||||
DruidDataSource dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:");
|
||||
dataSource.setPasswordCallback(passwordCallback)
|
||||
dataSource.setPasswordCallback(new TestPasswordCallback());
|
||||
|
||||
Connection conn = dataSource.getConnection();
|
||||
conn.close();
|
||||
}
|
||||
|
||||
public static class TestPasswordCallback extends PasswordCallback {
|
||||
public TestPasswordCallback() {
|
||||
super ("test", false);
|
||||
}
|
||||
|
||||
public TestPasswordCallback(String prompt, boolean echoOn){
|
||||
super(prompt, echoOn);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user