Package com.alibaba.druid.support.http

Examples of com.alibaba.druid.support.http.WebStatFilter.doFilter()


        MockHttpServletResponse response = new MockHttpServletResponse();
        MockFilterChain chain = new MockFilterChain();

        Assert.assertNull(filter.getSessionStat(request));

        filter.doFilter(request, response, chain);

        Assert.assertEquals(0, appStat.getSessionStatDataList().size());

        filter.destroy();
       
View Full Code Here


                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_0);
                };
            };

            filter.doFilter(request, response, chain);

            Assert.assertEquals(1, appStat.getSessionStatDataList().size());
            Assert.assertEquals(1, appStat.getSessionStat(session_0.getId()).getRequestCount());
           
            Assert.assertTrue(appStat.getSessionStat(session_0.getId()).getLastAccessTimeMillis() > 0);
View Full Code Here

                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_0);
                };
            };
           
            filter.doFilter(request, response, chain);
           
            Assert.assertEquals(1, appStat.getSessionStatDataList().size());
            Assert.assertEquals(2, appStat.getSessionStat(session_0.getId()).getRequestCount());
        }
       
View Full Code Here

                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_1);
                };
            };

            filter.doFilter(request, response, chain);

            Assert.assertEquals(2, appStat.getSessionStatDataList().size());
            Assert.assertEquals(2, appStat.getSessionStat(session_0.getId()).getRequestCount());
            Assert.assertEquals(1, appStat.getSessionStat(session_1.getId()).getRequestCount());
        }
View Full Code Here

                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_2);
                };
            };
           
            filter.doFilter(request, response, chain);
           
            Assert.assertEquals(3, appStat.getSessionStatDataList().size());
            Assert.assertEquals(2, appStat.getSessionStat(session_0.getId()).getRequestCount());
            Assert.assertEquals(1, appStat.getSessionStat(session_1.getId()).getRequestCount());
            Assert.assertEquals(1, appStat.getSessionStat(session_2.getId()).getRequestCount());
View Full Code Here

                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_3);
                };
            };
           
            filter.doFilter(request, response, chain);
           
            Assert.assertEquals(3, appStat.getSessionStatDataList().size());
            Assert.assertNull(appStat.getSessionStat(session_0.getId()));
            Assert.assertEquals(1, appStat.getSessionStat(session_1.getId()).getRequestCount());
            Assert.assertEquals(1, appStat.getSessionStat(session_2.getId()).getRequestCount());
View Full Code Here

                public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
                    ((MockHttpServletRequest) request).setSession(session_4);
                };
            };
           
            filter.doFilter(request, response, chain);
           
            Assert.assertEquals(3, appStat.getSessionStatDataList().size());
            Assert.assertNull(appStat.getSessionStat(session_0.getId()));
            Assert.assertNull(appStat.getSessionStat(session_1.getId()));
            Assert.assertEquals(1, appStat.getSessionStat(session_2.getId()).getRequestCount());
View Full Code Here

        MockHttpServletResponse response = new MockHttpServletResponse();
        MockFilterChain chain = new MockFilterChain();

        Assert.assertNull(filter.getSessionStat(request));

        filter.doFilter(request, response, chain);

        Assert.assertEquals(0, appStat.getSessionStatDataList().size());

        filter.destroy();
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.