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@819 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package com.alibaba.druid.bvt.pool.basic;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.pool.PoolablePreparedStatement;
|
||||
import com.alibaba.druid.pool.PoolablePreparedStatement.PreparedStatementKey;
|
||||
import com.alibaba.druid.pool.PreparedStatementPool;
|
||||
import com.alibaba.druid.pool.PreparedStatementPool.MethodType;
|
||||
|
||||
|
||||
@@ -60,4 +62,12 @@ public class PreparedStatementKeyTest extends TestCase {
|
||||
Assert.assertFalse(k3.equals(k2));
|
||||
Assert.assertFalse(k3.equals(k1));
|
||||
}
|
||||
|
||||
public void test_contains() throws Exception {
|
||||
PreparedStatementKey k1 = new PreparedStatementKey("x1", "c1", MethodType.M1);
|
||||
PreparedStatementPool pool = new PreparedStatementPool();
|
||||
pool.put(new PoolablePreparedStatement(null, null, k1));
|
||||
Assert.assertTrue(pool.get(k1) != null);
|
||||
Assert.assertTrue(pool.get(k1) == null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user