|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.junit.Assert org.apache.lucene.util.LuceneTestCase org.apache.lucene.search.SearchEquivalenceTestBase
public abstract class SearchEquivalenceTestBase
Simple base class for checking search equivalence.
Extend it, and write tests that create randomTerm()
s
(all terms are single characters a-z), and use
assertSameSet(Query, Query)
and
assertSubsetOf(Query, Query)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase |
---|
LuceneTestCase.Nightly |
Field Summary | |
---|---|
protected static Analyzer |
analyzer
|
protected static Directory |
directory
|
protected static IndexReader |
reader
|
protected static IndexSearcher |
s1
|
protected static IndexSearcher |
s2
|
protected static String |
stopword
|
Fields inherited from class org.apache.lucene.util.LuceneTestCase |
---|
classRules, random, RANDOM_MULTIPLIER, ruleChain, stores, TEMP_DIR, TEST_CLEAN_THREADS, TEST_DIRECTORY, TEST_ITER, TEST_ITER_MIN, TEST_LINE_DOCS_FILE, TEST_LOCALE, TEST_NIGHTLY, TEST_SEED, TEST_TIMEZONE, TEST_VERSION_CURRENT, testsFailed, VERBOSE |
Constructor Summary | |
---|---|
SearchEquivalenceTestBase()
|
Method Summary | |
---|---|
static void |
afterClass()
|
void |
assertSameSet(Query q1,
Query q2)
Asserts that the documents returned by q1
are the same as of those returned by q2 |
void |
assertSubsetOf(Query q1,
Query q2)
Asserts that the documents returned by q1
are a subset of those returned by q2 |
protected void |
assertSubsetOf(Query q1,
Query q2,
Filter filter)
Asserts that the documents returned by q1
are a subset of those returned by q2 . |
static void |
beforeClass()
|
protected Filter |
randomFilter()
Returns a random filter over the document set |
protected Term |
randomTerm()
returns a term suitable for searching. |
Methods inherited from class org.junit.Assert |
---|
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static IndexSearcher s1
protected static IndexSearcher s2
protected static Directory directory
protected static IndexReader reader
protected static Analyzer analyzer
protected static String stopword
Constructor Detail |
---|
public SearchEquivalenceTestBase()
Method Detail |
---|
public static void beforeClass() throws Exception
Exception
public static void afterClass() throws Exception
Exception
protected Term randomTerm()
protected Filter randomFilter()
public void assertSameSet(Query q1, Query q2) throws Exception
q1
are the same as of those returned by q2
Exception
public void assertSubsetOf(Query q1, Query q2) throws Exception
q1
are a subset of those returned by q2
Exception
protected void assertSubsetOf(Query q1, Query q2, Filter filter) throws Exception
q1
are a subset of those returned by q2
.
Both queries will be filtered by filter
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |