This commit is contained in:
温少
2012-03-22 18:51:24 +08:00
parent 019f54ab8f
commit 5fb4e0bcb0
16 changed files with 117 additions and 25 deletions
@@ -0,0 +1,28 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.wall.WallConfig;
import com.alibaba.druid.wall.WallUtils;
public class MustParameterizedTest2 extends TestCase {
private String sql = "select * from t where id in (3, 5)";
private WallConfig config = new WallConfig();
protected void setUp() throws Exception {
config.setMustParameterized(true);
}
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql, config));
}
}
@@ -0,0 +1,28 @@
package com.alibaba.druid.bvt.filter.wall;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.wall.WallConfig;
import com.alibaba.druid.wall.WallUtils;
public class MustParameterizedTest3 extends TestCase {
private String sql = "select * from t where id not in (3, 5)";
private WallConfig config = new WallConfig();
protected void setUp() throws Exception {
config.setMustParameterized(true);
}
public void testMySql() throws Exception {
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
public void testORACLE() throws Exception {
Assert.assertFalse(WallUtils.isValidateOracle(sql, config));
}
}