forked from alibaba/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add notFullTimeoutRetryCount support
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |