use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest_sqlmap method test_false.
public void test_false() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setSchemaCheck(true);
Assert.assertFalse(//
provider.checkValid("SELECT email, passwd, login_id, full_name" + " FROM members" + " 'W'=UPPER(MID(@@version_compile_os,1,1))"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version"));
Assert.assertEquals(0, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true_1.
public void test_true_1() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version FROM DUAL"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest57 method test_true_2.
public void test_true_2() throws Exception {
WallProvider provider = new MySqlWallProvider();
Assert.assertTrue(//
provider.checkValid("SELECT @@version FROM X"));
Assert.assertEquals(1, provider.getTableStats().size());
}
use of com.alibaba.druid.wall.spi.MySqlWallProvider in project druid by alibaba.
the class MySqlWallTest58 method test_true.
public void test_true() throws Exception {
WallProvider provider = new MySqlWallProvider();
provider.getConfig().setSchemaCheck(false);
Assert.assertTrue(//
provider.checkValid(//
"SELECT COUNT(*) FROM information_schema.processlist " + //
"WHERE user <> 'replication' AND id <> CONNECTION_ID() " + "AND time > 60 AND command <> 'Sleep'"));
Assert.assertEquals(1, provider.getTableStats().size());
}
Aggregations