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

Examples of com.alibaba.druid.support.http.stat.WebAppStat.computeUserAgent()


        Assert.assertEquals(0, stat.getOSOpenBSDCount());
    }

    public void test_firefox_1() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.14) Gecko/20080409 Camino/1.6 (like Firefox/2.0.0.14)");
        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());
View Full Code Here


        Assert.assertEquals(0, stat.getOSOpenBSDCount());
    }

    public void test_firefox_2() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.11) Gecko/20080528 Epiphany/2.22 Firefox/3.0");
        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());
View Full Code Here

        Assert.assertEquals(0, stat.getOSOpenBSDCount());
    }

    public void test_firefox_3() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.14) Gecko/20080821 Firefox/2.0.0.14");
        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());
View Full Code Here

        Assert.assertEquals(1, stat.getOSOpenBSDCount());
    }

    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());
View Full Code Here

    }
   
    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());
View Full Code Here

public class UserAgentTest extends TestCase {

    public void test_agent_ie10() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)");
        Assert.assertEquals(1, stat.getBrowserIECount());
        Assert.assertEquals(1, stat.getBrowserIE10Count());
        Assert.assertEquals(1, stat.getOSWindowsCount());
    }
View Full Code Here

        Assert.assertEquals(1, stat.getOSWindowsCount());
    }

    public void test_agent_ie9() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)");
        Assert.assertEquals(1, stat.getBrowserIECount());
        Assert.assertEquals(1, stat.getBrowserIE9Count());
        Assert.assertEquals(1, stat.getOSWindowsCount());
    }
View Full Code Here

        Assert.assertEquals(1, stat.getOSWindowsCount());
    }

    public void test_agent_ie9_1() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; 360SE)");
        Assert.assertEquals(1, stat.getBrowserIECount());
        Assert.assertEquals(1, stat.getBrowserIE9Count());
        Assert.assertEquals(1, stat.getOSWindowsCount());
    }
View Full Code Here

        Assert.assertEquals(1, stat.getOSWindowsCount());
    }

    public void test_agent_ie9_x86() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
        Assert.assertEquals(1, stat.getBrowserIECount());
        Assert.assertEquals(1, stat.getBrowserIE9Count());
        Assert.assertEquals(1, stat.getOSWindowsCount());
    }
View Full Code Here

        Assert.assertEquals(1, stat.getOSWindowsCount());
    }

    public void test_agent_ie8() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; chromeframe; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MAXTHON 2.0)");
        Assert.assertEquals(1, stat.getBrowserIECount());
        Assert.assertEquals(1, stat.getBrowserIE8Count());
        Assert.assertEquals(1, stat.getOSWindowsCount());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.