Package org.archive.modules.canonicalize

Examples of org.archive.modules.canonicalize.StripUserinfoRule


public class StripUserinfoRuleTest extends ModuleTestBase {

    public void testCanonicalize() throws URIException {
        String url = "http://WWW.aRchive.Org/index.html";
        final String expectedResult = url;
        String result = (new StripUserinfoRule()).
            canonicalize(url);
        assertTrue("Mangled no userinfo " + result,
            url.equals(result));
        url = "http://stack:password@WWW.aRchive.Org/index.html";
        result = (new StripUserinfoRule()).
            canonicalize(url);
        assertTrue("Didn't strip userinfo " + result,
            expectedResult.equals(result));
        url = "http://stack:pass@@@@@@word@WWW.aRchive.Org/index.html";
        result = (new StripUserinfoRule()).
            canonicalize(url);
        assertTrue("Didn't get to last @ " + result,
            expectedResult.equals(result));
        url = "ftp://stack:pass@@@@@@word@archive.org/index.html";
        result = (new StripUserinfoRule()).
            canonicalize(url);
        assertTrue("Didn't get to last @ " + result,
            "ftp://archive.org/index.html".equals(result));
    }
View Full Code Here

TOP

Related Classes of org.archive.modules.canonicalize.StripUserinfoRule

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.