Package com.alibaba.druid.wall.spi

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider


        Assert.assertEquals(0, provider.getTableStats().size());
    }
   
    public void test_true_1() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
                "SELECT USER() FROM DUAL"));
       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here


       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
   
    public void test_true_2() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
                "SELECT USER() FROM X"));
       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
   
    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
                "select * from t where fid = 1 union SELECT USER() FROM X"));
       
    }
View Full Code Here

* @see
*/
public class MySqlWallTest87 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
        "CREATE VIEW test.v AS SELECT * FROM t;"));

        Assert.assertEquals(1, provider.getTableStats().size());
        Assert.assertTrue(provider.getTableStats().containsKey("t"));
    }
View Full Code Here

import com.alibaba.druid.wall.spi.MySqlWallProvider;

public class MySqlWallTest120 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setCommentAllow(false);

        String sql = "SELECT name, '******' password, createTime from user where name like 'admin%' AND SLEEP(5) AND '%'=''";

        Assert.assertFalse(provider.checkValid(sql));
    }
View Full Code Here

* @see
*/
public class MySqlWallTest85 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
        "CREATE TABLE lookup (id INT) ENGINE = MEMORY;"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

* @see
*/
public class MySqlWallTest45 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();

        Assert.assertTrue(provider.checkValid(//
        "SELECT @1119453529t_processID, @1119453529t_ret"));

        Assert.assertEquals(0, provider.getTableStats().size());
    }
View Full Code Here

* @see
*/
public class MySqlWallTest79 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
        "SELECT * FROM T WHERE FID = ? OR LEAST(2,1,9,8) = 1"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

* @see
*/
public class MySqlWallTest46 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();

        Assert.assertTrue(provider.checkValid(//
        "select aid,subject,dateline from www_subject where subject like '%%' order by aid desc limit 30;"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

* @see
*/
public class MySqlWallTest40 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setUseAllow(false);

        Assert.assertFalse(provider.checkValid(//
        "use huaianapp")); //

        Assert.assertEquals(0, provider.getTableStats().size());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.wall.spi.MySqlWallProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.