Author: navssurtani
Date: 2008-07-02 06:52:43 -0400 (Wed, 02 Jul 2008)
New Revision: 6148
Modified:
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
Log:
Created iterator test within LocalCacheTest
Modified:
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
===================================================================
---
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-07-01
17:21:11 UTC (rev 6147)
+++
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-07-02
10:52:43 UTC (rev 6148)
@@ -3,6 +3,7 @@
import org.jboss.cache.search.SearchableCache;
import org.jboss.cache.search.SearchableCacheFactory;
import org.jboss.cache.search.CacheQuery;
+import org.jboss.cache.search.QueryResultIterator;
import org.jboss.cache.search.test.Person;
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
@@ -16,6 +17,7 @@
import org.apache.lucene.search.Query;
import java.util.List;
+import java.util.Iterator;
/**
* @author Navin Surtani - navin(a)surtani.org
@@ -78,6 +80,19 @@
assert found.get(0).equals(person1);
}
+ public void testSimpleIterator() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("playing");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ QueryResultIterator found = cacheQuery.iterator();
+
+ assert found.equals(person1);
+ }
+
+
+
public void testMultipleResults() throws ParseException
{
queryParser = new QueryParser("name", new StandardAnalyzer());
Show replies by date