lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r923112 [1/2] - in /lucene/java/trunk: ./ contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/ contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/ contrib/db/bdb-je/src/test/org/apache/lucene/store/je/ contrib/d...
Date Mon, 15 Mar 2010 08:26:45 GMT
Author: uschindler
Date: Mon Mar 15 08:26:44 2010
New Revision: 923112

URL: http://svn.apache.org/viewvc?rev=923112&view=rev
Log:
LUCENE-2313: Add VERBOSE flag usage to lots of tests

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java
    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
    lucene/java/trunk/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java
    lucene/java/trunk/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java
    lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java
    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
    lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
    lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java
    lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
    lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestByteSlices.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
    lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java
    lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Mon Mar 15 08:26:44 2010
@@ -258,10 +258,11 @@ Test Cases
   from LuceneTestCase(J4), that contains the release version.
   (Uwe Schindler, Simon Willnauer, Shai Erera)
 
-* LUCENE-2313: Add VERBOSE to LuceneTestCase(J4) to control verbosity
-  of tests. If VERBOSE==false (default) tests should not print anything
-  other than errors to System.(out|err). The setting can be changed with
-  -Dtests.verbose=true on test invokation.  (Shai Erera via Uwe Schindler)
+* LUCENE-2313, LUCENE-2322: Add VERBOSE to LuceneTestCase(J4) to control
+  verbosity of tests. If VERBOSE==false (default) tests should not print
+  anything other than errors to System.(out|err). The setting can be
+  changed with -Dtests.verbose=true on test invokation.
+  (Shai Erera, Paul Elschot, Uwe Schindler)
 
 * LUCENE-2318: Remove inconsistent system property code for retrieving
   temp and data directories inside test cases. It is now centralized in

Modified: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java Mon Mar 15 08:26:44 2010
@@ -84,7 +84,7 @@ public class TestSnowballVocab extends B
    */
   private void assertCorrectOutput(String snowballLanguage, String dataDirectory)
       throws IOException {
-    System.err.println("checking snowball language: " + snowballLanguage);
+    if (VERBOSE) System.out.println("checking snowball language: " + snowballLanguage);
     TokenStream filter = new SnowballFilter(tokenizer, snowballLanguage);
     InputStream vocFile = new FileInputStream(new File(dataRoot, 
         dataDirectory + "/voc.txt"));

Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (original)
+++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java Mon Mar 15 08:26:44 2010
@@ -56,7 +56,6 @@ import org.apache.lucene.util.LuceneTest
  */
 public class TestPerfTasksLogic extends LuceneTestCase {
 
-  private static final boolean DEBUG = false;
   static final String NEW_LINE = System.getProperty("line.separator");
   
   // properties in effect in all tests here
@@ -550,7 +549,7 @@ public class TestPerfTasksLogic extends 
   }
 
   private static void logTstLogic (String txt) {
-    if (!DEBUG) 
+    if (!VERBOSE) 
       return;
     System.out.println("Test logic of:");
     System.out.println(txt);

Modified: lucene/java/trunk/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java (original)
+++ lucene/java/trunk/contrib/db/bdb-je/src/test/org/apache/lucene/store/je/JEStoreTest.java Mon Mar 15 08:26:44 2010
@@ -127,7 +127,7 @@ public class JEStoreTest extends LuceneT
         Transaction txn = env.beginTransaction(null, null);
         Directory store = null;
 
-        System.out.println("Writing files byte by byte");
+        if (VERBOSE) System.out.println("Writing files byte by byte");
 
         try {
             store = new JEDirectory(txn, index, blocks);
@@ -159,11 +159,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to create, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to create, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -208,11 +210,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -244,11 +248,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete");
 
-        System.out.print(end.getTime() - veryStart.getTime());
-        System.out.println(" total milliseconds");
+          System.out.print(end.getTime() - veryStart.getTime());
+          System.out.println(" total milliseconds");
+        }
     }
 
     public void testDelete() throws Exception {
@@ -267,7 +273,7 @@ public class JEStoreTest extends LuceneT
         Transaction txn = env.beginTransaction(null, null);
         Directory store = null;
 
-        System.out.println("Writing files byte by byte");
+        if (VERBOSE) System.out.println("Writing files byte by byte");
 
         try {
             store = new JEDirectory(txn, index, blocks);
@@ -299,11 +305,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -337,14 +345,16 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete even files");
-
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to create, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete even files");
+
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to create, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -395,11 +405,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -434,11 +446,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete");
 
-        System.out.print(end.getTime() - veryStart.getTime());
-        System.out.println(" total milliseconds");
+          System.out.print(end.getTime() - veryStart.getTime());
+          System.out.println(" total milliseconds");
+        }
 
         Cursor cursor = null;
         try {
@@ -491,7 +505,7 @@ public class JEStoreTest extends LuceneT
         Transaction txn = env.beginTransaction(null, null);
         Directory store = null;
 
-        System.out.println("Writing files as one byte array");
+        if (VERBOSE) System.out.println("Writing files as one byte array");
 
         try {
             store = new JEDirectory(txn, index, blocks);
@@ -521,11 +535,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to create, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to create, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -571,11 +587,13 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -607,10 +625,12 @@ public class JEStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete");
 
-        System.out.print(end.getTime() - veryStart.getTime());
-        System.out.println(" total milliseconds");
+          System.out.print(end.getTime() - veryStart.getTime());
+          System.out.println(" total milliseconds");
+        }
     }
 }

Modified: lucene/java/trunk/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java (original)
+++ lucene/java/trunk/contrib/db/bdb/src/test/org/apache/lucene/store/db/DbStoreTest.java Mon Mar 15 08:26:44 2010
@@ -129,7 +129,7 @@ public class DbStoreTest extends LuceneT
         Transaction txn = env.beginTransaction(null, null);
         Directory store = null;
 
-        System.out.println("Writing files byte by byte");
+        if (VERBOSE) System.out.println("Writing files byte by byte");
 
         try {
             store = new DbDirectory(txn, index, blocks);
@@ -161,11 +161,13 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to create, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to create, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -211,11 +213,13 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -248,11 +252,13 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete");
 
-        System.out.print(end.getTime() - veryStart.getTime());
-        System.out.println(" total milliseconds");
+          System.out.print(end.getTime() - veryStart.getTime());
+          System.out.println(" total milliseconds");
+        }
     }
 
     public void testArrays()
@@ -274,7 +280,7 @@ public class DbStoreTest extends LuceneT
         Transaction txn = env.beginTransaction(null, null);
         Directory store = null;
 
