Examples of WallTableStat


Examples of com.alibaba.druid.wall.WallTableStat

    }

    public void testMySql() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat = provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

    }

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

Examples of com.alibaba.druid.wall.WallTableStat

    }

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

Examples of com.alibaba.druid.wall.WallTableStat

    }

    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

Examples of com.alibaba.druid.wall.WallTableStat

        provider.getConfig().setStrictSyntaxCheck(false);

        String sql = "select xx * x *";
        Assert.assertTrue(provider.checkValid(sql));
        {
            WallTableStat tableStat = provider.getTableStat("t");
            Assert.assertEquals(0, tableStat.getSelectCount());
            Assert.assertEquals(0, provider.getBlackListHitCount());
            Assert.assertEquals(0, provider.getWhiteListHitCount());
            Assert.assertEquals(0, provider.getWhiteList().size());
            Assert.assertEquals(0, provider.getBlackList().size());
            Assert.assertEquals(1, provider.getCheckCount());
            Assert.assertEquals(1, provider.getSyntaxErrorCount());
            Assert.assertEquals(1, provider.getHardCheckCount());
        }
       
        Assert.assertTrue(provider.checkValid(sql));
        {
            WallTableStat tableStat = provider.getTableStat("t");
            Assert.assertEquals(0, tableStat.getSelectCount());
            Assert.assertEquals(0, provider.getBlackListHitCount());
            Assert.assertEquals(0, provider.getWhiteListHitCount());
            Assert.assertEquals(0, provider.getWhiteList().size());
            Assert.assertEquals(0, provider.getBlackList().size());
            Assert.assertEquals(2, provider.getCheckCount());
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

        String sql = "alter table t add column fname varchar(50)";
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setAlterTableAllow(true);
       
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat =  provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getAlterCount());
    }
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

        String sql = "alter table t add (fname varchar(50))";
        WallProvider provider = new OracleWallProvider();
        provider.getConfig().setAlterTableAllow(true);
       
        Assert.assertTrue(provider.checkValid(sql));
        WallTableStat tableStat =  provider.getTableStat("t");
        Assert.assertEquals(1, tableStat.getAlterCount());
    }
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

        WallProvider provider = new MySqlWallProvider();
        for (int i = 0; i < 10; ++i) {
            Assert.assertFalse(provider.checkValid(sql));
        }

        WallTableStat tableStat = provider.getTableStat("t");
        Assert.assertEquals(10, tableStat.getSelectCount());
        Assert.assertEquals(0, provider.getWhiteListHitCount());
        Assert.assertEquals(9, provider.getBlackListHitCount());
    }
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

    public void testMySql() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        {
            WallTableStat tableStat = provider.getTableStat("lhwbbs_posts_reply");
            Assert.assertEquals(1, tableStat.getSelectCount());
        }
        {
            WallTableStat tableStat = provider.getTableStat("lhwbbs_posts");
            Assert.assertEquals(1, tableStat.getSelectCount());
        }
    }
View Full Code Here

Examples of com.alibaba.druid.wall.WallTableStat

    public void testOracle() throws Exception {
        WallProvider provider = new OracleWallProvider();
        Assert.assertTrue(provider.checkValid(sql));
        {
            WallTableStat tableStat = provider.getTableStat("lhwbbs_posts_reply");
            Assert.assertEquals(1, tableStat.getSelectCount());
        }
        {
            WallTableStat tableStat = provider.getTableStat("lhwbbs_posts");
            Assert.assertEquals(1, tableStat.getSelectCount());
        }
    }
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.