mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
@@ -32,8 +32,11 @@ public class Bug_for_happyday517 extends TestCase {
|
||||
|
||||
private DruidDataSource dataSource;
|
||||
private MockDriver driver;
|
||||
private int originalDataSourceCount = 0;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
|
||||
|
||||
driver = new MockDriver();
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
@@ -43,7 +46,7 @@ public class Bug_for_happyday517 extends TestCase {
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
dataSource.close();
|
||||
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
Assert.assertEquals(originalDataSourceCount, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
}
|
||||
|
||||
public void test_for_happyday517_0() throws Exception {
|
||||
|
||||
@@ -36,8 +36,11 @@ public class Bug_for_happyday517_2 extends TestCase {
|
||||
private MockDriver driver;
|
||||
|
||||
final DataTruncation exception = new java.sql.DataTruncation(0, true, true, 0, 0);
|
||||
|
||||
private int originalDataSourceCount = 0;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
|
||||
|
||||
final MockPreparedStatement mockStatement = new MockPreparedStatement(null, null) {
|
||||
|
||||
@@ -67,7 +70,7 @@ public class Bug_for_happyday517_2 extends TestCase {
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
dataSource.close();
|
||||
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
Assert.assertEquals(originalDataSourceCount, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
}
|
||||
|
||||
public void test_bug() throws Exception {
|
||||
|
||||
@@ -29,7 +29,11 @@ public class Bug_for_happyday517_3 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
private MockDriver driver;
|
||||
|
||||
private int originalDataSourceCount = 0;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
originalDataSourceCount = DruidDataSourceStatManager.getInstance().getDataSourceList().size();
|
||||
|
||||
driver = new MockDriver();
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setDriver(driver);
|
||||
@@ -40,7 +44,7 @@ public class Bug_for_happyday517_3 extends TestCase {
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
dataSource.close();
|
||||
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
Assert.assertEquals(originalDataSourceCount, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
}
|
||||
|
||||
public void test_bug() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user