-        System.out.println("Writing files as one byte array");
+        if (VERBOSE) System.out.println("Writing files as one byte array");
 
         try {
             store = new DbDirectory(txn, index, blocks);
@@ -304,11 +310,13 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to create, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to create, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -355,11 +363,13 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        duration = (int) (end.getTime() - start.getTime());
-        System.out.print(duration);
-        System.out.print(" total milliseconds to read, ");
-        System.out.print(totalLength / duration);
-        System.out.println(" kb/s");
+        if (VERBOSE) {
+          duration = (int) (end.getTime() - start.getTime());
+          System.out.print(duration);
+          System.out.print(" total milliseconds to read, ");
+          System.out.print(totalLength / duration);
+          System.out.println(" kb/s");
+        }
 
         try {
             txn = env.beginTransaction(null, null);
@@ -392,10 +402,12 @@ public class DbStoreTest extends LuceneT
 
         end = new Date();
 
-        System.out.print(end.getTime() - start.getTime());
-        System.out.println(" total milliseconds to delete");
+        if (VERBOSE) {
+          System.out.print(end.getTime() - start.getTime());
+          System.out.println(" total milliseconds to delete");
 
-        System.out.print(end.getTime() - veryStart.getTime());
-        System.out.println(" total milliseconds");
+          System.out.print(end.getTime() - veryStart.getTime());
+          System.out.println(" total milliseconds");
+        }
     }
 }

Modified: lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java (original)
+++ lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java Mon Mar 15 08:26:44 2010
@@ -48,7 +48,7 @@ public class SimpleFragListBuilderTest e
     SimpleFragListBuilder sflb = new SimpleFragListBuilder();
     FieldFragList ffl = sflb.createFieldFragList( fpl( "\"abcdefgh jklmnopqrs\"", "abcdefgh   jklmnopqrs" ), SimpleFragListBuilder.MIN_FRAG_CHAR_SIZE );
     assertEquals( 1, ffl.fragInfos.size() );
-    System.out.println( ffl.fragInfos.get( 0 ).toString() );
+    if (VERBOSE) System.out.println( ffl.fragInfos.get( 0 ).toString() );
     assertEquals( "subInfos=(abcdefghjklmnopqrs((0,21)))/1.0(0,21)", ffl.fragInfos.get( 0 ).toString() );
   }
   

Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Mon Mar 15 08:26:44 2010
@@ -140,7 +140,7 @@ public class HighlighterTest extends Bas
 
       String fragment = highlighter.getBestFragment(stream, storedField);
 
-      System.out.println(fragment);
+      if (VERBOSE) System.out.println(fragment);
     }
   }
   
@@ -156,7 +156,7 @@ public class HighlighterTest extends Bas
     Query q = parser.parse("\"world Flatland\"~3");
     String expected = "I call our <B>world</B> <B>Flatland</B>, not because we call it so,";
     String observed = highlightField(q, "SOME_FIELD_NAME", s1);
-    System.out.println("Expected: \"" + expected + "\n" + "Observed: \"" + observed);
+    if (VERBOSE) System.out.println("Expected: \"" + expected + "\n" + "Observed: \"" + observed);
     assertEquals("Query in the default field results in text for *ANY* field being highlighted",
         expected, observed);
 
@@ -168,7 +168,7 @@ public class HighlighterTest extends Bas
     q = parser.parse("text:\"world Flatland\"~3");
     expected = s1;
     observed = highlightField(q, FIELD_NAME, s1);
-    System.out.println("Expected: \"" + expected + "\n" + "Observed: \"" + observed);
+    if (VERBOSE) System.out.println("Expected: \"" + expected + "\n" + "Observed: \"" + observed);
     assertEquals(
         "Query in a named field does not result in highlighting when that field isn't in the query",
         s1, highlightField(q, FIELD_NAME, s1));
@@ -207,7 +207,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
 
     // Not sure we can assert anything here - just running to check we dont
@@ -256,7 +256,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
 
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -278,7 +278,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
 
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -300,7 +300,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
 
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -326,7 +326,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -350,7 +350,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -375,7 +375,7 @@ public class HighlighterTest extends Bas
 
 //      String result = 
         highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,"...");
-      //System.out.println("\t" + result);
+      //if (VERBOSE) System.out.println("\t" + result);
     }
 
 
@@ -396,7 +396,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
 
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
@@ -418,7 +418,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
 
       assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
           numHighlights == 3);
@@ -441,7 +441,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text,
           maxNumFragmentsRequired, "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
 
     }
     
@@ -460,7 +460,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text,
           maxNumFragmentsRequired, "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
 
     }
   }
@@ -482,7 +482,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
 
       assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
           numHighlights == 4);
@@ -551,7 +551,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     // Not sure we can assert anything here - just running to check we dont
     // throw any exceptions
@@ -700,7 +700,7 @@ public class HighlighterTest extends Bas
     // can't rewrite ConstantScore if you want to highlight it -
     // it rewrites to ConstantScoreQuery which cannot be highlighted
     // query = unReWrittenQuery.rewrite(reader);
-    System.out.println("Searching for: " + query.toString(FIELD_NAME));
+    if (VERBOSE) System.out.println("Searching for: " + query.toString(FIELD_NAME));
     hits = searcher.search(query, null, 1000);
 
     for (int i = 0; i < hits.totalHits; i++) {
@@ -720,7 +720,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           fragmentSeparator);
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
         numHighlights == 5);
@@ -748,7 +748,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           fragmentSeparator);
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
         numHighlights == 5);
@@ -776,7 +776,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           fragmentSeparator);
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
     }
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
         numHighlights == 5);
@@ -932,7 +932,7 @@ public class HighlighterTest extends Bas
               HighlighterTest.this);
           highlighter.setTextFragmenter(new SimpleFragmenter(40));
           String result = highlighter.getBestFragment(tokenStream, text);
-          System.out.println("\t" + result);
+          if (VERBOSE) System.out.println("\t" + result);
         }
         assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
             numHighlights == 4);
@@ -1063,7 +1063,7 @@ public class HighlighterTest extends Bas
           Highlighter highlighter = getHighlighter(query, FIELD_NAME, tokenStream,
               HighlighterTest.this);
           String result = highlighter.getBestFragment(tokenStream, text);
-          System.out.println("\t" + result);
+          if (VERBOSE) System.out.println("\t" + result);
         }
         assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
             numHighlights == 4);
