Package com.alibaba.druid.wall

Examples of com.alibaba.druid.wall.WallProvider.checkValid()


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

        Assert.assertTrue(provider.checkValid(//
        "select * from t limit 0,0"));

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


    }
   
    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
                "select * from t limit 0,0"));
       
        Assert.assertEquals(1, provider.getTableStats().size());
    }
}
View Full Code Here

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

        Assert.assertTrue(provider.checkValid(//
        "SELECT *FROM T UNION select `ENGINE`, `SUPPORT` from information_schema.Engines"));

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

    }
   
    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
                "SELECT *FROM T UNION select `ENGINE`, `SUPPORT` from information_schema.Engines"));
       
        Assert.assertEquals(2, provider.getTableStats().size());
    }
}
View Full Code Here

        WallContext.clearContext();
    }

    public void testMySql() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        Assert.assertTrue(provider.checkValid(sql));

        {
            WallTableStat tableStat = provider.getTableStat("t");
            Assert.assertEquals(1, tableStat.getSelectCount());
            Assert.assertEquals(0, tableStat.getSelectIntoCount());
View Full Code Here

        }
    }

    public void testOracle() throws Exception {
        WallProvider provider = new OracleWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat = provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }

    public void testPG() throws Exception {
View Full Code Here

        Assert.assertEquals(1, tableStat.getSelectCount());
    }

    public void testPG() throws Exception {
        WallProvider provider = new PGWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat = provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }

    public void testSQLServer() throws Exception {
View Full Code Here

        Assert.assertEquals(1, tableStat.getSelectCount());
    }

    public void testSQLServer() throws Exception {
        WallProvider provider = new SQLServerWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat = provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }

}
View Full Code Here

                     + "where not exists   ("//
                     + "    select EMAIL" //
                     + "    from T01_CHECKIN_CUSTOMER" //
                     + "    where WEB_USER_ID=2 and EMAIL='1223@123.com'" //
                     + ")";
        Assert.assertTrue(provider.checkValid(sql));
    }

}
View Full Code Here

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

        provider.getConfig().setCommentAllow(true);

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

        Assert.assertEquals(1, provider.getTableStats().size());
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.