loadFilterConfig's source add classloader which loaded FilterManager self.

This commit is contained in:
weipeng2k
2015-01-29 10:24:24 +08:00
parent 31246e2cd3
commit 365ec24039
2 changed files with 13 additions and 0 deletions
@@ -13,6 +13,17 @@ import com.alibaba.druid.filter.FilterManager;
public class FilterManagerTest extends TestCase {
static {
ClassLoader current = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(null);
Assert.assertNotNull(FilterManager.getFilter("stat"));
} finally {
Thread.currentThread().setContextClassLoader(current);
}
}
public void test_instance() throws Exception {
new FilterManager();
}
@@ -38,6 +49,7 @@ public class FilterManagerTest extends TestCase {
}
Assert.assertNotNull(error);
}
public static class ErrorFilter extends FilterAdapter {