Search in sources :

Example 26 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentWindows method test_windows2000_IE6.

public void test_windows2000_IE6() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)");
    Assert.assertEquals(1, stat.getBrowserIECount());
    Assert.assertEquals(0, stat.getBrowserChromeCount());
    Assert.assertEquals(0, stat.getBrowserFirefoxCount());
    Assert.assertEquals(0, stat.getBrowserIE10Count());
    Assert.assertEquals(0, stat.getBrowserIE5Count());
    Assert.assertEquals(1, 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());
    Assert.assertEquals(0, stat.getOSWindows98Count());
    Assert.assertEquals(1, stat.getOSWindows2000Count());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 27 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentWindows method test_windows2000_IE5.

public void test_windows2000_IE5() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    Assert.assertEquals(1, stat.getBrowserIECount());
    Assert.assertEquals(0, stat.getBrowserChromeCount());
    Assert.assertEquals(0, stat.getBrowserFirefoxCount());
    Assert.assertEquals(0, stat.getBrowserIE10Count());
    Assert.assertEquals(1, stat.getBrowserIE5Count());
    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());
    Assert.assertEquals(0, stat.getOSWindows98Count());
    Assert.assertEquals(1, stat.getOSWindows2000Count());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 28 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentWindows method test_windows2000_firefox.

public void test_windows2000_firefox() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-CN; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)");
    Assert.assertEquals(0, stat.getBrowserIECount());
    Assert.assertEquals(0, stat.getBrowserChromeCount());
    Assert.assertEquals(1, stat.getBrowserFirefoxCount());
    Assert.assertEquals(0, stat.getBrowserIE10Count());
    Assert.assertEquals(0, stat.getBrowserIE5Count());
    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());
    Assert.assertEquals(0, stat.getOSWindows98Count());
    Assert.assertEquals(1, stat.getOSWindows2000Count());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 29 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentWindows method test_windows2000_IE8.

public void test_windows2000_IE8() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.0; Trident/4.0; 360SE)");
    Assert.assertEquals(1, stat.getBrowserIECount());
    Assert.assertEquals(0, stat.getBrowserChromeCount());
    Assert.assertEquals(0, stat.getBrowserFirefoxCount());
    Assert.assertEquals(0, stat.getBrowserIE10Count());
    Assert.assertEquals(0, stat.getBrowserIE5Count());
    Assert.assertEquals(0, stat.getBrowserIE6Count());
    Assert.assertEquals(0, stat.getBrowserIE7Count());
    Assert.assertEquals(1, 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());
    Assert.assertEquals(0, stat.getOSWindows98Count());
    Assert.assertEquals(1, stat.getOSWindows2000Count());
}
Also used : WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Example 30 with WebAppStat

use of com.alibaba.druid.support.http.stat.WebAppStat in project druid by alibaba.

the class UserAgentWindows method test_windows7_chrome.

public void test_windows7_chrome() throws Exception {
    WebAppStat stat = new WebAppStat("");
    stat.computeUserAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19");
    Assert.assertEquals(0, stat.getBrowserIECount());
    Assert.assertEquals(1, stat.getBrowserChromeCount());
    Assert.assertEquals(0, stat.getBrowserFirefoxCount());
    Assert.assertEquals(0, stat.getBrowserIE10Count());
    Assert.assertEquals(0, stat.getBrowserIE5Count());
    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());
    Assert.assertEquals(0, stat.getOSWindows98Count());
    Assert.assertEquals(1, stat.getOSWindows7Count());
}
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