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 [2/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
Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java Mon Mar 15 08:26:44
2010
@@ -207,7 +207,7 @@ public class TestScorerPerf extends Luce
       if (validate) assertEquals(result.cardinality(), hc.getCount());
       // System.out.println(hc.getCount());
     }
-    System.out.println("Average number of matches="+(nMatches/iter));
+    if (VERBOSE) System.out.println("Average number of matches="+(nMatches/iter));
     return ret;
   }
 
@@ -240,7 +240,7 @@ public class TestScorerPerf extends Luce
       nMatches += hc.getCount();
       ret += hc.getSum();
     }
-    System.out.println("Average number of matches="+(nMatches/iter));
+    if (VERBOSE) System.out.println("Average number of matches="+(nMatches/iter));
 
     return ret;
   }
@@ -282,7 +282,7 @@ public class TestScorerPerf extends Luce
       nMatches += hc.getCount();     
       ret += hc.getSum();
     }
-    System.out.println("Average number of matches="+(nMatches/iter));
+    if (VERBOSE) System.out.println("Average number of matches="+(nMatches/iter));
     return ret;
   }
 
@@ -335,7 +335,7 @@ public class TestScorerPerf extends Luce
       long start = System.currentTimeMillis();
       doConjunctions(500,6);
       long end = System.currentTimeMillis();
-      System.out.println("milliseconds="+(end-start));
+      if (VERBOSE) System.out.println("milliseconds="+(end-start));
     }
     s.close();
   }
@@ -349,7 +349,7 @@ public class TestScorerPerf extends Luce
       long start = System.currentTimeMillis();
       doNestedConjunctions(500,3,3);
       long end = System.currentTimeMillis();
-      System.out.println("milliseconds="+(end-start));
+      if (VERBOSE) System.out.println("milliseconds="+(end-start));
     }
     s.close();
   }
@@ -359,15 +359,15 @@ public class TestScorerPerf extends Luce
     r = newRandom();
     validate=false;
     RAMDirectory dir = new RAMDirectory();
-    System.out.println("Creating index");
+    if (VERBOSE) System.out.println("Creating index");
     createRandomTerms(100000,25,.5, dir);
     s = new IndexSearcher(dir, true);
-    System.out.println("Starting performance test");
+    if (VERBOSE) System.out.println("Starting performance test");
     for (int i=0; i<bigIter; i++) {
       long start = System.currentTimeMillis();
       doTermConjunctions(s,25,5,1000);
       long end = System.currentTimeMillis();
-      System.out.println("milliseconds="+(end-start));
+      if (VERBOSE) System.out.println("milliseconds="+(end-start));
     }
     s.close();
   }
@@ -376,15 +376,15 @@ public class TestScorerPerf extends Luce
     r = newRandom();
     validate=false;    
     RAMDirectory dir = new RAMDirectory();
-    System.out.println("Creating index");
+    if (VERBOSE) System.out.println("Creating index");
     createRandomTerms(100000,25,.2, dir);
     s = new IndexSearcher(dir, true);
-    System.out.println("Starting performance test");
+    if (VERBOSE) System.out.println("Starting performance test");
     for (int i=0; i<bigIter; i++) {
       long start = System.currentTimeMillis();
       doNestedTermConjunctions(s,25,3,3,200);
       long end = System.currentTimeMillis();
-      System.out.println("milliseconds="+(end-start));
+      if (VERBOSE) System.out.println("milliseconds="+(end-start));
     }
     s.close();
   }
@@ -394,15 +394,15 @@ public class TestScorerPerf extends Luce
     r = newRandom();
     validate=false;    
     RAMDirectory dir = new RAMDirectory();
-    System.out.println("Creating index");
+    if (VERBOSE) System.out.println("Creating index");
     createRandomTerms(100000,25,2,dir);
     s = new IndexSearcher(dir, true);
