mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add slf4j logging testcase
This commit is contained in:
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.alibaba.druid.DruidRuntimeException;
|
||||
import com.alibaba.druid.filter.FilterAdapter;
|
||||
import com.alibaba.druid.filter.FilterChain;
|
||||
import com.alibaba.druid.proxy.jdbc.CallableStatementProxy;
|
||||
@@ -159,12 +158,6 @@ public class WallFilter extends FilterAdapter implements WallFilterMBean {
|
||||
return inited;
|
||||
}
|
||||
|
||||
public void checkInit() {
|
||||
if (inited) {
|
||||
throw new DruidRuntimeException("wall filter is inited");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void statement_addBatch(FilterChain chain, StatementProxy statement, String sql) throws SQLException {
|
||||
createWallContext(statement);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.alibaba.druid.bvt.support.logging;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.support.logging.SLF4JImpl;
|
||||
|
||||
public class SLF4JImplTest extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
SLF4JImpl impl = new SLF4JImpl(DruidDataSource.class.getName());
|
||||
|
||||
impl.isDebugEnabled();
|
||||
impl.isInfoEnabled();
|
||||
impl.isWarnEnabled();
|
||||
impl.debug("");
|
||||
impl.debug("", new Exception());
|
||||
impl.info("");
|
||||
impl.warn("");
|
||||
impl.warn("", new Exception());
|
||||
impl.error("");
|
||||
impl.error("", new Exception());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user