Return-Path: X-Original-To: apmail-incubator-any23-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-any23-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C309C91B for ; Fri, 11 May 2012 22:29:45 +0000 (UTC) Received: (qmail 30363 invoked by uid 500); 11 May 2012 22:29:45 -0000 Delivered-To: apmail-incubator-any23-commits-archive@incubator.apache.org Received: (qmail 30320 invoked by uid 500); 11 May 2012 22:29:45 -0000 Mailing-List: contact any23-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: any23-dev@incubator.apache.org Delivered-To: mailing list any23-commits@incubator.apache.org Received: (qmail 30307 invoked by uid 99); 11 May 2012 22:29:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 22:29:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 22:29:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A0EC823888EA; Fri, 11 May 2012 22:29:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1337401 - in /incubator/any23/trunk/plugins/basic-crawler/src/test: java/org/apache/any23/cli/CrawlerTest.java java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java resources/ resources/log4j.properties Date: Fri, 11 May 2012 22:29:23 -0000 To: any23-commits@incubator.apache.org From: lewismc@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120511222923.A0EC823888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lewismc Date: Fri May 11 22:29:23 2012 New Revision: 1337401 URL: http://svn.apache.org/viewvc?rev=1337401&view=rev Log: commit to address ANY23-86. Added: incubator/any23/trunk/plugins/basic-crawler/src/test/resources/ incubator/any23/trunk/plugins/basic-crawler/src/test/resources/log4j.properties Modified: incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java Modified: incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java URL: http://svn.apache.org/viewvc/incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java?rev=1337401&r1=1337400&r2=1337401&view=diff ============================================================================== --- incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java (original) +++ incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/cli/CrawlerTest.java Fri May 11 22:29:23 2012 @@ -51,7 +51,7 @@ public class CrawlerTest extends Any23On final File outFile = File.createTempFile("crawler-test", ".nq"); outFile.delete(); - logger.debug( "Outfile: " + outFile.getAbsolutePath() ); + logger.info( "Outfile: " + outFile.getAbsolutePath() ); final Future future = Executors.newSingleThreadExecutor().submit( new Runnable() { Modified: incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java URL: http://svn.apache.org/viewvc/incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java?rev=1337401&r1=1337400&r2=1337401&view=diff ============================================================================== --- incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java (original) +++ incubator/any23/trunk/plugins/basic-crawler/src/test/java/org/apache/any23/plugin/crawler/SiteCrawlerTest.java Fri May 11 22:29:23 2012 @@ -28,6 +28,7 @@ import java.io.File; import java.net.URL; import java.util.HashSet; import java.util.Set; +import java.util.Iterator; /** * Test case for {@link SiteCrawler}. @@ -52,13 +53,19 @@ public class SiteCrawlerTest extends Any final SiteCrawler controller = new SiteCrawler(tmpFile); controller.setMaxPages(100); + logger.info("Crawler4j: Setting max num of pages to: " + controller.getMaxPages()); controller.setPolitenessDelay(500); + logger.info("Crawler4j: Setting Politeness delay to: " + controller.getPolitenessDelay() + "ms"); final Set distinctPages = new HashSet(); controller.addListener(new CrawlerListener() { @Override public void visitedPage(Page page) { distinctPages.add( page.getWebURL().getURL() ); + Iterator it = distinctPages.iterator(); + while (it.hasNext()) { + logger.info("Crawler4j: Fetching page - " + it.next()); + } } }); @@ -69,7 +76,7 @@ public class SiteCrawlerTest extends Any } controller.stop(); - logger.debug("Crawled pages: " + distinctPages.size()); + logger.info("Distinct pages: " + distinctPages.size()); Assert.assertTrue("Expected some page crawled.", distinctPages.size() > 0); } Added: incubator/any23/trunk/plugins/basic-crawler/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/incubator/any23/trunk/plugins/basic-crawler/src/test/resources/log4j.properties?rev=1337401&view=auto ============================================================================== --- incubator/any23/trunk/plugins/basic-crawler/src/test/resources/log4j.properties (added) +++ incubator/any23/trunk/plugins/basic-crawler/src/test/resources/log4j.properties Fri May 11 22:29:23 2012 @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +log4j.rootCategory=DEBUG, stdout + +log4j.appender.stdout.Threshold=DEBUG + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] %m%n