Search in sources :

Example 66 with WebAppStat

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());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 67 with WebAppStat

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());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 68 with WebAppStat

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());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 69 with WebAppStat

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());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 70 with WebAppStat

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());
}
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