Package com.alibaba.druid.support.http.stat

Examples of com.alibaba.druid.support.http.stat.WebAppStat


       
        Assert.assertEquals(1, stat.getBotCount());
    }
   
    public void test_aiHitBot() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; aiHitBot/1.1; +http://www.aihit.com/)");
       
        Assert.assertEquals(1, stat.getBotCount());
    }
View Full Code Here


       
        Assert.assertEquals(1, stat.getBotCount());
    }
   
    public void test_DoCoMo() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("DoCoMo/2.0 P900i(c100;TB;W24H11) (compatible; ichiro/mobile goo; +http://search.goo.ne.jp/option/use/sub4/sub4-1/)");
       
        Assert.assertEquals(1, stat.getBotCount());
    }
View Full Code Here

import com.alibaba.druid.support.http.stat.WebAppStat;

public class UserAgentWindows extends TestCase {

    public void test_windows98() throws Exception {
        WebAppStat stat = new WebAppStat("");

        stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)");
        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(1, stat.getOSWindows98Count());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }
   
    public void test_windowsXP_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(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.getOSWindowsXPCount());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }

    public void test_windowsXP_IE7() throws Exception {
        WebAppStat stat = new WebAppStat("");
       
        stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) ; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) (none))");
        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(1, 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.getOSWindowsXPCount());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }
   
    public void test_windowsXP_IE8() throws Exception {
        WebAppStat stat = new WebAppStat("");
       
        stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)");
        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.getOSWindowsXPCount());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }
   
    public void test_windowsXP_IE9() throws Exception {
        WebAppStat stat = new WebAppStat("");
       
        stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; WOW64; Trident/4.0)");
        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(0, stat.getBrowserIE8Count());
        Assert.assertEquals(1, 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.getOSWindowsXPCount());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }
   
    public void test_windowsXP_firefox() throws Exception {
        WebAppStat stat = new WebAppStat("");
       
        stat.computeUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
        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.getOSWindowsXPCount());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindowsXPCount());
    }
   
    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());
    }
View Full Code Here

        Assert.assertEquals(0, stat.getOSWindows98Count());
        Assert.assertEquals(1, stat.getOSWindows2000Count());
    }
   
    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());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.support.http.stat.WebAppStat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.