use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class DoPrivilegedTest method test_1.
public void test_1() throws Exception {
final WallConfig config = new WallConfig();
config.setDoPrivilegedAllow(true);
WallProvider.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
Assert.assertTrue(WallUtils.isValidateMySql("select @@version_compile_os FROM X", config));
return null;
}
});
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class IntersectTest method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setMinusAllow(false);
Assert.assertFalse(//
WallUtils.isValidateOracle("SELECT * FROM A MINUS SELECT * FROM B", //
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MinusTest method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setIntersectAllow(false);
Assert.assertFalse(//
WallUtils.isValidateOracle("SELECT * FROM A Intersect SELECT * FROM B", //
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class StrictSyntaxCheckTest method test_syntax_1.
public void test_syntax_1() throws Exception {
WallConfig config = new WallConfig();
config.setStrictSyntaxCheck(false);
Assert.assertTrue(//
WallUtils.isValidateMySql("SELECT SELECT", // 部分永真
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class BigSqlTest method test_true2.
public void test_true2() throws Exception {
String sql = "SELECT c from sbtest where id=0";
for (int i = 0; i < 10000; i++) {
sql += " and id=0";
}
WallConfig config = new WallConfig();
Assert.assertTrue(WallUtils.isValidateMySql(sql, config));
}
Aggregations