This commit is contained in:
温少
2012-03-16 15:21:28 +08:00
parent def6d64cc8
commit e6699763c6
3 changed files with 72 additions and 0 deletions
@@ -0,0 +1,24 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.filter.wall.WallUtils;
/**
* 这个场景,检测可疑的Having条件
* @author wenshao
*
*/
public class WallSelectWhereTest extends TestCase {
private String sql = "SELECT F1, F2 WHERE 1 = 1";
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql));
}
}
@@ -0,0 +1,24 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.filter.wall.WallUtils;
/**
* 这个场景,检测可疑的Having条件
* @author wenshao
*
*/
public class WallSelectWhereTest1 extends TestCase {
private String sql = "SELECT F1, F2 WHERE 1 = 1 OR FID = ?";
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql));
}
}
@@ -0,0 +1,24 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.filter.wall.WallUtils;
/**
* 这个场景,检测可疑的Having条件
* @author wenshao
*
*/
public class WallSelectWhereTest2 extends TestCase {
private String sql = "SELECT F1, F2 WHERE 1 = 1 AND FID = ?";
public void testMySql() throws Exception {
Assert.assertTrue(WallUtils.isValidateMySql(sql));
}
public void testORACLE() throws Exception {
Assert.assertTrue(WallUtils.isValidateOracle(sql));
}
}