Merge pull request #1188 from wenshao/master

fixed testcase
This commit is contained in:
wenshao
2016-04-24 11:56:08 +08:00
3 changed files with 13 additions and 3 deletions
@@ -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 {