Package com.alibaba.druid.wall

Examples of com.alibaba.druid.wall.WallProvider$WallCommentHandler


* @see
*/
public class SQLServerWallTest_8 extends TestCase {

    public void test_true() throws Exception {
        WallProvider provider = new SQLServerWallProvider();

        provider.getConfig().setMustParameterized(true);

        Assert.assertFalse(provider.checkValid("select * from t where fid = 1"));

    }
View Full Code Here


* @see
*/
public class MySqlWallTest80 extends TestCase {

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

        Assert.assertTrue(provider.checkValid(//
        "SELECT * FROM T WHERE FID = ? OR FID LIKE 1"));

        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();

        provider.getConfig().setCommentAllow(true);

        Assert.assertTrue(provider.checkValid(//
        "SELECT * FROM T WHERE FID = ? OR FID LIKE 1 --"));

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

* @see
*/
public class MySqlWallTest72 extends TestCase {

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

        Assert.assertFalse(provider.checkValid(//
        "select * from t /**/ where fid = 123 AND 1=1"));

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

* @see
*/
public class SQLServerWallTest_5 extends TestCase {

    public void test_true() throws Exception {
        WallProvider provider = new SQLServerWallProvider();

        provider.getConfig().setSelectHavingAlwayTrueCheck(true);

        Assert.assertFalse(provider.checkValid(//
        "delete t where LEN(HOST_NAME()) > 0"));

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

* @see
*/
public class MySqlWallTest48 extends TestCase {

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

        Assert.assertTrue(provider.checkValid(//
        "select sum(size) as total " + //
                "from file " + //
                "join file_to_post on file_to_post.file_id = file.id " + //
                "join notice on file_to_post.post_id = notice.id " + //
                "where profile_id = 18544 and file.url like '%/notice/%/file' AND EXTRACT(month FROM file.modified) = EXTRACT(month FROM now()) and EXTRACT(year FROM file.modified) = EXTRACT(year FROM now())"));

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

* @see
*/
public class MySqlWallTest83 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertTrue(provider.checkValid(//
        "alter table rms.rms_Person_Event drop foreign key FKA382487726D72F65"));

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

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

public class MySqlWallTest136 extends TestCase {

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

        Assert.assertFalse(provider.checkValid("SELECT * FROM Users WHERE id = '1' AND MID(@@VERSION,1,1) = '5';"));
    }
View Full Code Here

* @see
*/
public class MySqlWallTest68 extends TestCase {

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

        Assert.assertTrue(provider.checkValid(//
        "SELECT * FROM `information_schema`.`ROUTINES` " + //
                "WHERE `information_schema`.`ROUTINES`.`ROUTINE_SCHEMA` = 'mzsg_g001'"));

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

* @see
*/
public class MySqlWallTest41 extends TestCase {

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

        Assert.assertFalse(provider.checkValid(//
        "SELECT * FROM pw_pushdata WHERE invokepieceid= '49'  AND ifverify=0 AND starttime<= '1364976942'  ORDER BY vieworder DESC,starttime DESC  LIMIT 0")); //

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

TOP

Related Classes of com.alibaba.druid.wall.WallProvider$WallCommentHandler

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.