use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentBotStat method test_bing.
public void test_bing() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)");
Assert.assertEquals(1, stat.getBotCount());
Assert.assertEquals(1, stat.getBotBingCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentBotStat method test_yahoo.
public void test_yahoo() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)");
Assert.assertEquals(1, stat.getBotCount());
Assert.assertEquals(1, stat.getBotYahooCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentMacTest method test_mac_firefox.
public void test_mac_firefox() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6");
Assert.assertEquals(0, stat.getBrowserChromeCount());
Assert.assertEquals(1, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(0, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIpadCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(0, stat.getOSLinuxCount());
Assert.assertEquals(0, stat.getOSLinuxUbuntuCount());
Assert.assertEquals(1, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSSymbianCount());
Assert.assertEquals(0, stat.getOSFreeBSDCount());
Assert.assertEquals(0, stat.getOSOpenBSDCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_other.
public void test_agent_other() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("SEC-schx199 UP.Browser/4.1.26l UP.Link/5.1.2.9");
Assert.assertEquals(0, stat.getBrowserIECount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_3.
public void test_3() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)");
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserChromeCount());
Assert.assertEquals(0, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserIE10Count());
Assert.assertEquals(0, stat.getBrowserIE6Count());
Assert.assertEquals(0, stat.getBrowserIE7Count());
Assert.assertEquals(0, stat.getBrowserIE8Count());
Assert.assertEquals(0, stat.getBrowserIE9Count());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(1, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIpadCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(0, stat.getOSLinuxCount());
Assert.assertEquals(0, stat.getOSMacOSXCount());
Assert.assertEquals(1, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSSymbianCount());
Assert.assertEquals(0, stat.getOSFreeBSDCount());
Assert.assertEquals(0, stat.getOSOpenBSDCount());
}
Aggregations