Package com.googlecode.flaxcrawler.frontier

Source Code of com.googlecode.flaxcrawler.frontier.TestDefaultStatisticsService

package com.googlecode.flaxcrawler.frontier;

import com.googlecode.flaxcrawler.frontier.DefaultStatisticsService;
import com.sleepycat.je.DatabaseException;
import org.junit.Ignore;
import org.junit.Test;
import com.googlecode.flaxcrawler.model.CrawlerTask;
import static org.junit.Assert.*;

/**
*
* @author ameshkov
*/
public class TestDefaultStatisticsService {

    @Test
    @Ignore
    public void testAfterScheduling() throws DatabaseException {
        DefaultStatisticsService statisticsService = null;

        try {
            statisticsService = new DefaultStatisticsService("stats");


            CrawlerTask task = new CrawlerTask("http://google.com/", 1);
            statisticsService.afterScheduling(task);

            assertNotNull(statisticsService.getDomainStatistics("google.com"));
            assertTrue(statisticsService.isCrawled("http://google.com/"));
            assertTrue(statisticsService.getDomainStatistics("google.com").getScheduled() > 0);
        } finally {
            if (statisticsService != null) {
                statisticsService.dispose();
            }
        }
    }
}
TOP

Related Classes of com.googlecode.flaxcrawler.frontier.TestDefaultStatisticsService

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.