Examples of computeUserAgent()


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

public class UserAgentAndroid_4_0_3_Test_2 extends TestCase {

    public void test_mac_firefox() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile 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());
View Full Code Here

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

public class UserAgentBotStat extends TestCase {

    public void test_youdao() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotYoudaoCount());
    }
View Full Code Here

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

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

    public void test_bing() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotBingCount());
    }
View Full Code Here

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

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

    public void test_google() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotGoogleCount());
    }
View Full Code Here

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

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

    public void test_baidu() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotBaiduCount());
    }
View Full Code Here

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

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

    public void test_soso() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Sosospider+(+http://help.soso.com/webspider.htm)");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotSosoCount());
    }
View Full Code Here

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

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

    public void test_msn() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("msnbot/2.0b (+http://search.msn.com/msnbot.htm)._");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotMsnCount());
    }
View Full Code Here

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

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

    public void test_sogou() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)");

        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotSogouCount());
    }
   
View Full Code Here

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

        Assert.assertEquals(1, stat.getBotSogouCount());
    }
   
    public void test_yahoo() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)");
       
        Assert.assertEquals(1, stat.getBotCount());
        Assert.assertEquals(1, stat.getBotYahooCount());
    }
View Full Code Here

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

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

    public void test_unkownBot() throws Exception {
        WebAppStat stat = new WebAppStat("");
        stat.computeUserAgent("Mozilla/5.0 ()");

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

    public void test_unkownBot1() throws Exception {
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.