Search in sources :

Example 56 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentBotStat method test_baidu.

public void test_baidu() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
    Assert.assertEquals(1, stat.getBotCount());
    Assert.assertEquals(1, stat.getBotBaiduCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 57 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentBotStat method test_Updownerbot.

public void test_Updownerbot() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Updownerbot (+http://www.updowner.com/bot)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 58 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentBotStat method test_Ezooms.

public void test_Ezooms() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 59 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentBotStat method test_yodao.

public void test_yodao() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 60 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentBotStat method test_unkownBot6.

public void test_unkownBot6() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Aggregations

WebAppStat (com.alibaba.druid.support.http.stat.WebAppStat)113 WebStatFilter (com.alibaba.druid.support.http.WebStatFilter)3 MockFilterChain (org.springframework.mock.web.MockFilterChain)3 MockFilterConfig (org.springframework.mock.web.MockFilterConfig)3 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)3 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)3 MockServletContext (org.springframework.mock.web.MockServletContext)3 WebAppStatValue (com.alibaba.druid.support.http.stat.WebAppStatValue)1 WebRequestStat (com.alibaba.druid.support.http.stat.WebRequestStat)1 WebSessionStat (com.alibaba.druid.support.http.stat.WebSessionStat)1 WebURIStat (com.alibaba.druid.support.http.stat.WebURIStat)1 WebURIStatValue (com.alibaba.druid.support.http.stat.WebURIStatValue)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 MockHttpSession (org.springframework.mock.web.MockHttpSession)1