use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentTest method test_iphone.
public void test_iphone() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)");
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(1, 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());
}
use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.
the class UserAgentAndroid_4_0_4_Test method test_mac_firefox.
public void test_mac_firefox() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19");
Assert.assertEquals(1, stat.getBrowserChromeCount());
Assert.assertEquals(0, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(0, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserIE10Count());
Assert.assertEquals(1, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(1, stat.getOSLinuxCount());
Assert.assertEquals(1, stat.getOSAndroidCount());
Assert.assertEquals(1, stat.getOSAndroid40Count());
Assert.assertEquals(0, stat.getOSLinuxUbuntuCount());
Assert.assertEquals(0, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSWindows8Count());
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 UserAgentAndroid_4_1_Test method test_mac_firefox.
public void test_mac_firefox() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19");
Assert.assertEquals(1, stat.getBrowserChromeCount());
Assert.assertEquals(0, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(0, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserIE10Count());
Assert.assertEquals(1, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(1, stat.getOSLinuxCount());
Assert.assertEquals(1, stat.getOSAndroidCount());
Assert.assertEquals(1, stat.getOSAndroid41Count());
Assert.assertEquals(0, stat.getOSLinuxUbuntuCount());
Assert.assertEquals(0, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSWindows8Count());
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 UserAgentAndroid_4_2_Test_2 method test_mac_firefox.
public void test_mac_firefox() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Linux; U; Android 4.2; en-us; Nexus 10 Build/JVP15I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30");
Assert.assertEquals(0, stat.getBrowserChromeCount());
Assert.assertEquals(0, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(0, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserIE10Count());
Assert.assertEquals(1, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(1, stat.getOSLinuxCount());
Assert.assertEquals(1, stat.getOSAndroidCount());
Assert.assertEquals(1, stat.getOSAndroid42Count());
Assert.assertEquals(0, stat.getOSLinuxUbuntuCount());
Assert.assertEquals(0, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSWindows8Count());
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 UserAgentAndroid_4_3_Test_2 method test_mac_firefox.
public void test_mac_firefox() throws Exception {
WebAppStat stat = new WebAppStat("");
stat.computeUserAgent("Mozilla/5.0 (Linux; U; Android 4.3; en-us; Nexus 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36");
Assert.assertEquals(1, stat.getBrowserChromeCount());
Assert.assertEquals(0, stat.getBrowserFirefoxCount());
Assert.assertEquals(0, stat.getBrowserOperaCount());
Assert.assertEquals(0, stat.getBrowserSafariCount());
Assert.assertEquals(0, stat.getBrowserIECount());
Assert.assertEquals(0, stat.getBrowserIE10Count());
Assert.assertEquals(1, stat.getDeviceAndroidCount());
Assert.assertEquals(0, stat.getDeviceIphoneCount());
Assert.assertEquals(0, stat.getDeviceWindowsPhoneCount());
Assert.assertEquals(1, stat.getOSLinuxCount());
Assert.assertEquals(1, stat.getOSAndroidCount());
Assert.assertEquals(1, stat.getOSAndroid43Count());
Assert.assertEquals(0, stat.getOSLinuxUbuntuCount());
Assert.assertEquals(0, stat.getOSMacOSXCount());
Assert.assertEquals(0, stat.getOSWindowsCount());
Assert.assertEquals(0, stat.getOSWindows8Count());
Assert.assertEquals(0, stat.getOSSymbianCount());
Assert.assertEquals(0, stat.getOSFreeBSDCount());
Assert.assertEquals(0, stat.getOSOpenBSDCount());
}
Aggregations