完善监控

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@922 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-29 02:22:28 +00:00
parent 7ef38314ba
commit 508a6aab09
5 changed files with 33 additions and 38 deletions
@@ -5,6 +5,8 @@ import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.mock.MockPreparedStatement;
import com.alibaba.druid.pool.ConnectionHolder;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.PoolablePreparedStatement.PreparedStatementKey;
import com.alibaba.druid.pool.PreparedStatementHolder;
import com.alibaba.druid.pool.PreparedStatementPool;
@@ -95,8 +97,9 @@ public class PreparedStatementKeyTest extends TestCase {
}
public void test_contains() throws Exception {
DruidDataSource dataSource = new DruidDataSource();
PreparedStatementKey k1 = new PreparedStatementKey("x1", "c1", MethodType.M1);
PreparedStatementPool pool = new PreparedStatementPool(10);
PreparedStatementPool pool = new PreparedStatementPool(new ConnectionHolder(dataSource, null));
MockPreparedStatement raw = new MockPreparedStatement(null, null);
pool.put(new PreparedStatementHolder(k1, raw));
Assert.assertTrue(pool.get(k1) != null);