use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_ie6_1.
public void test_agent_ie6_1() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
Assert.assertEquals(1, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getBrowserIE6Count());
Assert.assertEquals(1, stat.getOSWindowsCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_opera.
public void test_opera() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Opera/9.00 (Windows NT 4.0; U; en)");
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(0, stat.getOSMacOSXCount());
Assert.assertEquals(1, 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());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_opera.
public void test_agent_opera() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Opera/9.64 (Windows NT 5.1; U; en) Presto/2.1.1");
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getOSWindowsCount());
Assert.assertEquals(1, stat.getBrowserOperaCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_agent_chrome.
public void test_agent_chrome() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16");
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(1, stat.getBrowserChromeCount());
Assert.assertEquals(1, stat.getOSWindowsCount());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_firefox_4.
public void test_firefox_4() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20041002 Firefox/0.10.1");
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(1, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSSymbianCount());
Assert.assertEquals(0, stat.getOSFreeBSDCount());
Assert.assertEquals(0, stat.getOSOpenBSDCount());
}
Aggregations