Package org.archive.modules.fetcher

Examples of org.archive.modules.fetcher.DefaultServerCache


*
* @author gojomo
*/
public class ServerCacheTest extends TestCase {
    public void testHolds() throws Exception {
        DefaultServerCache servers = new DefaultServerCache();
        String serverKey = "www.example.com:9090";
        String hostKey = "www.example.com";
        servers.getServerFor(serverKey);
        servers.getHostFor(hostKey);
        assertTrue("cache lost server", servers.containsServer(serverKey));
        assertTrue("cache lost host", servers.containsHost(hostKey));
    }
View Full Code Here


        assertTrue("cache lost host", servers.containsHost(hostKey));
    }
   
    public void testCrawlURIKeys()
    throws Exception {
        DefaultServerCache servers = new DefaultServerCache();
        testHostServer(servers, "http://www.example.com");
        testHostServer(servers, "http://www.example.com:9090");
        testHostServer(servers, "dns://www.example.com:9090");
    }
View Full Code Here

        tmp = new File(tmp, "ARCWriterProcessTest");
        FileUtils.ensureWriteableDirectory(tmp);
       
        ARCWriterProcessor result = new ARCWriterProcessor();
        result.setDirectory(new ConfigPath("test",tmp.getAbsolutePath()));
        result.setServerCache(new DefaultServerCache());
        CrawlMetadata metadata = new CrawlMetadata();
        metadata.afterPropertiesSet();
        result.setMetadataProvider(metadata);
        result.start();
        return result;
View Full Code Here

        tmp = new File(tmp, name);
        FileUtils.ensureWriteableDirectory(tmp);

        WARCWriterProcessor result = new WARCWriterProcessor();
        result.setDirectory(new ConfigPath("test",tmp.getAbsolutePath()));
        result.setServerCache(new DefaultServerCache());
        CrawlMetadata metadata = new CrawlMetadata();
        metadata.afterPropertiesSet();
        result.setMetadataProvider(metadata);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.archive.modules.fetcher.DefaultServerCache

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.