@@ -1097,7 +1097,7 @@ public class HighlighterTest extends Bas
           assertTrue("Failed to find correct number of text Fragments: " + fragmentResults.length
               + " vs " + stringResults.length, fragmentResults.length == stringResults.length);
           for (int j = 0; j < stringResults.length; j++) {
-            System.out.println(fragmentResults[j]);
+            if (VERBOSE) System.out.println(fragmentResults[j]);
             assertTrue("Failed to find same text Fragments: " + fragmentResults[j] + " found",
                 fragmentResults[j].toString().equals(stringResults[j]));
 
@@ -1215,7 +1215,7 @@ public class HighlighterTest extends Bas
 
         QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
         Query query = parser.parse("JF? or Kenned*");
-        System.out.println("Searching with primitive query");
+        if (VERBOSE) System.out.println("Searching with primitive query");
         // forget to set this and...
         // query=query.rewrite(reader);
         TopDocs hits = searcher.search(query, null, 1000);
@@ -1238,7 +1238,7 @@ public class HighlighterTest extends Bas
           String highlightedText = highlighter.getBestFragments(tokenStream, text,
               maxNumFragmentsRequired, "...");
 
-          System.out.println(highlightedText);
+          if (VERBOSE) System.out.println(highlightedText);
         }
         // We expect to have zero highlights if the query is multi-terms and is
         // not
@@ -1353,7 +1353,7 @@ public class HighlighterTest extends Bas
     QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, new StandardAnalyzer(TEST_VERSION_CURRENT));
     parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
     query = parser.parse("multi*");
-    System.out.println("Searching for: " + query.toString(FIELD_NAME));
+    if (VERBOSE) System.out.println("Searching for: " + query.toString(FIELD_NAME));
     // at this point the multisearcher calls combine(query[])
     hits = multiSearcher.search(query, null, 1000);
 
@@ -1371,7 +1371,7 @@ public class HighlighterTest extends Bas
       String text = multiSearcher.doc(hits.scoreDocs[i].doc).get(FIELD_NAME);
       TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new StringReader(text));
       String highlightedText = highlighter.getBestFragment(tokenStream, text);
-      System.out.println(highlightedText);
+      if (VERBOSE) System.out.println(highlightedText);
     }
     assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
         numHighlights == 2);
@@ -1645,7 +1645,7 @@ public class HighlighterTest extends Bas
     for( int i = 0; i < hits.totalHits; i++ ){
       Document doc = searcher.doc( hits.scoreDocs[i].doc );
       String result = h.getBestFragment( a, "t_text1", doc.get( "t_text1" ));
-      System.out.println("result:" +  result);
+      if (VERBOSE) System.out.println("result:" +  result);
       assertEquals("more <B>random</B> words for second field", result);
     }
     searcher.close();
@@ -1698,7 +1698,7 @@ public class HighlighterTest extends Bas
     // for any multi-term queries to work (prefix, wildcard, range,fuzzy etc)
     // you must use a rewritten query!
     query = unReWrittenQuery.rewrite(reader);
-    System.out.println("Searching for: " + query.toString(FIELD_NAME));
+    if (VERBOSE) System.out.println("Searching for: " + query.toString(FIELD_NAME));
     hits = searcher.search(query, null, 1000);
   }
 
@@ -1714,7 +1714,7 @@ public class HighlighterTest extends Bas
 
       String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
           "...");
-      System.out.println("\t" + result);
+      if (VERBOSE) System.out.println("\t" + result);
 
       assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
           numHighlights == expectedHighlights);
@@ -1936,16 +1936,16 @@ class SynonymTokenizer extends TokenStre
 
         String result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired,
             fragmentSeparator);
-        System.out.println("\t" + result);
+        if (HighlighterTest.VERBOSE) System.out.println("\t" + result);
       }
     }
 
     abstract void run() throws Exception;
 
     void start() throws Exception {
-      System.out.println("Run QueryScorer");
+      if (HighlighterTest.VERBOSE) System.out.println("Run QueryScorer");
       run();
-      System.out.println("Run QueryTermScorer");
+      if (HighlighterTest.VERBOSE) System.out.println("Run QueryTermScorer");
       mode = QUERY_TERM;
       run();
     }

Modified: lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Mon Mar 15 08:26:44 2010
@@ -202,8 +202,6 @@ public class MemoryIndexTest extends Bas
   
   private Analyzer analyzer;
   
-  private final boolean verbose = false;
-  
   private static final String FIELD_NAME = "content";
 
   /** Runs the tests and/or benchmark */
@@ -227,7 +225,7 @@ public class MemoryIndexTest extends Bas
       "src/java/test/org/apache/lucene/queryParser/*.java",
       "contrib/memory/src/java/org/apache/lucene/index/memory/*.java",
     });
-    System.out.println("files = " + java.util.Arrays.asList(files));
+    if (VERBOSE) System.out.println("files = " + java.util.Arrays.asList(files));
     String[] xargs = new String[] {
       "1", "1", "memram", 
       "@contrib/memory/src/test/org/apache/lucene/index/memory/testqueries.txt",
@@ -285,7 +283,7 @@ public class MemoryIndexTest extends Bas
     boolean first = true;
 
     for (int iter=0; iter < iters; iter++) {
-      System.out.println("\n########### iteration=" + iter);
+      if (VERBOSE) System.out.println("\n########### iteration=" + iter);
       long start = System.currentTimeMillis();            
       long bytes = 0;
       
@@ -298,7 +296,7 @@ public class MemoryIndexTest extends Bas
           bytes += file.length();
           String text = toString(new FileInputStream(file), null);
           Document doc = createDocument(text);
-          if (verbose) System.out.println("\n*********** FILE=" + file);
+          if (VERBOSE) System.out.println("\n*********** FILE=" + file);
           
           boolean measureIndexing = false; // toggle this to measure query performance
           MemoryIndex memind = null;
@@ -342,7 +340,7 @@ public class MemoryIndexTest extends Bas
                 }
                 if (useRAMIndex) score2 = query(ramsearcher, query);
                 if (useMemIndex && useRAMIndex) {
-                  if (verbose) System.out.println("diff="+ (score1-score2) + ", query=" + queries[q] + ", s1=" + score1 + ", s2=" + score2);
+                  if (VERBOSE) System.out.println("diff="+ (score1-score2) + ", query=" + queries[q] + ", s1=" + score1 + ", s2=" + score2);
                   if (score1 != score2 || score1 < 0.0f || score2 < 0.0f || score1 > 1.0f || score2 > 1.0f) {
                     throw new IllegalStateException("BUG DETECTED:" + (i*(q+1)) + " at query=" + queries[q] + ", file=" + file + ", anal=" + analyzer);
                   }
@@ -351,21 +349,25 @@ public class MemoryIndexTest extends Bas
 
             } catch (Throwable t) {
               if (t instanceof OutOfMemoryError) t.printStackTrace();
-              System.out.println("Fatal error at query=" + queries[q] + ", file=" + file + ", anal=" + analyzer);
+              if (VERBOSE) System.out.println("Fatal error at query=" + queries[q] + ", file=" + file + ", anal=" + analyzer);
               throw t;
             }
           }
         }
       }
       long end = System.currentTimeMillis();
