mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add notFullTimeoutRetryCount support
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.alibaba.druid.bvt.pool;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
|
||||
public class FullTest extends TestCase {
|
||||
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
dataSource.setTestOnBorrow(false);
|
||||
|
||||
dataSource.init();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
dataSource.close();
|
||||
}
|
||||
|
||||
public void test_restart() throws Exception {
|
||||
Assert.assertEquals(false, dataSource.isFull());
|
||||
dataSource.fill();
|
||||
|
||||
Assert.assertEquals(true, dataSource.isFull());
|
||||
Connection conn = dataSource.getConnection();
|
||||
Assert.assertEquals(true, dataSource.isFull());
|
||||
conn.close();
|
||||
Assert.assertEquals(true, dataSource.isFull());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user