Author: siren
Date: Tue May 23 10:27:22 2006
New Revision: 408966

URL: http://svn.apache.org/viewvc?rev=408966&view=rev
Log:
NUTCH-280 added minimal test case and a fix for it, reported by Grant Glouser

Added:
    lucene/nutch/trunk/src/plugin/query-url/src/test/
    lucene/nutch/trunk/src/plugin/query-url/src/test/org/
    lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/
    lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/
    lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/
    
lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/
    
lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/TestURLQueryFilter.java
Modified:
    lucene/nutch/trunk/src/plugin/build.xml
    
lucene/nutch/trunk/src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java

Modified: lucene/nutch/trunk/src/plugin/build.xml
URL: 
http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/build.xml?rev=408966&r1=408965&r2=408966&view=diff
==============================================================================
--- lucene/nutch/trunk/src/plugin/build.xml (original)
+++ lucene/nutch/trunk/src/plugin/build.xml Tue May 23 10:27:22 2006
@@ -80,6 +80,7 @@
  <!-- <ant dir="parse-rtf" target="test"/> -->
      <ant dir="parse-swf" target="test"/>
      <ant dir="parse-zip" target="test"/>
+     <ant dir="query-url" target="test"/>
      <ant dir="urlfilter-automaton" target="test"/>
      <ant dir="urlfilter-regex" target="test"/>
      <ant dir="urlfilter-suffix" target="test"/>

Modified: 
lucene/nutch/trunk/src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java
URL: 
http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java?rev=408966&r1=408965&r2=408966&view=diff
==============================================================================
--- 
lucene/nutch/trunk/src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java
 (original)
+++ 
lucene/nutch/trunk/src/plugin/query-url/src/java/org/apache/nutch/searcher/url/URLQueryFilter.java
 Tue May 23 10:27:22 2006
@@ -24,17 +24,13 @@
  * BasicIndexingFilter.
  */
 public class URLQueryFilter extends FieldQueryFilter {
-  private Configuration conf;
 
   public URLQueryFilter() {
     super("url");
   }
 
   public void setConf(Configuration conf) {
-    this.conf = conf;
+    super.setConf(conf);
   }
 
-  public Configuration getConf() {
-    return this.conf;
-  }
 }

Added: 
lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/TestURLQueryFilter.java
URL: 
http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/TestURLQueryFilter.java?rev=408966&view=auto
==============================================================================
--- 
lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/TestURLQueryFilter.java
 (added)
+++ 
lucene/nutch/trunk/src/plugin/query-url/src/test/org/apache/nutch/searcher/url/TestURLQueryFilter.java
 Tue May 23 10:27:22 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed 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.
+ */
+package org.apache.nutch.searcher.url;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.nutch.searcher.Query;
+import org.apache.nutch.util.NutchConfiguration;
+
+import junit.framework.TestCase;
+
+public class TestURLQueryFilter extends TestCase {
+
+  public TestURLQueryFilter(String name) {
+    super(name);
+  }
+
+  public void testURLQueryFilter() {
+    Configuration conf = NutchConfiguration.create();
+    URLQueryFilter urlQueryFilter = new URLQueryFilter();
+    urlQueryFilter.setConf(conf);
+    try {
+      Query q = Query.parse("url:www.apache.org", conf);
+      BooleanQuery result = new BooleanQuery();
+      urlQueryFilter.filter(q, result);
+    } catch (Exception e) {
+      fail("Should not throw any exception!");
+    }
+  }
+}




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Nutch-cvs mailing list
Nutch-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to