Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 72131 invoked from network); 10 Feb 2010 13:36:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2010 13:36:36 -0000 Received: (qmail 51823 invoked by uid 500); 10 Feb 2010 13:36:36 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 51757 invoked by uid 500); 10 Feb 2010 13:36:36 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 51747 invoked by uid 99); 10 Feb 2010 13:36:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 13:36:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 13:36:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A10C72388A1C; Wed, 10 Feb 2010 13:36:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r908496 [4/6] - in /lucene/java/trunk: ./ src/test/org/apache/lucene/ src/test/org/apache/lucene/analysis/ src/test/org/apache/lucene/collation/ src/test/org/apache/lucene/document/ src/test/org/apache/lucene/index/ src/test/org/apache/luce... Date: Wed, 10 Feb 2010 13:36:04 -0000 To: java-commits@lucene.apache.org From: uschindler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100210133606.A10C72388A1C@eris.apache.org> Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java Wed Feb 10 13:35:57 2010 @@ -37,7 +37,6 @@ import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; import org.apache.lucene.util._TestUtil; import org.apache.lucene.util.ThreadInterruptedException; @@ -77,7 +76,7 @@ boolean optimize = true; Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); // create the index @@ -112,7 +111,7 @@ assertEquals(0, count(new Term("id", id10), r3)); assertEquals(1, count(new Term("id", Integer.toString(8000)), r3)); - writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); Document doc = new Document(); doc.add(new Field("field", "a b c", Field.Store.NO, Field.Index.ANALYZED)); @@ -140,7 +139,7 @@ boolean optimize = false; Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); // create the index @@ -149,7 +148,7 @@ // create a 2nd index Directory dir2 = new MockRAMDirectory(); - IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer2.setInfoStream(infoStream); createIndexNoClose(!optimize, "index2", writer2); @@ -187,13 +186,13 @@ boolean optimize = false; Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); // create a 2nd index Directory dir2 = new MockRAMDirectory(); - IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer2.setInfoStream(infoStream); createIndexNoClose(!optimize, "index2", writer2); @@ -222,7 +221,7 @@ boolean optimize = true; Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); // create the index @@ -261,7 +260,7 @@ writer.close(); // reopen the writer to verify the delete made it to the directory - writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); IndexReader w2r1 = writer.getReader(); @@ -276,7 +275,7 @@ int numDirs = 3; Directory mainDir = new MockRAMDirectory(); - IndexWriter mainWriter = new IndexWriter(mainDir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter mainWriter = new IndexWriter(mainDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); mainWriter.setInfoStream(infoStream); AddDirectoriesThreads addDirThreads = new AddDirectoriesThreads(numIter, mainWriter); @@ -384,7 +383,7 @@ this.numDirs = numDirs; this.mainWriter = mainWriter; addDir = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(addDir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(addDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setMaxBufferedDocs(2); for (int i = 0; i < NUM_INIT_DOCS; i++) { @@ -492,7 +491,7 @@ */ public void doTestIndexWriterReopenSegment(boolean optimize) throws Exception { Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); IndexReader r1 = writer.getReader(); @@ -530,7 +529,7 @@ writer.close(); // test whether the changes made it to the directory - writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); IndexReader w2r1 = writer.getReader(); // insure the deletes were actually flushed to the directory @@ -571,7 +570,7 @@ */ public static void createIndex(Directory dir1, String indexName, boolean multiSegment) throws IOException { - IndexWriter w = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter w = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); w.setMergePolicy(new LogDocMergePolicy(w)); for (int i = 0; i < 100; i++) { @@ -606,7 +605,7 @@ public void testMergeWarmer() throws Exception { Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); @@ -641,7 +640,7 @@ public void testAfterCommit() throws Exception { Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); @@ -674,7 +673,7 @@ // Make sure reader remains usable even if IndexWriter closes public void testAfterClose() throws Exception { Directory dir1 = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); @@ -704,7 +703,7 @@ // Stress test reopen during addIndexes public void testDuringAddIndexes() throws Exception { Directory dir1 = new MockRAMDirectory(); - final IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + final IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); writer.setMergeFactor(2); @@ -782,7 +781,7 @@ // Stress test reopen during add/delete public void testDuringAddDelete() throws Exception { Directory dir1 = new MockRAMDirectory(); - final IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + final IndexWriter writer = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setInfoStream(infoStream); writer.setMergeFactor(2); @@ -863,7 +862,7 @@ public void testExpungeDeletes() throws Throwable { Directory dir = new MockRAMDirectory(); - final IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + final IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); Document doc = new Document(); doc.add(new Field("field", "a b c", Field.Store.NO, Field.Index.ANALYZED)); @@ -888,7 +887,7 @@ public void testDeletesNumDocs() throws Throwable { Directory dir = new MockRAMDirectory(); - final IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + final IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); Document doc = new Document(); doc.add(new Field("field", "a b c", Field.Store.NO, Field.Index.ANALYZED)); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java Wed Feb 10 13:35:57 2010 @@ -18,7 +18,6 @@ */ import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.*; @@ -64,7 +63,7 @@ Directory dir = new RAMDirectory(); try { Random r = newRandom(); - Analyzer analyzer = new SimpleAnalyzer(Version.LUCENE_CURRENT); + Analyzer analyzer = new SimpleAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); writer.setUseCompoundFile(false); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java Wed Feb 10 13:35:57 2010 @@ -30,7 +30,6 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; /** * Tests lazy skipping on the proximity file. @@ -61,7 +60,7 @@ int numDocs = 500; Directory directory = new SeekCountingDirectory(); - IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); writer.setUseCompoundFile(false); writer.setMaxBufferedDocs(10); for (int i = 0; i < numDocs; i++) { @@ -119,7 +118,7 @@ public void testSeek() throws IOException { Directory directory = new RAMDirectory(); - IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); for (int i = 0; i < 10; i++) { Document doc = new Document(); doc.add(new Field(this.field, "a b", Field.Store.YES, Field.Index.ANALYZED)); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java Wed Feb 10 13:35:57 2010 @@ -32,7 +32,6 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; /** * This testcase tests whether multi-level skipping is being used @@ -92,7 +91,7 @@ private static class PayloadAnalyzer extends Analyzer { @Override public TokenStream tokenStream(String fieldName, Reader reader) { - return new PayloadFilter(new LowerCaseTokenizer(Version.LUCENE_CURRENT, reader)); + return new PayloadFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, reader)); } } Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java Wed Feb 10 13:35:57 2010 @@ -25,7 +25,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; public class TestNRTReaderWithThreads extends LuceneTestCase { Random random = new Random(); @@ -33,7 +32,7 @@ public void testIndexing() throws Exception { Directory mainDir = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(mainDir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter writer = new IndexWriter(mainDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer.setUseCompoundFile(false); IndexReader reader = writer.getReader(); // start pooling readers Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java Wed Feb 10 13:35:57 2010 @@ -65,7 +65,7 @@ protected void setUp() throws Exception { super.setUp(); similarityOne = new SimilarityOne(); - anlzr = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + anlzr = new StandardAnalyzer(TEST_VERSION_CURRENT); } /** Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java Wed Feb 10 13:35:57 2010 @@ -66,7 +66,7 @@ // omitTermFreqAndPositions bit in the FieldInfo public void testOmitTermFreqAndPositions() throws Exception { Directory ram = new MockRAMDirectory(); - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(ram, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); Document d = new Document(); @@ -112,7 +112,7 @@ // omitTermFreqAndPositions for the same field works public void testMixedMerge() throws Exception { Directory ram = new MockRAMDirectory(); - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(ram, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); writer.setMaxBufferedDocs(3); writer.setMergeFactor(2); @@ -165,7 +165,7 @@ // field, public void testMixedRAM() throws Exception { Directory ram = new MockRAMDirectory(); - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(ram, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); writer.setMaxBufferedDocs(10); writer.setMergeFactor(2); @@ -213,7 +213,7 @@ // Verifies no *.prx exists when all fields omit term freq: public void testNoPrxFile() throws Throwable { Directory ram = new MockRAMDirectory(); - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(ram, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); writer.setMaxBufferedDocs(3); writer.setMergeFactor(2); @@ -244,7 +244,7 @@ // Test scores with one field with Term Freqs and one without, otherwise with equal content public void testBasic() throws Exception { Directory dir = new MockRAMDirectory(); - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); writer.setMergeFactor(2); writer.setMaxBufferedDocs(2); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java Wed Feb 10 13:35:57 2010 @@ -106,7 +106,7 @@ // one document only: Directory dir2 = new MockRAMDirectory(); - IndexWriter w2 = new IndexWriter(dir2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter w2 = new IndexWriter(dir2, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Document d3 = new Document(); d3.add(new Field("f3", "v1", Field.Store.YES, Field.Index.ANALYZED)); w2.addDocument(d3); @@ -151,13 +151,13 @@ Directory dir2 = getDir2(); // add another document to ensure that the indexes are not optimized - IndexWriter modifier = new IndexWriter(dir1, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + IndexWriter modifier = new IndexWriter(dir1, new StandardAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); Document d = new Document(); d.add(new Field("f1", "v1", Field.Store.YES, Field.Index.ANALYZED)); modifier.addDocument(d); modifier.close(); - modifier = new IndexWriter(dir2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + modifier = new IndexWriter(dir2, new StandardAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); d = new Document(); d.add(new Field("f2", "v2", Field.Store.YES, Field.Index.ANALYZED)); modifier.addDocument(d); @@ -170,7 +170,7 @@ assertFalse(pr.isOptimized()); pr.close(); - modifier = new IndexWriter(dir1, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + modifier = new IndexWriter(dir1, new StandardAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); modifier.optimize(); modifier.close(); @@ -182,7 +182,7 @@ pr.close(); - modifier = new IndexWriter(dir2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + modifier = new IndexWriter(dir2, new StandardAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); modifier.optimize(); modifier.close(); @@ -233,7 +233,7 @@ // Fields 1-4 indexed together: private Searcher single() throws IOException { Directory dir = new MockRAMDirectory(); - IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter w = new IndexWriter(dir, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Document d1 = new Document(); d1.add(new Field("f1", "v1", Field.Store.YES, Field.Index.ANALYZED)); d1.add(new Field("f2", "v1", Field.Store.YES, Field.Index.ANALYZED)); @@ -263,7 +263,7 @@ private Directory getDir1() throws IOException { Directory dir1 = new MockRAMDirectory(); - IndexWriter w1 = new IndexWriter(dir1, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter w1 = new IndexWriter(dir1, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Document d1 = new Document(); d1.add(new Field("f1", "v1", Field.Store.YES, Field.Index.ANALYZED)); d1.add(new Field("f2", "v1", Field.Store.YES, Field.Index.ANALYZED)); @@ -278,7 +278,7 @@ private Directory getDir2() throws IOException { Directory dir2 = new RAMDirectory(); - IndexWriter w2 = new IndexWriter(dir2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter w2 = new IndexWriter(dir2, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Document d3 = new Document(); d3.add(new Field("f3", "v1", Field.Store.YES, Field.Index.ANALYZED)); d3.add(new Field("f4", "v1", Field.Store.YES, Field.Index.ANALYZED)); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java Wed Feb 10 13:35:57 2010 @@ -20,7 +20,6 @@ import java.io.IOException; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; import org.apache.lucene.util._TestUtil; import org.apache.lucene.analysis.SimpleAnalyzer; @@ -48,7 +47,7 @@ */ public void testEmptyIndex() throws IOException { RAMDirectory rd1 = new MockRAMDirectory(); - IndexWriter iw = new IndexWriter(rd1, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iw = new IndexWriter(rd1, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED); iw.close(); @@ -56,7 +55,7 @@ RAMDirectory rdOut = new MockRAMDirectory(); - IndexWriter iwOut = new IndexWriter(rdOut, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iwOut = new IndexWriter(rdOut, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED); ParallelReader pr = new ParallelReader(); pr.add(IndexReader.open(rd1,true)); @@ -81,7 +80,7 @@ public void testEmptyIndexWithVectors() throws IOException { RAMDirectory rd1 = new MockRAMDirectory(); { - IndexWriter iw = new IndexWriter(rd1, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iw = new IndexWriter(rd1, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED); Document doc = new Document(); doc.add(new Field("test", "", Store.NO, Index.ANALYZED, @@ -96,7 +95,7 @@ ir.deleteDocument(0); ir.close(); - iw = new IndexWriter(rd1, new SimpleAnalyzer(Version.LUCENE_CURRENT), false, + iw = new IndexWriter(rd1, new SimpleAnalyzer(TEST_VERSION_CURRENT), false, MaxFieldLength.UNLIMITED); iw.optimize(); iw.close(); @@ -104,7 +103,7 @@ RAMDirectory rd2 = new MockRAMDirectory(); { - IndexWriter iw = new IndexWriter(rd2, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iw = new IndexWriter(rd2, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED); Document doc = new Document(); iw.addDocument(doc); @@ -113,7 +112,7 @@ RAMDirectory rdOut = new MockRAMDirectory(); - IndexWriter iwOut = new IndexWriter(rdOut, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iwOut = new IndexWriter(rdOut, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED); ParallelReader pr = new ParallelReader(); pr.add(IndexReader.open(rd1,true)); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java Wed Feb 10 13:35:57 2010 @@ -20,8 +20,6 @@ import java.io.IOException; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; - import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -39,7 +37,7 @@ Document doc; RAMDirectory rd1 = new RAMDirectory(); - IndexWriter iw1 = new IndexWriter(rd1, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter iw1 = new IndexWriter(rd1, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); doc = new Document(); doc.add(new Field("field1", "the quick brown fox jumps", Store.YES, @@ -51,7 +49,7 @@ iw1.close(); RAMDirectory rd2 = new RAMDirectory(); - IndexWriter iw2 = new IndexWriter(rd2, new SimpleAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter iw2 = new IndexWriter(rd2, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); doc = new Document(); doc.add(new Field("field0", "", Store.NO, Index.ANALYZED)); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java Wed Feb 10 13:35:57 2010 @@ -41,7 +41,6 @@ import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.UnicodeUtil; -import org.apache.lucene.util.Version; import org.apache.lucene.util._TestUtil; @@ -396,7 +395,7 @@ @Override public TokenStream tokenStream(String fieldName, Reader reader) { PayloadData payload = fieldToData.get(fieldName); - TokenStream ts = new WhitespaceTokenizer(Version.LUCENE_CURRENT, reader); + TokenStream ts = new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader); if (payload != null) { if (payload.numFieldInstancesToSkip == 0) { ts = new PayloadFilter(ts, payload.data, payload.offset, payload.length); @@ -469,7 +468,7 @@ final ByteArrayPool pool = new ByteArrayPool(numThreads, 5); Directory dir = new RAMDirectory(); - final IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + final IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); final String field = "test"; Thread[] ingesters = new Thread[numThreads]; Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java Wed Feb 10 13:35:57 2010 @@ -18,7 +18,6 @@ */ import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.store.Directory; @@ -103,7 +102,7 @@ public void testSkipTo(int indexDivisor) throws IOException { Directory dir = new RAMDirectory(); - IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Term ta = new Term("content","aaa"); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java Wed Feb 10 13:35:57 2010 @@ -20,8 +20,6 @@ import java.io.IOException; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; - import org.apache.lucene.analysis.WhitespaceAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -38,7 +36,7 @@ { IndexWriter writer = null; - writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); // ADD 100 documents with term : aaa // add 100 documents with terms: aaa bbb @@ -54,7 +52,7 @@ verifyDocFreq(); // merge segments by optimizing the index - writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED); + writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.LIMITED); writer.optimize(); writer.close(); @@ -65,7 +63,7 @@ public void testPrevTermAtEnd() throws IOException { Directory dir = new MockRAMDirectory(); - IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); addDoc(writer, "aaa bbb"); writer.close(); SegmentReader reader = SegmentReader.getOnlySegmentReader(dir); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java Wed Feb 10 13:35:57 2010 @@ -26,7 +26,7 @@ import java.io.File; public class TestStressIndexing extends LuceneTestCase { - private static final Analyzer ANALYZER = new SimpleAnalyzer(Version.LUCENE_CURRENT); + private static final Analyzer ANALYZER = new SimpleAnalyzer(TEST_VERSION_CURRENT); private Random RANDOM; private static abstract class TimedThread extends Thread { Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java Wed Feb 10 13:35:57 2010 @@ -19,7 +19,6 @@ import org.apache.lucene.analysis.*; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; import org.apache.lucene.util._TestUtil; import org.apache.lucene.util.StringHelper; import org.apache.lucene.search.TermQuery; @@ -124,7 +123,7 @@ public DocsAndWriter indexRandomIWReader(int nThreads, int iterations, int range, Directory dir) throws IOException, InterruptedException { Map docs = new HashMap(); - IndexWriter w = new MockIndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED); + IndexWriter w = new MockIndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED); w.setUseCompoundFile(false); /*** @@ -176,7 +175,7 @@ public Map indexRandom(int nThreads, int iterations, int range, Directory dir) throws IOException, InterruptedException { Map docs = new HashMap(); for(int iter=0;iter<3;iter++) { - IndexWriter w = new MockIndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED); + IndexWriter w = new MockIndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED); w.setUseCompoundFile(false); // force many merges @@ -219,7 +218,7 @@ public static void indexSerial(Map docs, Directory dir) throws IOException { - IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); + IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); // index all docs in a single thread Iterator iter = docs.values().iterator(); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java Wed Feb 10 13:35:57 2010 @@ -24,7 +24,6 @@ import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.util.Version; import org.apache.lucene.util._TestUtil; import org.apache.lucene.util.English; @@ -35,7 +34,7 @@ public class TestThreadedOptimize extends LuceneTestCase { - private static final Analyzer ANALYZER = new SimpleAnalyzer(Version.LUCENE_CURRENT); + private static final Analyzer ANALYZER = new SimpleAnalyzer(TEST_VERSION_CURRENT); private final static int NUM_THREADS = 3; //private final static int NUM_THREADS = 5; Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactionRollback.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactionRollback.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactionRollback.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactionRollback.java Wed Feb 10 13:35:57 2010 @@ -27,8 +27,6 @@ import java.util.HashMap; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; - import org.apache.lucene.analysis.WhitespaceAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -67,7 +65,7 @@ if (last==null) throw new RuntimeException("Couldn't find commit point "+id); - IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), new RollbackDeletionPolicy(id), MaxFieldLength.UNLIMITED, last); Map data = new HashMap(); data.put("index", "Rolled back to 1-"+id); @@ -129,7 +127,7 @@ //Build index, of records 1 to 100, committing after each batch of 10 IndexDeletionPolicy sdp=new KeepAllDeletionPolicy(); - IndexWriter w=new IndexWriter(dir,new WhitespaceAnalyzer(Version.LUCENE_CURRENT),sdp,MaxFieldLength.UNLIMITED); + IndexWriter w=new IndexWriter(dir,new WhitespaceAnalyzer(TEST_VERSION_CURRENT),sdp,MaxFieldLength.UNLIMITED); for(int currentRecordId=1;currentRecordId<=100;currentRecordId++) { Document doc=new Document(); doc.add(new Field(FIELD_RECORD_ID,""+currentRecordId,Field.Store.YES,Field.Index.ANALYZED)); @@ -197,7 +195,7 @@ for(int i=0;i<2;i++) { // Unless you specify a prior commit point, rollback // should not work: - new IndexWriter(dir,new WhitespaceAnalyzer(Version.LUCENE_CURRENT), + new IndexWriter(dir,new WhitespaceAnalyzer(TEST_VERSION_CURRENT), new DeleteLastCommitPolicy(), MaxFieldLength.UNLIMITED).close(); IndexReader r = IndexReader.open(dir, true); Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactions.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactions.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactions.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactions.java Wed Feb 10 13:35:57 2010 @@ -88,12 +88,12 @@ @Override public void doWork() throws Throwable { - IndexWriter writer1 = new IndexWriter(dir1, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer1 = new IndexWriter(dir1, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); writer1.setMaxBufferedDocs(3); writer1.setMergeFactor(2); ((ConcurrentMergeScheduler) writer1.getMergeScheduler()).setSuppressExceptions(); - IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer2 = new IndexWriter(dir2, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); // Intentionally use different params so flush/merge // happen @ different times writer2.setMaxBufferedDocs(2); @@ -178,7 +178,7 @@ } public void initIndex(Directory dir) throws Throwable { - IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.LIMITED); for(int j=0; j<7; j++) { Document d = new Document(); int n = RANDOM.nextInt(); Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java Wed Feb 10 13:35:57 2010 @@ -44,7 +44,7 @@ public void testMultiAnalyzer() throws ParseException { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "", new MultiAnalyzer()); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "", new MultiAnalyzer()); // trivial, no multiple tokens: assertEquals("foo", qp.parse("foo").toString()); @@ -135,9 +135,9 @@ @Override public TokenStream tokenStream(String fieldName, Reader reader) { - TokenStream result = new StandardTokenizer(Version.LUCENE_CURRENT, reader); + TokenStream result = new StandardTokenizer(TEST_VERSION_CURRENT, reader); result = new TestFilter(result); - result = new LowerCaseFilter(Version.LUCENE_CURRENT, result); + result = new LowerCaseFilter(TEST_VERSION_CURRENT, result); return result; } } @@ -203,9 +203,9 @@ @Override public TokenStream tokenStream(String fieldName, Reader reader) { - TokenStream result = new StandardTokenizer(Version.LUCENE_CURRENT, reader); + TokenStream result = new StandardTokenizer(TEST_VERSION_CURRENT, reader); result = new TestPosIncrementFilter(result); - result = new LowerCaseFilter(Version.LUCENE_CURRENT, result); + result = new LowerCaseFilter(TEST_VERSION_CURRENT, result); return result; } } @@ -242,7 +242,7 @@ private final static class DumbQueryParser extends QueryParser { public DumbQueryParser(String f, Analyzer a) { - super(Version.LUCENE_CURRENT, f, a); + super(TEST_VERSION_CURRENT, f, a); } /** expose super's version */ Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java Wed Feb 10 13:35:57 2010 @@ -36,7 +36,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; /** * Tests QueryParser. @@ -60,18 +59,18 @@ String[] fields = {"b", "t"}; Occur occur[] = {Occur.SHOULD, Occur.SHOULD}; TestQueryParser.QPTestAnalyzer a = new TestQueryParser.QPTestAnalyzer(); - MultiFieldQueryParser mfqp = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fields, a); + MultiFieldQueryParser mfqp = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, a); Query q = mfqp.parse(qtxt); assertEquals(expectedRes, q.toString()); - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, qtxt, fields, occur, a); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, qtxt, fields, occur, a); assertEquals(expectedRes, q.toString()); } public void testSimple() throws Exception { String[] fields = {"b", "t"}; - MultiFieldQueryParser mfqp = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + MultiFieldQueryParser mfqp = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); Query q = mfqp.parse("one"); assertEquals("b:one t:one", q.toString()); @@ -134,7 +133,7 @@ boosts.put("b", Float.valueOf(5)); boosts.put("t", Float.valueOf(10)); String[] fields = {"b", "t"}; - MultiFieldQueryParser mfqp = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), boosts); + MultiFieldQueryParser mfqp = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, new StandardAnalyzer(TEST_VERSION_CURRENT), boosts); //Check for simple @@ -160,24 +159,24 @@ public void testStaticMethod1() throws ParseException { String[] fields = {"b", "t"}; String[] queries = {"one", "two"}; - Query q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + Query q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("b:one t:two", q.toString()); String[] queries2 = {"+one", "+two"}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries2, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries2, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("(+b:one) (+t:two)", q.toString()); String[] queries3 = {"one", "+two"}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries3, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries3, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("b:one (+t:two)", q.toString()); String[] queries4 = {"one +more", "+two"}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries4, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries4, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("(b:one +b:more) (+t:two)", q.toString()); String[] queries5 = {"blah"}; try { - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries5, fields, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries5, fields, new StandardAnalyzer(TEST_VERSION_CURRENT)); fail(); } catch(IllegalArgumentException e) { // expected exception, array length differs @@ -187,11 +186,11 @@ TestQueryParser.QPTestAnalyzer stopA = new TestQueryParser.QPTestAnalyzer(); String[] queries6 = {"((+stop))", "+((stop))"}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries6, fields, stopA); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries6, fields, stopA); assertEquals("", q.toString()); String[] queries7 = {"one ((+stop)) +more", "+((stop)) +two"}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries7, fields, stopA); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries7, fields, stopA); assertEquals("(b:one +b:more) (+t:two)", q.toString()); } @@ -199,15 +198,15 @@ public void testStaticMethod2() throws ParseException { String[] fields = {"b", "t"}; BooleanClause.Occur[] flags = {BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT}; - Query q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "one", fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + Query q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "one", fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("+b:one -t:one", q.toString()); - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "one two", fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "one two", fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("+(b:one b:two) -(t:one t:two)", q.toString()); try { BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "blah", fields, flags2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "blah", fields, flags2, new StandardAnalyzer(TEST_VERSION_CURRENT)); fail(); } catch(IllegalArgumentException e) { // expected exception, array length differs @@ -219,15 +218,15 @@ //int[] flags = {MultiFieldQueryParser.REQUIRED_FIELD, MultiFieldQueryParser.PROHIBITED_FIELD}; BooleanClause.Occur[] flags = {BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT}; - Query q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "one", fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT));//, fields, flags, new StandardAnalyzer()); + Query q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "one", fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT));//, fields, flags, new StandardAnalyzer()); assertEquals("+b:one -t:one", q.toString()); - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "one two", fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "one two", fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("+(b:one b:two) -(t:one t:two)", q.toString()); try { BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, "blah", fields, flags2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, "blah", fields, flags2, new StandardAnalyzer(TEST_VERSION_CURRENT)); fail(); } catch(IllegalArgumentException e) { // expected exception, array length differs @@ -239,12 +238,12 @@ String[] fields = {"f1", "f2", "f3"}; BooleanClause.Occur[] flags = {BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT, BooleanClause.Occur.SHOULD}; - Query q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries, fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + Query q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries, fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("+f1:one -f2:two f3:three", q.toString()); try { BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries, fields, flags2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries, fields, flags2, new StandardAnalyzer(TEST_VERSION_CURRENT)); fail(); } catch(IllegalArgumentException e) { // expected exception, array length differs @@ -255,12 +254,12 @@ String[] queries = {"one", "two"}; String[] fields = {"b", "t"}; BooleanClause.Occur[] flags = {BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT}; - Query q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries, fields, flags, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + Query q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries, fields, flags, new StandardAnalyzer(TEST_VERSION_CURRENT)); assertEquals("+b:one -t:two", q.toString()); try { BooleanClause.Occur[] flags2 = {BooleanClause.Occur.MUST}; - q = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queries, fields, flags2, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + q = MultiFieldQueryParser.parse(TEST_VERSION_CURRENT, queries, fields, flags2, new StandardAnalyzer(TEST_VERSION_CURRENT)); fail(); } catch(IllegalArgumentException e) { // expected exception, array length differs @@ -269,7 +268,7 @@ public void testAnalyzerReturningNull() throws ParseException { String[] fields = new String[] { "f1", "f2", "f3" }; - MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fields, new AnalyzerReturningNull()); + MultiFieldQueryParser parser = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, new AnalyzerReturningNull()); Query q = parser.parse("bla AND blo"); assertEquals("+(f2:bla f3:bla) +(f2:blo f3:blo)", q.toString()); // the following queries are not affected as their terms are not analyzed anyway: @@ -282,7 +281,7 @@ } public void testStopWordSearching() throws Exception { - Analyzer analyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); Directory ramDir = new RAMDirectory(); IndexWriter iw = new IndexWriter(ramDir, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); Document doc = new Document(); @@ -291,7 +290,7 @@ iw.close(); MultiFieldQueryParser mfqp = - new MultiFieldQueryParser(Version.LUCENE_CURRENT, new String[] {"body"}, analyzer); + new MultiFieldQueryParser(TEST_VERSION_CURRENT, new String[] {"body"}, analyzer); mfqp.setDefaultOperator(QueryParser.Operator.AND); Query q = mfqp.parse("the footest"); IndexSearcher is = new IndexSearcher(ramDir, true); @@ -304,7 +303,7 @@ * Return empty tokens for field "f1". */ private static class AnalyzerReturningNull extends Analyzer { - StandardAnalyzer stdAnalyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + StandardAnalyzer stdAnalyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); public AnalyzerReturningNull() { } Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Wed Feb 10 13:35:57 2010 @@ -64,7 +64,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.util.LocalizedTestCase; -import org.apache.lucene.util.Version; /** * Tests QueryParser. @@ -128,13 +127,13 @@ /** Filters LowerCaseTokenizer with StopFilter. */ @Override public final TokenStream tokenStream(String fieldName, Reader reader) { - return new QPTestFilter(new LowerCaseTokenizer(Version.LUCENE_CURRENT, reader)); + return new QPTestFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, reader)); } } public static class QPTestParser extends QueryParser { public QPTestParser(String f, Analyzer a) { - super(Version.LUCENE_CURRENT, f, a); + super(TEST_VERSION_CURRENT, f, a); } @Override @@ -158,8 +157,8 @@ public QueryParser getParser(Analyzer a) throws Exception { if (a == null) - a = new SimpleAnalyzer(Version.LUCENE_CURRENT); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", a); + a = new SimpleAnalyzer(TEST_VERSION_CURRENT); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", a); qp.setDefaultOperator(QueryParser.OR_OPERATOR); return qp; } @@ -228,8 +227,8 @@ public Query getQueryDOA(String query, Analyzer a) throws Exception { if (a == null) - a = new SimpleAnalyzer(Version.LUCENE_CURRENT); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", a); + a = new SimpleAnalyzer(TEST_VERSION_CURRENT); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", a); qp.setDefaultOperator(QueryParser.AND_OPERATOR); return qp.parse(query); } @@ -253,8 +252,8 @@ public void testSimple() throws Exception { assertQueryEquals("term term term", null, "term term term"); - assertQueryEquals("türm term term", new WhitespaceAnalyzer(Version.LUCENE_CURRENT), "türm term term"); - assertQueryEquals("ümlaut", new WhitespaceAnalyzer(Version.LUCENE_CURRENT), "ümlaut"); + assertQueryEquals("türm term term", new WhitespaceAnalyzer(TEST_VERSION_CURRENT), "türm term term"); + assertQueryEquals("ümlaut", new WhitespaceAnalyzer(TEST_VERSION_CURRENT), "ümlaut"); assertQueryEquals("\"\"", new KeywordAnalyzer(), ""); assertQueryEquals("foo:\"\"", new KeywordAnalyzer(), "foo:"); @@ -301,7 +300,7 @@ assertQueryEquals("+title:(dog OR cat) -author:\"bob dole\"", null, "+(title:dog title:cat) -author:\"bob dole\""); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new StandardAnalyzer(TEST_VERSION_CURRENT)); // make sure OR is the default: assertEquals(QueryParser.OR_OPERATOR, qp.getDefaultOperator()); qp.setDefaultOperator(QueryParser.AND_OPERATOR); @@ -311,7 +310,7 @@ } public void testPunct() throws Exception { - Analyzer a = new WhitespaceAnalyzer(Version.LUCENE_CURRENT); + Analyzer a = new WhitespaceAnalyzer(TEST_VERSION_CURRENT); assertQueryEquals("a&b", a, "a&b"); assertQueryEquals("a&&b", a, "a&&b"); assertQueryEquals(".NET", a, ".NET"); @@ -331,7 +330,7 @@ assertQueryEquals("term 1.0 1 2", null, "term"); assertQueryEquals("term term1 term2", null, "term term term"); - Analyzer a = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT); + Analyzer a = new StandardAnalyzer(TEST_VERSION_CURRENT); assertQueryEquals("3", a, "3"); assertQueryEquals("term 1.0 1 2", a, "term 1.0 1 2"); assertQueryEquals("term term1 term2", a, "term term1 term2"); @@ -456,7 +455,7 @@ assertQueryEquals("[ a TO z]", null, "[a TO z]"); assertEquals(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, ((TermRangeQuery)getQuery("[ a TO z]", null)).getRewriteMethod()); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new SimpleAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new SimpleAnalyzer(TEST_VERSION_CURRENT)); qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE); assertEquals(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE,((TermRangeQuery)qp.parse("[ a TO z]")).getRewriteMethod()); @@ -473,7 +472,7 @@ public void testFarsiRangeCollating() throws Exception { RAMDirectory ramDir = new RAMDirectory(); - IndexWriter iw = new IndexWriter(ramDir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter iw = new IndexWriter(ramDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); Document doc = new Document(); doc.add(new Field("content","\u0633\u0627\u0628", @@ -482,7 +481,7 @@ iw.close(); IndexSearcher is = new IndexSearcher(ramDir, true); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "content", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "content", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); // Neither Java 1.4.2 nor 1.5.0 has Farsi Locale collation available in // RuleBasedCollator. However, the Arabic Locale seems to order the Farsi @@ -580,7 +579,7 @@ final String defaultField = "default"; final String monthField = "month"; final String hourField = "hour"; - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new SimpleAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new SimpleAnalyzer(TEST_VERSION_CURRENT)); // Don't set any date resolution and verify if DateField is used assertDateRangeQueryEquals(qp, defaultField, startDate, endDate, @@ -621,7 +620,7 @@ } public void testEscaped() throws Exception { - Analyzer a = new WhitespaceAnalyzer(Version.LUCENE_CURRENT); + Analyzer a = new WhitespaceAnalyzer(TEST_VERSION_CURRENT); /*assertQueryEquals("\\[brackets", a, "\\[brackets"); assertQueryEquals("\\[brackets", null, "brackets"); @@ -715,7 +714,7 @@ } public void testQueryStringEscaping() throws Exception { - Analyzer a = new WhitespaceAnalyzer(Version.LUCENE_CURRENT); + Analyzer a = new WhitespaceAnalyzer(TEST_VERSION_CURRENT); assertEscapedQueryEquals("a-b:c", a, "a\\-b\\:c"); assertEscapedQueryEquals("a+b:c", a, "a\\+b\\:c"); @@ -802,8 +801,8 @@ throws Exception { Set stopWords = new HashSet(1); stopWords.add("on"); - StandardAnalyzer oneStopAnalyzer = new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT, stopWords); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", oneStopAnalyzer); + StandardAnalyzer oneStopAnalyzer = new StandardAnalyzer(TEST_VERSION_CURRENT, stopWords); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", oneStopAnalyzer); Query q = qp.parse("on^1.0"); assertNotNull(q); q = qp.parse("\"hello\"^2.0"); @@ -815,7 +814,7 @@ q = qp.parse("\"on\"^1.0"); assertNotNull(q); - QueryParser qp2 = new QueryParser(Version.LUCENE_CURRENT, "field", new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT)); + QueryParser qp2 = new QueryParser(TEST_VERSION_CURRENT, "field", new StandardAnalyzer(TEST_VERSION_CURRENT)); q = qp2.parse("the^3"); // "the" is a stop word so the result is an empty query: assertNotNull(q); @@ -844,7 +843,7 @@ public void testCustomQueryParserWildcard() { try { - new QPTestParser("contents", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)).parse("a?t"); + new QPTestParser("contents", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("a?t"); fail("Wildcard queries should not be allowed"); } catch (ParseException expected) { // expected exception @@ -853,7 +852,7 @@ public void testCustomQueryParserFuzzy() throws Exception { try { - new QPTestParser("contents", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)).parse("xunit~"); + new QPTestParser("contents", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("xunit~"); fail("Fuzzy queries should not be allowed"); } catch (ParseException expected) { // expected exception @@ -863,7 +862,7 @@ public void testBooleanQuery() throws Exception { BooleanQuery.setMaxClauseCount(2); try { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); qp.parse("one two three"); fail("ParseException expected due to too many boolean clauses"); } catch (ParseException expected) { @@ -875,7 +874,7 @@ * This test differs from TestPrecedenceQueryParser */ public void testPrecedence() throws Exception { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); Query query1 = qp.parse("A AND B OR C AND D"); Query query2 = qp.parse("+A +B +C +D"); assertEquals(query1, query2); @@ -883,7 +882,7 @@ public void testLocalDateFormat() throws IOException, ParseException { RAMDirectory ramDir = new RAMDirectory(); - IndexWriter iw = new IndexWriter(ramDir, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter iw = new IndexWriter(ramDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); addDateDoc("a", 2005, 12, 2, 10, 15, 33, iw); addDateDoc("b", 2005, 12, 4, 22, 15, 00, iw); iw.close(); @@ -899,7 +898,7 @@ public void testStarParsing() throws Exception { final int[] type = new int[1]; - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)) { + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)) { @Override protected Query getWildcardQuery(String field, String termStr) throws ParseException { // override error checking of superclass @@ -958,7 +957,7 @@ } public void testStopwords() throws Exception { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "a", new StopAnalyzer(Version.LUCENE_CURRENT, StopFilter.makeStopSet(Version.LUCENE_CURRENT, "the", "foo"))); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "a", new StopAnalyzer(TEST_VERSION_CURRENT, StopFilter.makeStopSet(TEST_VERSION_CURRENT, "the", "foo"))); Query result = qp.parse("a:the OR a:foo"); assertNotNull("result is null and it shouldn't be", result); assertTrue("result is not a BooleanQuery", result instanceof BooleanQuery); @@ -974,7 +973,7 @@ } public void testPositionIncrement() throws Exception { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "a", new StopAnalyzer(Version.LUCENE_CURRENT, StopFilter.makeStopSet(Version.LUCENE_CURRENT, "the", "in", "are", "this"))); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "a", new StopAnalyzer(TEST_VERSION_CURRENT, StopFilter.makeStopSet(TEST_VERSION_CURRENT, "the", "in", "are", "this"))); qp.setEnablePositionIncrements(true); String qtxt = "\"the words in poisitions pos02578 are stopped in this phrasequery\""; // 0 2 5 7 8 @@ -991,7 +990,7 @@ } public void testMatchAllDocs() throws Exception { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "field", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); assertEquals(new MatchAllDocsQuery(), qp.parse("*:*")); assertEquals(new MatchAllDocsQuery(), qp.parse("(*:*)")); BooleanQuery bq = (BooleanQuery)qp.parse("+*:* -*:*"); @@ -1000,7 +999,7 @@ } private void assertHits(int expected, String query, IndexSearcher is) throws ParseException, IOException { - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "date", new WhitespaceAnalyzer(Version.LUCENE_CURRENT)); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "date", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)); qp.setLocale(Locale.ENGLISH); Query q = qp.parse(query); ScoreDoc[] hits = is.search(q, null, 1000).scoreDocs; @@ -1028,7 +1027,7 @@ // "match" public void testPositionIncrements() throws Exception { Directory dir = new MockRAMDirectory(); - Analyzer a = new StandardAnalyzer(Version.LUCENE_CURRENT); + Analyzer a = new StandardAnalyzer(TEST_VERSION_CURRENT); IndexWriter w = new IndexWriter(dir, a, IndexWriter.MaxFieldLength.UNLIMITED); Document doc = new Document(); doc.add(new Field("f", "the wizard of ozzy", Field.Store.NO, Field.Index.ANALYZED)); @@ -1036,7 +1035,7 @@ IndexReader r = w.getReader(); w.close(); IndexSearcher s = new IndexSearcher(r); - QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "f", a); + QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "f", a); Query q = qp.parse("\"wizard of ozzy\""); assertEquals(1, s.search(q, 1).totalHits); r.close(); Modified: lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java Wed Feb 10 13:35:57 2010 @@ -20,8 +20,6 @@ import java.util.Random; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; - import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -98,7 +96,7 @@ try { /* build an index */ - IndexWriter writer = new IndexWriter(index.index, new SimpleAnalyzer(Version.LUCENE_CURRENT), T, + IndexWriter writer = new IndexWriter(index.index, new SimpleAnalyzer(TEST_VERSION_CURRENT), T, IndexWriter.MaxFieldLength.LIMITED); for (int d = minId; d <= maxId; d++) { Modified: lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java Wed Feb 10 13:35:57 2010 @@ -15,7 +15,7 @@ import org.apache.lucene.index.MultiReader; import org.apache.lucene.index.IndexWriter.MaxFieldLength; import org.apache.lucene.store.RAMDirectory; -import org.apache.lucene.util.Version; +import static org.apache.lucene.util.LuceneTestCaseJ4.TEST_VERSION_CURRENT; /** * Copyright 2005 Apache Software Foundation @@ -200,7 +200,7 @@ private static RAMDirectory makeEmptyIndex(final int numDeletedDocs) throws IOException { RAMDirectory d = new RAMDirectory(); - IndexWriter w = new IndexWriter(d, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, + IndexWriter w = new IndexWriter(d, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.LIMITED); for (int i = 0; i < numDeletedDocs; i++) { w.addDocument(new Document()); Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java?rev=908496&r1=908495&r2=908496&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java Wed Feb 10 13:35:57 2010 @@ -32,7 +32,6 @@ import org.apache.lucene.store.MockRAMDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Version; /** Test BooleanQuery2 against BooleanQuery by overriding the standard query parser. * This also tests the scoring order of BooleanQuery. @@ -51,7 +50,7 @@ public void setUp() throws Exception { super.setUp(); RAMDirectory directory = new RAMDirectory(); - IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); + IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED); for (int i = 0; i < docFields.length; i++) { Document doc = new Document(); doc.add(new Field(field, docFields[i], Field.Store.NO, Field.Index.ANALYZED)); @@ -68,14 +67,14 @@ int docCount = 0; do { final Directory copy = new RAMDirectory(dir2); - IndexWriter w = new IndexWriter(dir2, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); + IndexWriter w = new IndexWriter(dir2, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); w.addIndexesNoOptimize(new Directory[] {copy}); docCount = w.maxDoc(); w.close(); mulFactor *= 2; } while(docCount < 3000); - IndexWriter w = new IndexWriter(dir2, new WhitespaceAnalyzer(Version.LUCENE_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); + IndexWriter w = new IndexWriter(dir2, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), IndexWriter.MaxFieldLength.UNLIMITED); Document doc = new Document(); doc.add(new Field("field2", "xxx", Field.Store.NO, Field.Index.ANALYZED)); for(int i=0;i