mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Fix obvious mistakes like spelling errors
This commit is contained in:
@@ -16,7 +16,7 @@ public class BitwiseAndTest extends TestCase {
|
||||
|
||||
public void test_true() throws Exception {
|
||||
WallConfig config = new WallConfig();
|
||||
config.setConditionOpBitwseAllow(false);
|
||||
config.setConditionOpBitwiseAllow(false);
|
||||
Assert.assertFalse(WallUtils.isValidateMySql(//
|
||||
"SELECT * from t where id = 1 & 2", config)); //
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BitwiseInvertTest extends TestCase {
|
||||
|
||||
public void test_false() throws Exception {
|
||||
WallConfig config = new WallConfig();
|
||||
config.setConditionOpBitwseAllow(false);
|
||||
config.setConditionOpBitwiseAllow(false);
|
||||
Assert.assertFalse(WallUtils.isValidateMySql(//
|
||||
"SELECT * from t where id = ~2", config)); //
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BitwiseOrTest extends TestCase {
|
||||
|
||||
public void test_false() throws Exception {
|
||||
WallConfig config = new WallConfig();
|
||||
config.setConditionOpBitwseAllow(false);
|
||||
config.setConditionOpBitwiseAllow(false);
|
||||
Assert.assertFalse(WallUtils.isValidateMySql(//
|
||||
"SELECT * from t where id = 1 | 2", config)); //
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BitwiseXorTest extends TestCase {
|
||||
|
||||
public void test_false() throws Exception {
|
||||
WallConfig config = new WallConfig();
|
||||
config.setConditionOpBitwseAllow(false);
|
||||
config.setConditionOpBitwiseAllow(false);
|
||||
Assert.assertFalse(WallUtils.isValidateMySql(//
|
||||
"SELECT * from t where id = 1 ^ 2", config)); //
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MySqlWallTest43 extends TestCase {
|
||||
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
provider.getConfig().setConditionAndAlwayTrueAllow(true);
|
||||
provider.getConfig().setConditionAndAlwaysTrueAllow(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"SELECT COUNT(1) AS count FROM `team` " + //
|
||||
@@ -64,7 +64,7 @@ public class MySqlWallTest43 extends TestCase {
|
||||
|
||||
public void test_true2() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
provider.getConfig().setConditionAndAlwayFalseAllow(true);
|
||||
provider.getConfig().setConditionAndAlwaysFalseAllow(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"SELECT COUNT(1) AS count FROM `team` " + //
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MySqlWallTest89 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"select login('', '', 'guest', '47ea3937793101011caaa5dd88d3bcae926526624796b8a26a9615e8d3bea6b4', 'iPad3,4', 'unknown'), '', (select max(num) from accounts) + @@auto_increment_increment"));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MySqlWallTest90 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"select * from (select t10006_men_xing_jia_ge_fen_lei.bian_hao as \"bian_hao\", " + //
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MySqlWallTest91 extends TestCase {
|
||||
|
||||
provider.getConfig().setStrictSyntaxCheck(false);
|
||||
provider.getConfig().setMultiStatementAllow(true);
|
||||
provider.getConfig().setConditionAndAlwayTrueAllow(true);
|
||||
provider.getConfig().setConditionAndAlwaysTrueAllow(true);
|
||||
provider.getConfig().setNoneBaseStatementAllow(true);
|
||||
provider.getConfig().setLimitZeroAllow(true);
|
||||
provider.getConfig().setConditionDoubleConstAllow(true);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MySqlWallTest_concat extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new MySqlWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"select * from tb_product_word where name='' or CONCAT(name,style)='' or CONCAT(shop,style)='' or CONCAT(ename,style)=''"));
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SQLServerWallTest_0 extends TestCase {
|
||||
|
||||
provider.getConfig().setStrictSyntaxCheck(false);
|
||||
provider.getConfig().setMultiStatementAllow(true);
|
||||
provider.getConfig().setConditionAndAlwayTrueAllow(true);
|
||||
provider.getConfig().setConditionAndAlwaysTrueAllow(true);
|
||||
provider.getConfig().setNoneBaseStatementAllow(true);
|
||||
provider.getConfig().setLimitZeroAllow(true);
|
||||
provider.getConfig().setConditionDoubleConstAllow(true);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLServerWallTest_3 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new SQLServerWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertFalse(provider.checkValid(//
|
||||
"select * from t where LEN(HOST_NAME()) > 0"));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLServerWallTest_4 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new SQLServerWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"insert into t (fid, name) values (1, HOST_NAME())"));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLServerWallTest_5 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new SQLServerWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertFalse(provider.checkValid(//
|
||||
"delete t where LEN(HOST_NAME()) > 0"));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLServerWallTest_6 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new SQLServerWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertFalse(provider.checkValid(//
|
||||
"update t set fid = 1 where LEN(HOST_NAME()) > 0"));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLServerWallTest_7 extends TestCase {
|
||||
public void test_true() throws Exception {
|
||||
WallProvider provider = new SQLServerWallProvider();
|
||||
|
||||
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
|
||||
provider.getConfig().setSelectHavingAlwaysTrueCheck(true);
|
||||
|
||||
Assert.assertTrue(provider.checkValid(//
|
||||
"select * from (select top 3000 jol.id as primaryKeyIds, jo.orderNo as 委托单号, bm.custname as 委托方名称, manuCustInfo.custname as 出证方, jo.chkerDate as 委托日期, bcc.connectName as 联系人, bcc.mobile as 电话,jol.barcode as 样品条码, jol.name as 样品名称, jol.qtysub as 套件数量,jol.OnlyCode as 唯一识别码,jol.manufacture as 制造厂商,jol.sprc as 规格型号, jol.outno as 出厂编号, djod.name as 任务状态, djoc.name 委托类别, dct.name as 证书类型,bdp.organ_name as 分配室组, jol.task_id as 任务ID, be.user_name as 检定人员, verifyUser.user_name as 核验员, checkUser.user_name as 批准员, jol.ddate 交款日期,cjcs.name as 缴款状态, jc.moneys as 应收费, jc.moneystotal as 实收费, be.organ_id from jl_OrderList jol left outer join jl_CheckList jc on jol.checkList_id = jc.id left outer join jl_Order jo on jol.orderid = jo.id left outer join ba_dptinfo bdp on jol.dptid = bdp.id left outer join jl_Task jt on jol.task_id = jt.id left outer join ba_manucustinfo bm on jo.entrustCustId = bm.id left outer join ba_manucustinfo manuCustInfo on jo.custid = manuCustInfo.id left outer join ba_custconnect bcc on jo.linkPerson = bcc.id left outer join ba_employeeinfo be on jt.jdUserId = be.id left outer join ba_employeeinfo verifyUser on jt.verifyUser = verifyUser.id left outer join ba_employeeinfo checkUser on jt.checkUser = checkUser.id left outer join dict_jl_order_doType djod on jol.dotypeid = djod.id left outer join dict_jl_order_class djoc on jo.orderclassid = djoc.id left outer join dict_certificate_type dct on jt.certificatetype = dct.id left outer join dict_jl_chargestatus cjcs on jol.chargestatus = cjcs.id where jol.id >= (select min(primaryKeyId) from (select top 3000 jol.id as primaryKeyId from jl_OrderList jol left outer join jl_CheckList jc on jol.checkList_id = jc.id left outer join jl_Order jo on jol.orderid = jo.id left outer join ba_dptinfo bdp on jol.dptid = bdp.id left outer join jl_Task jt on jol.task_id = jt.id left outer join ba_manucustinfo bm on jo.entrustCustId = bm.id left outer join ba_manucustinfo manuCustInfo on jo.custid = manuCustInfo.id left outer join ba_custconnect bcc on jo.linkPerson = bcc.id left outer join ba_employeeinfo be on jt.jdUserId = be.id left outer join ba_employeeinfo verifyUser on jt.verifyUser = verifyUser.id left outer join ba_employeeinfo checkUser on jt.checkUser = checkUser.id left outer join dict_jl_order_doType djod on jol.dotypeid = djod.id left outer join dict_jl_order_class djoc on jo.orderclassid = djoc.id left outer join dict_certificate_type dct on jt.certificatetype = dct.id left outer join dict_jl_chargestatus cjcs on jol.chargestatus = cjcs.id where jo.chkerDate >= ? and jo.chkerDate <= ? and jol.ddate >= ? order by jol.id desc, jo.id DESC) as T) and jo.chkerDate >= ? and jo.chkerDate <= ? and jol.ddate >= ? order by jol.id asc, jo.id DESC) as T1 order by T1.primaryKeyIds desc"));
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class Case0 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class Case1 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.alibaba.druid.util.JMXUtils;
|
||||
public class Case2 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Case3 extends TestCase {
|
||||
// dataSource.close();
|
||||
// }
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.stat.JdbcStatManager;
|
||||
public class DruidDataSourceFilterTest extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ManagedDataSourceTest extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.stat.JdbcStatManager;
|
||||
public class ParamTest extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.util.DruidPasswordCallback;
|
||||
public class PasswordCallbackTest extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.alibaba.druid.support.json.JSONUtils;
|
||||
public class SpringIbatisFilterTest extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class SpringMybatisFilterTest extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class TestAbondon extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setRemoveAbandoned(true);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TestActiveTrace extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setRemoveAbandoned(true);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestClose_0 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestClose_1 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestClose_2 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TestConcurrent extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
driver.setLogExecuteQueryEnable(false);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestDefault extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestDisable extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestDruidDataSource extends TestCase {
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TestGraceShutdown extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TestIdle extends TestCase {
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
JdbcUtils.close(dataSource);
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestIdle2 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestIdle3 extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestIdle3_Concurrent extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestIdle3_Concurrent_MaxActive extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TestIdle3_Concurrent_Starvation extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class TestOnBorrowFileAndNameTest extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestPoolPreparedStatement extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestPoolPreparedStatement2 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestSharePreparedStatements extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class TestStat extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ConnectionTest extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ConnectionTest2 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ConnectionTest3 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ConnectionTest4 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ConnectionTest5 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DataSourceTest3 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PoolableStatementTest2 extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestCommit extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TestDataSourceBasic extends TestCase {
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
driver = new MockDriver();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.alibaba.druid.stat.DruidDataSourceStatManager;
|
||||
public class TestDataSourceBasic2 extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
DruidDataSourceStatManager.cear();
|
||||
DruidDataSourceStatManager.clear();
|
||||
|
||||
DruidDataSource dataSource = new DruidDataSource();
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
|
||||
@@ -28,18 +28,18 @@ public class Demo1 extends TestCase {
|
||||
public void test_0() throws Exception {
|
||||
JdbcStatManager.getInstance().reset(); // 重置计数器
|
||||
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionstat().getConnectCount());
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionstat().getCloseCount());
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionStat().getConnectCount());
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionStat().getCloseCount());
|
||||
|
||||
String url = "jdbc:wrap-jdbc:filters=default:name=preCallTest:jdbc:derby:memory:Demo1;create=true";
|
||||
Connection conn = DriverManager.getConnection(url);
|
||||
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionstat().getConnectCount());
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionstat().getCloseCount());
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionStat().getConnectCount());
|
||||
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionStat().getCloseCount());
|
||||
|
||||
conn.close();
|
||||
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionstat().getConnectCount());
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionstat().getCloseCount());
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionStat().getConnectCount());
|
||||
Assert.assertEquals(1, JdbcStatManager.getInstance().getConnectionStat().getCloseCount());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MySqlResourceWallTest extends TestCase {
|
||||
provider.getConfig().setUseAllow(true);
|
||||
provider.getConfig().setStrictSyntaxCheck(false);
|
||||
provider.getConfig().setMultiStatementAllow(true);
|
||||
provider.getConfig().setConditionAndAlwayTrueAllow(true);
|
||||
provider.getConfig().setConditionAndAlwaysTrueAllow(true);
|
||||
provider.getConfig().setNoneBaseStatementAllow(true);
|
||||
provider.getConfig().setSelectUnionCheck(false);
|
||||
provider.getConfig().setSchemaCheck(true);
|
||||
|
||||
Reference in New Issue
Block a user