use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallConfigTest method test_insertAllow_false.
public void test_insertAllow_false() throws Exception {
Properties properties = new Properties();
properties.setProperty("druid.wall.insertAllow", "false");
WallConfig config = new WallConfig();
config.configFromProperties(properties);
Assert.assertFalse(config.isInsertAllow());
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallDeleteWhereTest1 method testORACLE_false.
public void testORACLE_false() throws Exception {
WallConfig config = new WallConfig();
config.setDeleteWhereNoneCheck(true);
Assert.assertFalse(WallUtils.isValidateOracle(sql, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallDropTest method testMySql.
public void testMySql() throws Exception {
WallConfig config = new WallConfig();
config.setDropTableAllow(false);
Assert.assertFalse(WallUtils.isValidateMySql("DROP TABLE T1", config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MySqlWallTest25 method test_false.
public void test_false() throws Exception {
WallConfig config = new WallConfig();
config.setUpdateWhereNoneCheck(true);
Assert.assertFalse(//
WallUtils.isValidateMySql("update test.dml_health_check set id=?", //
config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallUnionTest method testMySql.
public void testMySql() throws Exception {
WallConfig config = new WallConfig();
config.setSelectUnionCheck(true);
Assert.assertTrue(WallUtils.isValidateMySql("select f1, f2 from t where f1=1 union select 1, 2", config));
Assert.assertFalse(WallUtils.isValidateMySql("select f1, f2 from t where f1=1 union select 1, 2 --", config));
}
Aggregations