Author: siren Date: Tue Sep 19 12:10:11 2006 New Revision: 447931 URL: http://svn.apache.org/viewvc?view=rev&rev=447931 Log: fix for fetcher testcase
Modified: lucene/nutch/trunk/build.xml lucene/nutch/trunk/src/test/org/apache/nutch/fetcher/TestFetcher.java lucene/nutch/trunk/src/testresources/fetch-test-site/dup_of_pagea.html lucene/nutch/trunk/src/testresources/fetch-test-site/index.html lucene/nutch/trunk/src/testresources/fetch-test-site/pagea.html lucene/nutch/trunk/src/testresources/fetch-test-site/pageb.html Modified: lucene/nutch/trunk/build.xml URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/build.xml?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/build.xml (original) +++ lucene/nutch/trunk/build.xml Tue Sep 19 12:10:11 2006 @@ -248,7 +248,12 @@ <delete dir="${test.build.data}"/> <mkdir dir="${test.build.data}"/> - + <!-- + copy resources needed in junit tests + --> + <copy todir="${test.build.data}"> + <fileset dir="src/testresources" includes="**/*"/> + </copy> <copy file="${test.src.dir}/nutch-site.xml" todir="${test.build.classes}"/> Modified: lucene/nutch/trunk/src/test/org/apache/nutch/fetcher/TestFetcher.java URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/test/org/apache/nutch/fetcher/TestFetcher.java?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/src/test/org/apache/nutch/fetcher/TestFetcher.java (original) +++ lucene/nutch/trunk/src/test/org/apache/nutch/fetcher/TestFetcher.java Tue Sep 19 12:10:11 2006 @@ -110,7 +110,10 @@ UTF8 key=new UTF8(); Content value=new Content(); if(!reader.next(key, value)) break READ; - handledurls.add(key.toString()); + String contentString=new String(value.getContent()); + if(contentString.indexOf("Nutch fetcher test page")!=-1) { + handledurls.add(key.toString()); + } } while(true); reader.close(); Modified: lucene/nutch/trunk/src/testresources/fetch-test-site/dup_of_pagea.html URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/testresources/fetch-test-site/dup_of_pagea.html?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/src/testresources/fetch-test-site/dup_of_pagea.html (original) +++ lucene/nutch/trunk/src/testresources/fetch-test-site/dup_of_pagea.html Tue Sep 19 12:10:11 2006 @@ -5,5 +5,7 @@ <body> This is page a <a href="index.html">home</a> +<hr> +Nutch fetcher test page </body> </html> Modified: lucene/nutch/trunk/src/testresources/fetch-test-site/index.html URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/testresources/fetch-test-site/index.html?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/src/testresources/fetch-test-site/index.html (original) +++ lucene/nutch/trunk/src/testresources/fetch-test-site/index.html Tue Sep 19 12:10:11 2006 @@ -7,5 +7,7 @@ <a href="pagea.html">Page a</a> <a href="pageb.html">Page b</a> <a href="dup_of_pagea.html">dup of Page a</a> +<hr> +Nutch fetcher test page </body> </html> Modified: lucene/nutch/trunk/src/testresources/fetch-test-site/pagea.html URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/testresources/fetch-test-site/pagea.html?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/src/testresources/fetch-test-site/pagea.html (original) +++ lucene/nutch/trunk/src/testresources/fetch-test-site/pagea.html Tue Sep 19 12:10:11 2006 @@ -5,5 +5,7 @@ <body> This is page a <a href="index.html">home</a> +<hr> +Nutch fetcher test page </body> </html> Modified: lucene/nutch/trunk/src/testresources/fetch-test-site/pageb.html URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/testresources/fetch-test-site/pageb.html?view=diff&rev=447931&r1=447930&r2=447931 ============================================================================== --- lucene/nutch/trunk/src/testresources/fetch-test-site/pageb.html (original) +++ lucene/nutch/trunk/src/testresources/fetch-test-site/pageb.html Tue Sep 19 12:10:11 2006 @@ -5,5 +5,7 @@ <body> This is page b <a href="index.html">home</a> +<hr> +Nutch fetcher test page </body> </html>