-      System.out.println("\nsecs = " + ((end-start)/1000.0f));
-      System.out.println("queries/sec= " + 
+      if (VERBOSE) {
+        System.out.println("\nsecs = " + ((end-start)/1000.0f));
+        System.out.println("queries/sec= " + 
         (1.0f * runs * queries.length * analyzers.length * files.length 
             / ((end-start)/1000.0f)));
-      float mb = (1.0f * bytes * queries.length * runs) / (1024.0f * 1024.0f);
-      System.out.println("MB/sec = " + (mb / ((end-start)/1000.0f)));
+        float mb = (1.0f * bytes * queries.length * runs) / (1024.0f * 1024.0f);
+        System.out.println("MB/sec = " + (mb / ((end-start)/1000.0f)));
+      }
     }
     
+    if (!VERBOSE) return;
+    
     if (useMemIndex && useRAMIndex) 
       System.out.println("No bug found. done.");
     else 

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java Mon Mar 15 08:26:44 2010
@@ -19,8 +19,6 @@ package org.apache.lucene.queryParser.sp
 
 import javax.management.Query;
 
-import junit.framework.TestCase;
-
 import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
 import org.apache.lucene.queryParser.core.nodes.OrQueryNode;
 import org.apache.lucene.queryParser.core.nodes.QueryNode;
@@ -29,6 +27,7 @@ import org.apache.lucene.queryParser.cor
 import org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser;
 import org.apache.lucene.search.spans.SpanQuery;
 import org.apache.lucene.search.spans.SpanTermQuery;
+import org.apache.lucene.util.LuceneTestCase;
 
 /**
  * This test case demonstrates how the new query parser can be used.<br/>
@@ -94,7 +93,7 @@ import org.apache.lucene.search.spans.Sp
  * @see UniqueFieldAttribute
  * 
  */
