@Test public void testParsing() { CachingFilter filter = new CachingFilter() { protected CacheManager getCacheManager() { return null; } protected String calculateKey(HttpServletRequest httpRequest) { return null; } }; assertNull(filter.parseBlockingCacheTimeoutMillis(new FilterConfig() { public String getFilterName() { return null; } public ServletContext getServletContext() { return null; } public String getInitParameter(String name) { return null; } public Enumeration getInitParameterNames() { return null; } })); assertNull(filter.parseBlockingCacheTimeoutMillis(new FilterConfig() { public String getFilterName() { return null; } public ServletContext getServletContext() { return null; } public String getInitParameter(String name) { return "sdfsd"; } public Enumeration getInitParameterNames() { return null; } })); assertNull(filter.parseBlockingCacheTimeoutMillis(new FilterConfig() { public String getFilterName() { return null; } public ServletContext getServletContext() { return null; } public String getInitParameter(String name) { return "10L"; } public Enumeration getInitParameterNames() { return null; } })); assertEquals(1000, filter.parseBlockingCacheTimeoutMillis(new FilterConfig() { public String getFilterName() { return null; } public ServletContext getServletContext() { return null; } public String getInitParameter(String name) { return "1000"; } public Enumeration getInitParameterNames() { return null; } })); assertEquals(120000, filter.parseBlockingCacheTimeoutMillis(new FilterConfig() { public String getFilterName() { return null; } public ServletContext getServletContext() { return null; } public String getInitParameter(String name) { return "120000"; } public Enumeration getInitParameterNames() { return null; } })); }
Integer parseBlockingCacheTimeoutMillis(FilterConfig filterConfig) { String timeout = filterConfig.getInitParameter(BLOCKING_TIMEOUT_MILLIS); try { return Integer.parseInt(timeout); } catch (NumberFormatException e) { return null; } }
CachingFilter extends Filter { Integer parseBlockingCacheTimeoutMillis(FilterConfig filterConfig) { String timeout = filterConfig.getInitParameter(BLOCKING_TIMEOUT_MILLIS); try { return Integer.parseInt(timeout); } catch (NumberFormatException e) { return null; } } }
CachingFilter extends Filter { Integer parseBlockingCacheTimeoutMillis(FilterConfig filterConfig) { String timeout = filterConfig.getInitParameter(BLOCKING_TIMEOUT_MILLIS); try { return Integer.parseInt(timeout); } catch (NumberFormatException e) { return null; } }  }
CachingFilter extends Filter { Integer parseBlockingCacheTimeoutMillis(FilterConfig filterConfig) { String timeout = filterConfig.getInitParameter(BLOCKING_TIMEOUT_MILLIS); try { return Integer.parseInt(timeout); } catch (NumberFormatException e) { return null; } }  void doInit(FilterConfig filterConfig); }
CachingFilter extends Filter { Integer parseBlockingCacheTimeoutMillis(FilterConfig filterConfig) { String timeout = filterConfig.getInitParameter(BLOCKING_TIMEOUT_MILLIS); try { return Integer.parseInt(timeout); } catch (NumberFormatException e) { return null; } }  void doInit(FilterConfig filterConfig);  }