Search in sources :

Example 86 with WebAppStat

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

the class UserAgentBotStat method test_mahonie.

public void test_mahonie() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("mahonie, neofonie search:robot/search:robot/0.0.1 (This is the MIA Bot - crawling for mia research project. If you feel unhappy and do not want to be visited by our crawler send an email to spider@neofonie.de; http://spider.neofonie.de; spider@neofonie.de)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 87 with WebAppStat

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

the class UserAgentBotStat method test_unkownBot1.

public void test_unkownBot1() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; Mail.RU/2.0)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 88 with WebAppStat

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

the class UserAgentBotStat method test_Crawler.

public void test_Crawler() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; SISTRIX Crawler; http://crawler.sistrix.net/)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 89 with WebAppStat

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

the class UserAgentBotStat method test_unkownBot8.

public void test_unkownBot8() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("SkimBot/1.0 (www.skimlinks.com <dev@skimlinks.com>)");
    Assert.assertEquals(1, stat.getBotCount());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 90 with WebAppStat

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

the class UserAgentBotStat method test_youdao.

public void test_youdao() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )");
    Assert.assertEquals(1, stat.getBotCount());
    Assert.assertEquals(1, stat.getBotYoudaoCount());
}
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