use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_ie9_1.
public void test_agent_ie9_1() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; 360SE)");
Assert.assertEquals(1, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getBrowserIE9Count());
Assert.assertEquals(1, stat.getOSWindowsCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_ie8_x2.
public void test_agent_ie8_x2() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/4.0 (compatible; GoogleToolbar 7.2.2427.2330; Windows XP 5.1; MSIE 8.0.6001.18702)");
Assert.assertEquals(1, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getBrowserIE8Count());
Assert.assertEquals(1, stat.getOSWindowsCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_android22.
public void test_agent_android22() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getOSLinuxCount());
Assert.assertEquals(1, stat.getOSAndroidCount());
Assert.assertEquals(1, stat.getDeviceAndroidCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_firefox_3.
public void test_firefox_3() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.14) Gecko/20080821 Firefox/2.0.0.14");
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserChromeCount());
Assert.assertEquals(1, 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(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(0, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSSymbianCount());
Assert.assertEquals(0, stat.getOSFreeBSDCount());
Assert.assertEquals(1, stat.getOSOpenBSDCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_opera_1.
public void test_opera_1() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.00");
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(1, 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());
Assert.assertEquals(0, stat.getOSAndroidCount());
Assert.assertEquals(0, stat.getOSAndroid21Count());
}
Aggregations