@Test
public void testFilterFail() throws Exception {

    checkFile();
    final SpringMvcSofaTracerFilter filter = new SpringMvcSofaTracerFilter();
    MockHttpServletRequest request = new MockHttpServletRequest();
    MockHttpServletResponse response = new MockHttpServletResponse();
    FilterChain mockFilterChain = new FilterChain() {
        public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse)
                                                                                            throws IOException,
                                                                                            ServletException {
            throw new RuntimeException("Has got exception...");
        }
        public void init(FilterConfig theConfig) {
        }
        public void destroy() {
        }
    };
    try {
        filter.doFilter(request, response, mockFilterChain);
    } catch (Exception e) {
        String message = e.getMessage();
        Assert.assertTrue(message.contains("Has got exception..."));
    }
    Thread.sleep(500);
    //wait for async output
    File file = new File(logDirectoryPath + File.separator + "tracer-self.log");
    if (file.exists()) {
        List<String> result = FileUtils.readLines(new File(logDirectoryPath + File.separator
                                                           + "tracer-self.log"));
        Assert.assertTrue(result.size() == 1);
    }
    Assert.assertTrue(!file.exists());
}