use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallUpdateTest2 method testMySql_true.
public void testMySql_true() throws Exception {
WallConfig config = new WallConfig();
Assert.assertTrue(WallUtils.isValidateMySql(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallUpdateTest2 method testORACLE_true.
public void testORACLE_true() throws Exception {
WallConfig config = new WallConfig();
Assert.assertTrue(WallUtils.isValidateOracle(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MySqlWallDescribteTest method test_not_allow.
public void test_not_allow() throws Exception {
WallConfig config = new WallConfig();
config.setDescribeAllow(false);
Assert.assertFalse(WallUtils.isValidateMySql("describe t", config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MySqlWallTest_hint method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setHintAllow(false);
String sql = "select * from person where id = '3'/**/union select 0,1,v from (select 1,2,user/*!() as v*/) a where '1'<>''";
//
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MySqlWallTest_hint method test_true_10.
public void test_true_10() throws Exception {
WallConfig config = new WallConfig();
config.setHintAllow(true);
config.setMultiStatementAllow(true);
config.setNoneBaseStatementAllow(true);
String sql = "CREATE DATABASE `newsfocus` /*!40100 COLLATE 'big5_chinese_ci' */ ";
//
Assert.assertTrue(WallUtils.isValidateMySql(sql, config));
}
Aggregations