add Log4j2Filter. fixed issue #1300

This commit is contained in:
wenshao
2016-07-15 23:55:25 +08:00
parent 454b60938c
commit 6a1138f017
4 changed files with 1436 additions and 0 deletions
@@ -0,0 +1,40 @@
package com.alibaba.druid.bvt.filter.log;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import junit.framework.TestCase;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.util.JdbcUtils;
public class LogFilterTest5 extends TestCase {
private DruidDataSource dataSource;
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:derby:classpath:petstore-db");
dataSource.setFilters("log4j2");
}
public void test_select() throws Exception {
Connection conn = dataSource.getConnection();
PreparedStatement stmt = conn.prepareStatement("SELECT * FROM ITEM WHERE LISTPRICE > 10");
for (int i = 0; i < 10; ++i) {
ResultSet rs = stmt.executeQuery();
rs.close();
}
stmt.close();
conn.close();
}
protected void tearDown() throws Exception {
JdbcUtils.close(dataSource);
}
}
File diff suppressed because it is too large Load Diff