Nux 1.6

org.apache.lucene.index.memory
Class PatternAnalyzerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.lucene.index.memory.PatternAnalyzerTest
All Implemented Interfaces:
junit.framework.Test

public class PatternAnalyzerTest
extends junit.framework.TestCase

Verifies that Lucene PatternAnalyzer and normal Lucene Analyzers have the same behaviour, returning the same results for any given free text. Runs a set of texts against a tokenizers/analyzers Can also be used as a simple benchmark.

Example usage:

cd lucene-cvs
java org.apache.lucene.index.memory.PatternAnalyzerTest 1 1 patluc 1 2 2 *.txt *.xml docs/*.html src/java/org/apache/lucene/index/*.java xdocs/*.xml ../nux/samples/data/*.xml
with WhitespaceAnalyzer problems can be found; These are not bugs but questionable Lucene features: CharTokenizer.MAX_WORD_LEN = 255. Thus the PatternAnalyzer produces correct output, whereas the WhitespaceAnalyzer silently truncates text, and so the comparison results in assertEquals() don't match up.

Author:
whoschek.AT.lbl.DOT.gov

Constructor Summary
PatternAnalyzerTest()
           
 
Method Summary
static void main(String[] args)
          Runs the tests and/or benchmark
 void testMany()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatternAnalyzerTest

public PatternAnalyzerTest()
Method Detail

main

public static void main(String[] args)
                 throws Throwable
Runs the tests and/or benchmark

Throws:
Throwable

testMany

public void testMany()
              throws Throwable
Throws:
Throwable

Nux 1.6