-public class TestSpanQueryParserSimpleSample extends TestCase {
+public class TestSpanQueryParserSimpleSample extends LuceneTestCase {
 
   public TestSpanQueryParserSimpleSample() {
     // empty constructor
@@ -104,12 +103,6 @@ public class TestSpanQueryParserSimpleSa
     super(testName);
   }
 
-  public static junit.framework.Test suite() {
-    junit.framework.TestSuite suite = new junit.framework.TestSuite(
-        TestSpanQueryParserSimpleSample.class);
-    return suite;
-  }
-
   public void testBasicDemo() throws Exception {
     SyntaxParser queryParser = new StandardSyntaxParser();
 
@@ -133,13 +126,13 @@ public class TestSpanQueryParserSimpleSa
     spanProcessorPipeline.addProcessor(new UniqueFieldQueryNodeProcessor());
 
     // print to show out the QueryNode tree before being processed
-    System.out.println(queryTree);
+    if (VERBOSE) System.out.println(queryTree);
 
     // Process the QueryTree using our new Processors
     queryTree = spanProcessorPipeline.process(queryTree);
 
     // print to show out the QueryNode tree after being processed
-    System.out.println(queryTree);
+    if (VERBOSE) System.out.println(queryTree);
 
     // create a instance off the Builder
     SpansQueryTreeBuilder spansQueryTreeBuilder = new SpansQueryTreeBuilder();

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java Mon Mar 15 08:26:44 2010
@@ -1071,7 +1071,7 @@ public class TestQueryParserWrapper exte
         .parse("(fieldX:xxxxx OR fieldy:xxxxxxxx)^2 AND (fieldx:the OR fieldy:foo)");
     assertNotNull("result is null and it shouldn't be", result);
     assertTrue("result is not a BooleanQuery", result instanceof BooleanQuery);
-    System.out.println("Result: " + result);
+    if (VERBOSE) System.out.println("Result: " + result);
     assertTrue(((BooleanQuery) result).clauses().size() + " does not equal: "
         + 2, ((BooleanQuery) result).clauses().size() == 2);
   }

Modified: lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java (original)
+++ lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java Mon Mar 15 08:26:44 2010
@@ -151,13 +151,15 @@ public class TestCartesian extends Lucen
     LatLng p1 = new FloatLatLng( 7.06, 171.2 );
     LatLng p2 = new FloatLatLng( 21.6032207, -158.0 );
     double miles = p1.arcDistance( p2, DistanceUnits.MILES );
-    System.out.println("testDistances");
-    System.out.println("miles:" + miles);
+    if (VERBOSE) {
+      System.out.println("testDistances");
+      System.out.println("miles:" + miles);
+    }
     assertEquals(2288.82495932794, miles); 
     LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
     LatLng p4 = new FloatLatLng( 55.0, 4.0 );
     miles = p3.arcDistance( p4, DistanceUnits.MILES );
-    System.out.println("miles:" + miles);
+    if (VERBOSE) System.out.println("miles:" + miles);
     assertEquals(3474.331719997617, miles); 
   }
 
@@ -170,12 +172,12 @@ public class TestCartesian extends Lucen
     lat = 21.6032207;
     lng = -158.0;
 
-    System.out.println("testAntiM");
+    if (VERBOSE) System.out.println("testAntiM");
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
         latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
 
-    System.out.println(dq);
+    if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
     Query tq = new TermQuery(new Term("metafile", "doc"));
 
@@ -188,7 +190,7 @@ public class TestCartesian extends Lucen
         return new CustomScoreProvider(reader) {
           @Override // TODO: broken, as reader is not used!
           public float customScore(int doc, float subQueryScore, float valSrcScore){
-            System.out.println(doc);
+            if (VERBOSE) System.out.println(doc);
             if (dq.distanceFilter.getDistance(doc) == null)
               return 0;
 
@@ -228,11 +230,13 @@ public class TestCartesian extends Lucen
     // Note Boundary Box filtering, is not accurate enough for most systems.
 
 
-    System.out.println("Distance Filter filtered: " + distances.size());
-    System.out.println("Results: " + results);
-    System.out.println("=============================");
-    System.out.println("Distances should be 2 "+ distances.size());
-    System.out.println("Results should be 2 "+ results);
+    if (VERBOSE) {
+      System.out.println("Distance Filter filtered: " + distances.size());
+      System.out.println("Results: " + results);
+      System.out.println("=============================");
+      System.out.println("Distances should be 2 "+ distances.size());
+      System.out.println("Results should be 2 "+ results);
+    }
 
     assertEquals(2, distances.size()); // fixed a store of only needed distances
     assertEquals(2, results);
@@ -247,7 +251,7 @@ public class TestCartesian extends Lucen
 
       double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
       double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-      System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+      if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
       assertTrue(Math.abs((distance - llm)) < 1);
       assertTrue((distance < miles ));
       assertTrue(geo_distance >= lastDistance);
@@ -262,13 +266,13 @@ public class TestCartesian extends Lucen
     lat = 41.6032207;
     lng = -73.087749;
 
-    System.out.println("testPoleFlipping");
+    if (VERBOSE) System.out.println("testPoleFlipping");
 
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
         latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
 
-    System.out.println(dq);
+    if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
     Query tq = new TermQuery(new Term("metafile", "doc"));
 
@@ -281,7 +285,7 @@ public class TestCartesian extends Lucen
         return new CustomScoreProvider(reader) {
           @Override // TODO: broken, as reader is not used!
           public float customScore(int doc, float subQueryScore, float valSrcScore){
-            System.out.println(doc);
+            if (VERBOSE) System.out.println(doc);
             if (dq.distanceFilter.getDistance(doc) == null)
               return 0;
 
@@ -321,11 +325,13 @@ public class TestCartesian extends Lucen
     // Note Boundary Box filtering, is not accurate enough for most systems.
 
 
-    System.out.println("Distance Filter filtered: " + distances.size());
-    System.out.println("Results: " + results);
-    System.out.println("=============================");
-    System.out.println("Distances should be 18 "+ distances.size());
-    System.out.println("Results should be 18 "+ results);
+    if (VERBOSE) {
+      System.out.println("Distance Filter filtered: " + distances.size());
+      System.out.println("Results: " + results);
+      System.out.println("=============================");
+      System.out.println("Distances should be 18 "+ distances.size());
+      System.out.println("Results should be 18 "+ results);
+    }
 
     assertEquals(18, distances.size()); // fixed a store of only needed distances
     assertEquals(18, results);
@@ -339,11 +345,11 @@ public class TestCartesian extends Lucen
 
       double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
       double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-      System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+      if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
       assertTrue(Math.abs((distance - llm)) < 1);
-      System.out.println("checking limit "+ distance + " < " + miles);
+      if (VERBOSE) System.out.println("checking limit "+ distance + " < " + miles);
       assertTrue((distance < miles ));
-      System.out.println("checking sort "+ geo_distance + " >= " + lastDistance);
+      if (VERBOSE) System.out.println("checking sort "+ geo_distance + " >= " + lastDistance);
       assertTrue(geo_distance >= lastDistance);
       lastDistance = geo_distance;
     }
@@ -363,7 +369,7 @@ public class TestCartesian extends Lucen
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
                                                                latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
      
-      System.out.println(dq);
+      if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents
       Query tq = new TermQuery(new Term("metafile", "doc"));
     
@@ -375,7 +381,7 @@ public class TestCartesian extends Lucen
           return new CustomScoreProvider(reader) {
             @Override // TODO: broken, as reader is not used!
             public float customScore(int doc, float subQueryScore, float valSrcScore){
-              //System.out.println(doc);
+              if (VERBOSE) System.out.println(doc);
               if (dq.distanceFilter.getDistance(doc) == null)
                 return 0;
           
@@ -413,12 +419,13 @@ public class TestCartesian extends Lucen
     
       // Note Boundary Box filtering, is not accurate enough for most systems.
     
-    
-      System.out.println("Distance Filter filtered: " + distances.size());
-      System.out.println("Results: " + results);
-      System.out.println("=============================");
-      System.out.println("Distances should be 7 "+ expected[x] + ":" + distances.size());
-      System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+      if (VERBOSE) {
+        System.out.println("Distance Filter filtered: " + distances.size());
+        System.out.println("Results: " + results);
+        System.out.println("=============================");
+        System.out.println("Distances should be 7 "+ expected[x] + ":" + distances.size());
+        System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+      }
 
       assertEquals(expected[x], distances.size()); // fixed a store of only needed distances
       assertEquals(expected[x], results);
@@ -433,7 +440,7 @@ public class TestCartesian extends Lucen
       
         double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
         double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-        System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+        if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
         assertTrue(Math.abs((distance - llm)) < 1);
         assertTrue((distance < miles ));
         assertTrue(geo_distance > lastDistance);
@@ -457,7 +464,7 @@ public class TestCartesian extends Lucen
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
                                                                geoHashPrefix, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
 	     
-      System.out.println(dq);
+      if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents
       Query tq = new TermQuery(new Term("metafile", "doc"));
 	    
@@ -468,7 +475,7 @@ public class TestCartesian extends Lucen
           return new CustomScoreProvider(reader) {
               @Override // TODO: broken, as reader is not used!
               public float customScore(int doc, float subQueryScore, float valSrcScore){
-              //System.out.println(doc);
+              if (VERBOSE) System.out.println(doc);
               if (dq.distanceFilter.getDistance(doc) == null)
                 return 0;
             
@@ -506,12 +513,13 @@ public class TestCartesian extends Lucen
 	    
       // Note Boundary Box filtering, is not accurate enough for most systems.
 	    
-	    
-      System.out.println("Distance Filter filtered: " + distances.size());
-      System.out.println("Results: " + results);
-      System.out.println("=============================");
-      System.out.println("Distances should be 14 "+ expected[x] + ":" + distances.size());
-      System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+	    if (VERBOSE) {
+        System.out.println("Distance Filter filtered: " + distances.size());
+        System.out.println("Results: " + results);
+        System.out.println("=============================");
+        System.out.println("Distances should be 14 "+ expected[x] + ":" + distances.size());
+        System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+      }
 
       assertEquals(expected[x], distances.size());
       assertEquals(expected[x], results);
@@ -526,7 +534,7 @@ public class TestCartesian extends Lucen
 	      
         double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
         double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-        System.out.println("Name: "+ name +", Distance (res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ scoreDocs[i].score);
+        if (VERBOSE) System.out.println("Name: "+ name +", Distance (res, ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ scoreDocs[i].score);
         assertTrue(Math.abs((distance - llm)) < 1);
         assertTrue((distance < miles ));
 	      

Modified: lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java (original)
+++ lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java Mon Mar 15 08:26:44 2010
@@ -106,7 +106,7 @@ public class TestDistance extends Lucene
     }
   }
  
-  
+  /* these tests do not test anything, as no assertions:
   public void testMiles() {
     double LLM = DistanceUtils.getInstance().getLLMDistance(lat, lng,39.012200001, -77.3942);
     System.out.println(LLM);
@@ -120,7 +120,7 @@ public class TestDistance extends Lucene
     System.out.println("-->"+DistanceUtils.getInstance().getDistanceMi(44.30073, -78.32131, 43.687267, -79.39842));
     
   }
-
+  */
   
 //  public void testDistanceQueryCacheable() throws IOException {
 //

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java Mon Mar 15 08:26:44 2010
@@ -54,7 +54,6 @@ public class SrndPrefixQuery extends Sim
   {
     /* inspired by PrefixQuery.rewrite(): */
     TermEnum enumerator = reader.terms(getLucenePrefixTerm(fieldName));
-    boolean expanded = false;
     try {
       do {
         Term term = enumerator.term();
@@ -62,7 +61,6 @@ public class SrndPrefixQuery extends Sim
             && term.text().startsWith(getPrefix())
             && term.field().equals(fieldName)) {
           mtv.visitMatchingTerm(term);
-          expanded = true;
         } else {
           break;
         }
@@ -70,8 +68,5 @@ public class SrndPrefixQuery extends Sim
     } finally {
       enumerator.close();
     }
-    if (! expanded) {
-      System.out.println("No terms in " + fieldName + " field for: " + toString());
-    }
   }
 }

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java Mon Mar 15 08:26:44 2010
@@ -53,8 +53,6 @@ public class SrndTermQuery extends Simpl
           && it.text().equals(getTermText())
           && it.field().equals(fieldName)) {
         mtv.visitMatchingTerm(it);
-      } else {
-        System.out.println("No term in " + fieldName + " field for: " + toString());
       }
     } finally {
       enumerator.close();

Modified: lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java (original)
+++ lucene/java/trunk/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java Mon Mar 15 08:26:44 2010
@@ -83,7 +83,6 @@ public class SrndTruncQuery extends Simp
     String fieldName,
     MatchingTermVisitor mtv) throws IOException
   {
-    boolean expanded = false;
     int prefixLength = prefix.length();
     TermEnum enumerator = reader.terms(new Term(fieldName, prefix));
     Matcher matcher = pattern.matcher("");
@@ -98,7 +97,6 @@ public class SrndTruncQuery extends Simp
             matcher.reset( text.substring(prefixLength));
             if (matcher.matches()) {
               mtv.visitMatchingTerm(term);
-              expanded = true;
             }
           }
         }
@@ -107,8 +105,5 @@ public class SrndTruncQuery extends Simp
       enumerator.close();
       matcher.reset();
     }
-    if (! expanded) {
-      System.out.println("No terms in " + fieldName + " field for: " + toString());
-    }
   }
 }

Modified: lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java Mon Mar 15 08:26:44 2010
@@ -5,8 +5,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 
-import junit.framework.TestCase;
-
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Field;
@@ -20,6 +18,7 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.Version;
+import org.apache.lucene.util.LuceneTestCase;
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -37,7 +36,7 @@ import org.apache.lucene.util.Version;
  * limitations under the License.
  */
 
-public class TestParser extends TestCase {
+public class TestParser extends LuceneTestCase {
 
 	CoreParser builder;
 	static Directory dir;
@@ -45,11 +44,7 @@ public class TestParser extends TestCase
 	Analyzer analyzer=new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_24); 
 	IndexReader reader;
 	private IndexSearcher searcher;
-	
-	//CHANGE THIS TO SEE OUTPUT
-	boolean printResults=false;
-	
-	
+
 	/*
 	 * @see TestCase#setUp()
 	 */
@@ -143,7 +138,7 @@ public class TestParser extends TestCase
 	{
 			Query q=parse("FuzzyLikeThisQuery.xml");
 			//show rewritten fuzzyLikeThisQuery - see what is being matched on
-			if(printResults)
+			if(VERBOSE)
 			{
 				System.out.println(q.rewrite(reader));
 			}
@@ -210,7 +205,7 @@ public class TestParser extends TestCase
 	{
 		TopDocs hits = searcher.search(q, null, numDocs);
 		assertTrue(qType +" should produce results ", hits.totalHits>0);
-		if(printResults)
+		if(VERBOSE)
 		{
 			System.out.println("========="+qType+"============");
 			ScoreDoc[] scoreDocs = hits.scoreDocs;

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java Mon Mar 15 08:26:44 2010
@@ -30,8 +30,6 @@ import java.util.HashSet;
 
 
 public class TestStopFilter extends BaseTokenStreamTestCase {
-
-  private final static boolean VERBOSE = false;
   
   // other StopFilter functionality is already tested by TestStopAnalyzer
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestByteSlices.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestByteSlices.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestByteSlices.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestByteSlices.java Mon Mar 15 08:26:44 2010
@@ -65,36 +65,34 @@ public class TestByteSlices extends Luce
         counters[stream] = 0;
       }
       
-      boolean debug = false;
-
       for(int iter=0;iter<10000;iter++) {
         int stream = r.nextInt(NUM_STREAM);
-        if (debug)
+        if (VERBOSE)
           System.out.println("write stream=" + stream);
 
         if (starts[stream] == -1) {
           final int spot = pool.newSlice(ByteBlockPool.FIRST_LEVEL_SIZE);
           starts[stream] = uptos[stream] = spot + pool.byteOffset;
-          if (debug)
+          if (VERBOSE)
             System.out.println("  init to " + starts[stream]);
         }
 
         writer.init(uptos[stream]);
         int numValue = r.nextInt(20);
         for(int j=0;j<numValue;j++) {
-          if (debug)
+          if (VERBOSE)
             System.out.println("    write " + (counters[stream]+j));
           writer.writeVInt(counters[stream]+j);
           //writer.writeVInt(ti);
         }
         counters[stream] += numValue;
         uptos[stream] = writer.getAddress();
-        if (debug)
+        if (VERBOSE)
           System.out.println("    addr now " + uptos[stream]);
       }
     
       for(int stream=0;stream<NUM_STREAM;stream++) {
-        if (debug)
+        if (VERBOSE)
           System.out.println("  stream=" + stream + " count=" + counters[stream]);
 
         if (starts[stream] != uptos[stream]) {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java Mon Mar 15 08:26:44 2010
@@ -48,7 +48,7 @@ public class TestCheckIndex extends Luce
     ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
     CheckIndex checker = new CheckIndex(dir);
     checker.setInfoStream(new PrintStream(bos));
-    //checker.setInfoStream(System.out);
+    if (VERBOSE) checker.setInfoStream(System.out);
     CheckIndex.Status indexStatus = checker.checkIndex();
     if (indexStatus.clean == false) {
       System.out.println("CheckIndex failed");

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java Mon Mar 15 08:26:44 2010
@@ -50,7 +50,6 @@ public class TestConcurrentMergeSchedule
         for (int i = 0; i < trace.length; i++) {
           if ("doFlush".equals(trace[i].getMethodName())) {
             hitExc = true;
-            //new RuntimeException().printStackTrace(System.out);
             throw new IOException("now failing during flush");
           }
         }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java Mon Mar 15 08:26:44 2010
@@ -267,8 +267,10 @@ public class TestFieldsReader extends Lu
       reader.close();
 
     }
-    System.out.println("Average Non-lazy time (should be very close to zero): " + regularTime / length + " ms for " + length + " reads");
-    System.out.println("Average Lazy Time (should be greater than zero): " + lazyTime / length + " ms for " + length + " reads");
+    if (VERBOSE) {
+      System.out.println("Average Non-lazy time (should be very close to zero): " + regularTime / length + " ms for " + length + " reads");
+      System.out.println("Average Lazy Time (should be greater than zero): " + lazyTime / length + " ms for " + length + " reads");
+    }
   }
   
   public void testLoadSize() throws IOException {

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java Mon Mar 15 08:26:44 2010
@@ -277,7 +277,7 @@ public class TestIndexReader extends Luc
     for (Iterator<TermVectorEntry> iterator = set.iterator(); iterator.hasNext();) {
       TermVectorEntry entry =  iterator.next();
       assertTrue("entry is null and it shouldn't be", entry != null);
-      System.out.println("Entry: " + entry);
+      if (VERBOSE) System.out.println("Entry: " + entry);
     }
     
   }
@@ -869,7 +869,6 @@ public class TestIndexReader extends Luc
      */
     public void testDiskFull() throws IOException {
 
-      boolean debug = false;
       Term searchTerm = new Term("content", "aaa");
       int START_COUNT = 157;
       int END_COUNT = 144;
@@ -926,14 +925,14 @@ public class TestIndexReader extends Luc
             if (diskRatio >= 6.0) {
               rate = 0.0;
             }
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("\ncycle: " + diskFree + " bytes");
             }
             testName = "disk full during reader.close() @ " + thisDiskFree + " bytes";
           } else {
             thisDiskFree = 0;
             rate = 0.0;
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("\ncycle: same writer: unlimited disk space");
             }
             testName = "reader re-use after disk full";
@@ -957,7 +956,7 @@ public class TestIndexReader extends Luc
               done = true;
             }
           } catch (IOException e) {
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("  hit IOException: " + e);
               e.printStackTrace(System.out);
             }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Mar 15 08:26:44 2010
@@ -170,8 +170,6 @@ public class TestIndexWriter extends Luc
       int NUM_DIR = 50;
       int END_COUNT = START_COUNT + NUM_DIR*25;
 
-      boolean debug = false;
-
       // Build up a bunch of dirs that have indexes which we
       // will then merge together by calling addIndexesNoOptimize(*):
       Directory[] dirs = new Directory[NUM_DIR];
@@ -231,7 +229,7 @@ public class TestIndexWriter extends Luc
 
       for(int iter=0;iter<3;iter++) {
 
-        if (debug)
+        if (VERBOSE)
           System.out.println("TEST: iter=" + iter);
 
         // Start with 100 bytes more than we are currently using:
@@ -290,16 +288,16 @@ public class TestIndexWriter extends Luc
               if (diskRatio >= 6.0) {
                 rate = 0.0;
               }
-              if (debug)
+              if (VERBOSE)
                 testName = "disk full test " + methodName + " with disk full at " + diskFree + " bytes";
             } else {
               thisDiskFree = 0;
               rate = 0.0;
-              if (debug)
+              if (VERBOSE)
                 testName = "disk full test " + methodName + " with unlimited disk space";
             }
 
-            if (debug)
+            if (VERBOSE)
               System.out.println("\ncycle: " + testName);
 
             dir.setMaxSizeInBytes(thisDiskFree);
@@ -327,7 +325,7 @@ public class TestIndexWriter extends Luc
               }
 
               success = true;
-              if (debug) {
+              if (VERBOSE) {
                 System.out.println("  success!");
               }
 
@@ -338,7 +336,7 @@ public class TestIndexWriter extends Luc
             } catch (IOException e) {
               success = false;
               err = e;
-              if (debug) {
+              if (VERBOSE) {
                 System.out.println("  hit IOException: " + e);
                 e.printStackTrace(System.out);
               }
@@ -353,7 +351,7 @@ public class TestIndexWriter extends Luc
             // ConcurrentMergeScheduler are done
             _TestUtil.syncConcurrentMerges(writer);
 
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("  now test readers");
             }
 
@@ -404,7 +402,7 @@ public class TestIndexWriter extends Luc
 
             searcher.close();
             reader.close();
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("  count is " + result);
             }
 
@@ -413,7 +411,7 @@ public class TestIndexWriter extends Luc
             }
           }
 
