Search in sources :

Example 1 with WallProvider

use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.

the class WallStatTest_drop_table method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    provider.getConfig().setDropTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getDropCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Example 2 with WallProvider

use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.

the class WallStatTest_drop_table method testOracle.

public void testOracle() throws Exception {
    WallProvider provider = new OracleWallProvider();
    provider.getConfig().setDropTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getDropCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Example 3 with WallProvider

use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.

the class WallStatTest_insert method testMySql.

public void testMySql() throws Exception {
    WallProvider provider = new MySqlWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getInsertCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider)

Example 4 with WallProvider

use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.

the class WallStatTest_insert method testOracle.

public void testOracle() throws Exception {
    WallProvider provider = new OracleWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getInsertCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Example 5 with WallProvider

use of com.alibaba.druid.wall.WallProvider in project druid by alibaba.

the class WallStatTest_insert method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getInsertCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Aggregations

WallProvider (com.alibaba.druid.wall.WallProvider)195 MySqlWallProvider (com.alibaba.druid.wall.spi.MySqlWallProvider)182 SQLServerWallProvider (com.alibaba.druid.wall.spi.SQLServerWallProvider)47 WallTableStat (com.alibaba.druid.wall.WallTableStat)41 PGWallProvider (com.alibaba.druid.wall.spi.PGWallProvider)36 OracleWallProvider (com.alibaba.druid.wall.spi.OracleWallProvider)34 WallCheckResult (com.alibaba.druid.wall.WallCheckResult)3 Violation (com.alibaba.druid.wall.Violation)2 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)1 PGSQLStatementParser (com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser)1 PGSchemaStatVisitor (com.alibaba.druid.sql.dialect.postgresql.visitor.PGSchemaStatVisitor)1 WallConfig (com.alibaba.druid.wall.WallConfig)1 WallFunctionStat (com.alibaba.druid.wall.WallFunctionStat)1 Map (java.util.Map)1 Test (org.junit.Test)1