-    System.out.println("Starting performance test");
+    if (VERBOSE) System.out.println("Starting performance test");
     for (int i=0; i<bigIter; i++) {
       long start = System.currentTimeMillis();
       doSloppyPhrase(s,25,2,1000);
       long end = System.currentTimeMillis();
-      System.out.println("milliseconds="+(end-start));
+      if (VERBOSE) System.out.println("milliseconds="+(end-start));
     }
     s.close();
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java Mon Mar 15 08:26:44
2010
@@ -240,7 +240,6 @@ public class TestWildcard
    */
   public void testParsingAndSearching() throws Exception {
     String field = "content";
-    boolean dbg = false;
     QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, field, new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
     qp.setAllowLeadingWildcard(true);
     String docs[] = {
@@ -285,7 +284,7 @@ public class TestWildcard
     for (int i = 0; i < matchAll.length; i++) {
       String qtxt = matchAll[i];
       Query q = qp.parse(qtxt);
-      if (dbg) System.out.println("matchAll: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
+      if (VERBOSE) System.out.println("matchAll: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
       ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
       assertEquals(docs.length,hits.length);
     }
@@ -294,7 +293,7 @@ public class TestWildcard
     for (int i = 0; i < matchNone.length; i++) {
       String qtxt = matchNone[i];
       Query q = qp.parse(qtxt);
-      if (dbg) System.out.println("matchNone: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
+      if (VERBOSE) System.out.println("matchNone: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
       ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
       assertEquals(0,hits.length);
     }
@@ -304,7 +303,7 @@ public class TestWildcard
       for (int j = 0; j < matchOneDocPrefix[i].length; j++) {
         String qtxt = matchOneDocPrefix[i][j];
         Query q = qp.parse(qtxt);
-        if (dbg) System.out.println("match 1 prefix: doc="+docs[i]+" qtxt="+qtxt+" q="+q+"
"+q.getClass().getName());
+        if (VERBOSE) System.out.println("match 1 prefix: doc="+docs[i]+" qtxt="+qtxt+" q="+q+"
"+q.getClass().getName());
         assertEquals(PrefixQuery.class, q.getClass());
         ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
         assertEquals(1,hits.length);
@@ -317,7 +316,7 @@ public class TestWildcard
       for (int j = 0; j < matchOneDocWild[i].length; j++) {
         String qtxt = matchOneDocWild[i][j];
         Query q = qp.parse(qtxt);
-        if (dbg) System.out.println("match 1 wild: doc="+docs[i]+" qtxt="+qtxt+" q="+q+"
"+q.getClass().getName());
+        if (VERBOSE) System.out.println("match 1 wild: doc="+docs[i]+" qtxt="+qtxt+" q="+q+"
"+q.getClass().getName());
         assertEquals(WildcardQuery.class, q.getClass());
         ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
         assertEquals(1,hits.length);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java Mon
Mar 15 08:26:44 2010
@@ -43,8 +43,6 @@ public class FunctionTestSetup extends L
    */
   protected static float TEST_SCORE_TOLERANCE_DELTA = 0.001f;
 
-  protected static final boolean DBG = false; // change to true for logging to print
-
   protected static final int N_DOCS = 17; // select a primary number > 2
 
   protected static final String ID_FIELD = "id";
@@ -163,7 +161,7 @@ public class FunctionTestSetup extends L
 
   // debug messages (change DBG to true for anything to print) 
   protected void log(Object o) {
-    if (DBG) {
+    if (VERBOSE) {
       System.out.println(o.toString());
     }
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java Mon Mar
15 08:26:44 2010
@@ -108,7 +108,7 @@ public class PayloadHelper {
     PayloadAnalyzer analyzer = new PayloadAnalyzer();
     IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(
         TEST_VERSION_CURRENT, analyzer).setSimilarity(similarity));
-    //writer.infoStream = System.out;
+    // writer.infoStream = System.out;
     for (int i = 0; i < numDocs; i++) {
       Document doc = new Document();
       doc.add(new Field(FIELD, English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java?rev=923112&r1=923111&r2=923112&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java Mon Mar
15 08:26:44 2010
@@ -50,7 +50,6 @@ import org.apache.lucene.store.RAMDirect
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestPayloadSpans extends LuceneTestCase {
-  private final static boolean DEBUG = true;
   private IndexSearcher searcher;
   private Similarity similarity = new DefaultSimilarity();
   protected IndexReader indexReader;
@@ -349,7 +348,7 @@ public class TestPayloadSpans extends Lu
       }
     }
     assertEquals(2, payloadSet.size());
-    if(DEBUG) {
+    if(VERBOSE) {
       for (final String payload : payloadSet)
         System.out.println("match:" +  payload);
       
@@ -375,10 +374,10 @@ public class TestPayloadSpans extends Lu
     PayloadSpanUtil psu = new PayloadSpanUtil(reader);
     
     Collection<byte[]> payloads = psu.getPayloadsForQuery(new TermQuery(new Term(PayloadHelper.FIELD,
"rr")));
-    if(DEBUG)
+    if(VERBOSE)
       System.out.println("Num payloads:" + payloads.size());
     for (final byte [] bytes : payloads) {
-      if(DEBUG)
+      if(VERBOSE)
         System.out.println(new String(bytes));
     }
     
@@ -441,14 +440,14 @@ public class TestPayloadSpans extends Lu
     int cnt = 0;
 
     while (spans.next() == true) {
-      if(DEBUG)
+      if(VERBOSE)
         System.out.println("\nSpans Dump --");
       if (spans.isPayloadAvailable()) {
         Collection<byte[]> payload = spans.getPayload();
-        if(DEBUG)
+        if(VERBOSE)
           System.out.println("payloads for span:" + payload.size());
         for (final byte [] bytes : payload) {
-          if(DEBUG)
+          if(VERBOSE)
             System.out.println("doc:" + spans.doc() + " s:" + spans.start() + " e:" + spans.end()
+ " "
               + new String(bytes));
         }



Mime
View raw message