org.apache.lucene.analysis
Class CollationTestBase

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.lucene.util.LuceneTestCase
          extended by org.apache.lucene.analysis.CollationTestBase

public abstract class CollationTestBase
extends LuceneTestCase

Base test class for testing Unicode collation.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase
LuceneTestCase.Nightly
 
Field Summary
protected  String firstRangeBeginningOriginal
           
protected  String firstRangeEndOriginal
           
protected  String secondRangeBeginningOriginal
           
protected  String secondRangeEndOriginal
           
 
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
CollationTestBase()
           
 
Method Summary
 void assertThreadSafe(Analyzer analyzer)
           
protected  String encodeCollationKey(byte[] keyBits)
          Convenience method to perform the same function as CollationKeyFilter.
 void testCollationKeySort(Analyzer usAnalyzer, Analyzer franceAnalyzer, Analyzer swedenAnalyzer, Analyzer denmarkAnalyzer, String usResult, String frResult, String svResult, String dkResult)
           
 void testFarsiRangeFilterCollating(Analyzer analyzer, String firstBeg, String firstEnd, String secondBeg, String secondEnd)
           
 void testFarsiRangeQueryCollating(Analyzer analyzer, String firstBeg, String firstEnd, String secondBeg, String secondEnd)
           
 void testFarsiTermRangeQuery(Analyzer analyzer, String firstBeg, String firstEnd, String secondBeg, String secondEnd)
           
 
Methods inherited from class org.apache.lucene.util.LuceneTestCase
afterClassLuceneTestCaseJ4, alwaysIgnoredTestMethod, assertEquals, assertEquals, assertEquals, assertEquals, assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, beforeClassLuceneTestCaseJ4, dumpArray, dumpIterator, getDataFile, getName, getTestClass, getTestLabel, isTestThread, localeForName, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newField, newField, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newSearcher, newSearcher, newTieredMergePolicy, newTieredMergePolicy, purgeFieldCache, randomDirectory, randomLocale, randomTimeZone, rarely, rarely, reportAdditionalFailureInfo, reportPartialFailureInfo, setMergeFactor, setUp, setUseCompoundFile, tearDown, usually, usually
 
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

firstRangeBeginningOriginal

protected String firstRangeBeginningOriginal

firstRangeEndOriginal

protected String firstRangeEndOriginal

secondRangeBeginningOriginal

protected String secondRangeBeginningOriginal

secondRangeEndOriginal

protected String secondRangeEndOriginal
Constructor Detail

CollationTestBase

public CollationTestBase()
Method Detail

encodeCollationKey

protected String encodeCollationKey(byte[] keyBits)
Convenience method to perform the same function as CollationKeyFilter.

Parameters:
keyBits - the result from collator.getCollationKey(original).toByteArray()
Returns:
The encoded collation key for the original String

testFarsiRangeFilterCollating

public void testFarsiRangeFilterCollating(Analyzer analyzer,
                                          String firstBeg,
                                          String firstEnd,
                                          String secondBeg,
                                          String secondEnd)
                                   throws Exception
Throws:
Exception

testFarsiRangeQueryCollating

public void testFarsiRangeQueryCollating(Analyzer analyzer,
                                         String firstBeg,
                                         String firstEnd,
                                         String secondBeg,
                                         String secondEnd)
                                  throws Exception
Throws:
Exception

testFarsiTermRangeQuery

public void testFarsiTermRangeQuery(Analyzer analyzer,
                                    String firstBeg,
                                    String firstEnd,
                                    String secondBeg,
                                    String secondEnd)
                             throws Exception
Throws:
Exception

testCollationKeySort

public void testCollationKeySort(Analyzer usAnalyzer,
                                 Analyzer franceAnalyzer,
                                 Analyzer swedenAnalyzer,
                                 Analyzer denmarkAnalyzer,
                                 String usResult,
                                 String frResult,
                                 String svResult,
                                 String dkResult)
                          throws Exception
Throws:
Exception

assertThreadSafe

public void assertThreadSafe(Analyzer analyzer)
                      throws Exception
Throws:
Exception