-          if (debug) {
+          if (VERBOSE) {
             System.out.println("  start disk = " + startDiskUsage + "; input disk = " + inputDiskUsage + "; max used = " + dir.getMaxUsedSizeInBytes());
           }
 
@@ -455,15 +453,13 @@ public class TestIndexWriter extends Luc
      */
     public void testAddDocumentOnDiskFull() throws IOException {
 
-      boolean debug = false;
-
       for(int pass=0;pass<2;pass++) {
-        if (debug)
+        if (VERBOSE)
           System.out.println("TEST: pass=" + pass);
         boolean doAbort = pass == 1;
         long diskFree = 200;
         while(true) {
-          if (debug)
+          if (VERBOSE)
             System.out.println("TEST: cycle: diskFree=" + diskFree);
           MockRAMDirectory dir = new MockRAMDirectory();
           dir.setMaxSizeInBytes(diskFree);
@@ -482,7 +478,7 @@ public class TestIndexWriter extends Luc
               addDoc(writer);
             }
           } catch (IOException e) {
-            if (debug) {
+            if (VERBOSE) {
               System.out.println("TEST: exception on addDoc");
               e.printStackTrace(System.out);
             }
@@ -496,7 +492,7 @@ public class TestIndexWriter extends Luc
               try {
                 writer.close();
               } catch (IOException e) {
-                if (debug) {
+                if (VERBOSE) {
                   System.out.println("TEST: exception on close");
                   e.printStackTrace(System.out);
                 }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Mon Mar 15 08:26:44 2010
@@ -407,7 +407,6 @@ public class TestIndexWriterDelete exten
    */
   private void testOperationsOnDiskFull(boolean updates) throws IOException {
 
-    boolean debug = false;
     Term searchTerm = new Term("content", "aaa");
     int START_COUNT = 157;
     int END_COUNT = 144;
@@ -464,7 +463,7 @@ public class TestIndexWriterDelete exten
           if (diskRatio >= 6.0) {
             rate = 0.0;
           }
-          if (debug) {
+          if (VERBOSE) {
             System.out.println("\ncycle: " + diskFree + " bytes");
           }
           testName = "disk full during reader.close() @ " + thisDiskFree
@@ -472,7 +471,7 @@ public class TestIndexWriterDelete exten
         } else {
           thisDiskFree = 0;
           rate = 0.0;
-          if (debug) {
+          if (VERBOSE) {
             System.out.println("\ncycle: same writer: unlimited disk space");
           }
           testName = "reader re-use after disk full";
@@ -506,7 +505,7 @@ public class TestIndexWriterDelete exten
           }
         }
         catch (IOException e) {
-          if (debug) {
+          if (VERBOSE) {
             System.out.println("  hit IOException: " + e);
             e.printStackTrace(System.out);
           }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java Mon Mar 15 08:26:44 2010
@@ -30,8 +30,6 @@ import org.apache.lucene.document.Field;
 
 public class TestIndexWriterExceptions extends LuceneTestCase {
 
-  final private static boolean DEBUG = false;
-
   private class IndexerThread extends Thread {
 
     IndexWriter writer;
@@ -72,7 +70,7 @@ public class TestIndexWriterExceptions e
         try {
           writer.updateDocument(idTerm, doc);
         } catch (RuntimeException re) {
-          if (DEBUG) {
+          if (VERBOSE) {
             System.out.println("EXC: ");
             re.printStackTrace(System.out);
           }
@@ -120,7 +118,7 @@ public class TestIndexWriterExceptions e
     @Override
     boolean testPoint(String name) {
       if (doFail.get() != null && !name.equals("startDoFlush") && r.nextInt(20) == 17) {
-        if (DEBUG) {
+        if (VERBOSE) {
           System.out.println(Thread.currentThread().getName() + ": NOW FAIL: " + name);
           //new Throwable().printStackTrace(System.out);
         }
@@ -137,7 +135,7 @@ public class TestIndexWriterExceptions e
     ((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).setSuppressExceptions();
     //writer.setMaxBufferedDocs(10);
 
-    if (DEBUG)
+    if (VERBOSE)
       writer.setInfoStream(System.out);
 
     IndexerThread thread = new IndexerThread(0, writer);
@@ -174,7 +172,7 @@ public class TestIndexWriterExceptions e
     ((ConcurrentMergeScheduler) writer.getConfig().getMergeScheduler()).setSuppressExceptions();
     //writer.setMaxBufferedDocs(10);
 
-    if (DEBUG)
+    if (VERBOSE)
       writer.setInfoStream(System.out);
 
     final int NUM_THREADS = 4;

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=923112&r1=923111&r2=923112&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 Mon Mar 15 08:26:44 2010
@@ -407,12 +407,7 @@ public class TestStressIndexing2 extends
     Collections.sort(ff1, fieldNameComparator);
     Collections.sort(ff2, fieldNameComparator);
 
-    if (ff1.size() != ff2.size()) {
-      System.out.println(ff1);
-      System.out.println(ff2);
-      assertEquals(ff1.size(), ff2.size());
-    }
-
+    assertEquals(ff1 + " : " + ff2, ff1.size(), ff2.size());
 
     for (int i=0; i<ff1.size(); i++) {
       Fieldable f1 = ff1.get(i);
@@ -422,12 +417,7 @@ public class TestStressIndexing2 extends
       } else {
         String s1 = f1.stringValue();
         String s2 = f2.stringValue();
-        if (!s1.equals(s2)) {
-          // print out whole doc on error
-          System.out.println(ff1);
-          System.out.println(ff2);          
-          assertEquals(s1,s2);
-        }
+        assertEquals(ff1 + " : " + ff2, s1,s2);
       }
     }
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java Mon Mar 15 08:26:44 2010
@@ -91,7 +91,7 @@ public class TestTermdocPerf extends Luc
     long start = System.currentTimeMillis();
     addDocs(dir, ndocs, "foo", "val", maxTF, percentDocs);
     long end = System.currentTimeMillis();
-    System.out.println("milliseconds for creation of " + ndocs + " docs = " + (end-start));
+    if (VERBOSE) System.out.println("milliseconds for creation of " + ndocs + " docs = " + (end-start));
 
     IndexReader reader = IndexReader.open(dir, true);
     TermEnum tenum = reader.terms(new Term("foo","val"));
@@ -108,7 +108,7 @@ public class TestTermdocPerf extends Luc
     }
 
     end = System.currentTimeMillis();
-    System.out.println("milliseconds for " + iter + " TermDocs iteration: " + (end-start));
+    if (VERBOSE) System.out.println("milliseconds for " + iter + " TermDocs iteration: " + (end-start));
 
     return ret;
   }

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=923112&r1=923111&r2=923112&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 Mon Mar 15 08:26:44 2010
@@ -968,7 +968,7 @@ public class TestQueryParser extends Loc
     result = qp.parse("(fieldX:xxxxx OR fieldy:xxxxxxxx)^2 AND (fieldx:the OR fieldy:foo)");
     assertNotNull("result is null and it shouldn't be", result);
     assertTrue("result is not a BooleanQuery", result instanceof BooleanQuery);
-    System.out.println("Result: " + result);
+    if (VERBOSE) System.out.println("Result: " + result);
     assertTrue(((BooleanQuery) result).clauses().size() + " does not equal: " + 2, ((BooleanQuery) result).clauses().size() == 2);
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java Mon Mar 15 08:26:44 2010
@@ -214,7 +214,7 @@ implements Serializable {
     
     // Simply write to console - choosen to be independant of log4j etc 
     private void log(String message) {
-        System.out.println(message);
+        if (VERBOSE) System.out.println(message);
     }
     
     public class CustomSearcher extends IndexSearcher {

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java Mon Mar 15 08:26:44 2010
@@ -36,7 +36,6 @@ import java.io.IOException;
  */
 public class TestMultiSearcherRanking extends LuceneTestCase {
   
-  private final boolean verbose = false;  // set to true to output hits
   private final String FIELD_NAME = "body";
   private Searcher multiSearcher;
   private Searcher singleSearcher;
@@ -86,7 +85,7 @@ public class TestMultiSearcherRanking ex
    */
   private void checkQuery(String queryStr) throws IOException, ParseException {
     // check result hit ranking
-    if(verbose) System.out.println("Query: " + queryStr);
+    if(VERBOSE) System.out.println("Query: " + queryStr);
       QueryParser queryParser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, new StandardAnalyzer(TEST_VERSION_CURRENT));
     Query query = queryParser.parse(queryStr);
     ScoreDoc[] multiSearcherHits = multiSearcher.search(query, null, 1000).scoreDocs;
@@ -95,15 +94,15 @@ public class TestMultiSearcherRanking ex
     for (int i = 0; i < multiSearcherHits.length; i++) {
       Document docMulti = multiSearcher.doc(multiSearcherHits[i].doc);
       Document docSingle = singleSearcher.doc(singleSearcherHits[i].doc);
-      if(verbose) System.out.println("Multi:  " + docMulti.get(FIELD_NAME) + " score="
+      if(VERBOSE) System.out.println("Multi:  " + docMulti.get(FIELD_NAME) + " score="
           + multiSearcherHits[i].score);
-      if(verbose) System.out.println("Single: " + docSingle.get(FIELD_NAME) + " score="
+      if(VERBOSE) System.out.println("Single: " + docSingle.get(FIELD_NAME) + " score="
           + singleSearcherHits[i].score);
       assertEquals(multiSearcherHits[i].score, singleSearcherHits[i].score,
           0.001f);
       assertEquals(docMulti.get(FIELD_NAME), docSingle.get(FIELD_NAME));
     }
-    if(verbose) System.out.println();
+    if(VERBOSE) System.out.println();
   }
   
   /**



Mime
View raw message