use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class WallStatTest_delete method testMySql.
public void testMySql() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getDeleteCount());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class WallStatTest_drop_table method testMySql.
public void testMySql() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setDropTableAllow(true);
Assert.assertTrue(provider.checkValid(sql));
WallTableStat tableStat = provider.getTableStat("t");
Assert.assertEquals(1, tableStat.getDropCount());
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest145 method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
String sql = "SHOW FULL TABLES WHERE Table_type != 'VIEW'";
Assert.assertTrue(provider.checkValid(sql));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest35 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid(//
"REPLACE INTO `test2tb` VALUES " + //
"('51', '6714105741', '亦美珊不掉正品隐形文胸安全硅胶文胸 小胸聚拢比基尼<span class=H>游泳</span>衣泳装', 'http://img03.taobaocdn.com/bao/uploaded/i3/16011019585534199/T1cnlaXA8bXXXXXXXX_!!0-item_pic.jpg', 'liqiang198163', 'c', '25.00', '20.00', '1000.00', '76', '529', '4.86', '4.91', '4.90', '0.00', '4.80', '2878', '77', '12', '15');"));
Assert.assertEquals(1, provider.getTableStat("test2tb").getReplaceCount());
System.out.println(JSONUtils.toJSONString(provider.getStatsMap()));
}
use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.
the class MySqlWallTest37 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid(//
"call partnerAttribute(3061975048797781,105385028,5,@ret)"));
Assert.assertEquals(0, provider.getTableStats().size());
System.out.println(JSONUtils.toJSONString(provider.getStatsMap()));
}
Aggregations