Search in sources :

Example 46 with WebAppStat

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

the class UserAgentBotStat method test_msn.

public void test_msn() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("msnbot/2.0b (+http://search.msn.com/msnbot.htm)._");
    Assert.assertEquals(1, stat.getBotCount());
    Assert.assertEquals(1, stat.getBotMsnCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 47 with WebAppStat

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

the class UserAgentBotStat method test_google.

public void test_google() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
    Assert.assertEquals(1, stat.getBotCount());
    Assert.assertEquals(1, stat.getBotGoogleCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 48 with WebAppStat

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

the class UserAgentBotStat method test_huawei.

public void test_huawei() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("HuaweiSymantecSpider/1.0+DSE-support@huaweisymantec.com+(compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR ; http://www.huaweisymantec.com/en/IRL/spider)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 49 with WebAppStat

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

the class UserAgentBotStat method test_aiHitBot.

public void test_aiHitBot() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; aiHitBot/1.1; +http://www.aihit.com/)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 50 with WebAppStat

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

the class UserAgentBotStat method test_AhrefsBot.

public void test_AhrefsBot() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; AhrefsBot/3.0; +http://ahrefs.com/robot/)");
    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