lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r886184 - in /lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search: TestNumericRangeQuery32.java TestWildcard.java
Date Wed, 02 Dec 2009 15:51:41 GMT
Author: markrmiller
Date: Wed Dec  2 15:51:41 2009
New Revision: 886184

URL: http://svn.apache.org/viewvc?rev=886184&view=rev
Log:
update back compat tests for trunk merge

Modified:
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java?rev=886184&r1=886183&r2=886184&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
Wed Dec  2 15:51:41 2009
@@ -438,37 +438,39 @@
     assertFalse(q2.equals(q1));
   }
   
-  private void testEnum(int lower, int upper) throws Exception {
-    NumericRangeQuery<Integer> q = NumericRangeQuery.newIntRange("field4", 4, lower,
upper, true, true);
-    FilteredTermEnum termEnum = q.getEnum(searcher.getIndexReader());
-    try {
-      int count = 0;
-      do {
-        final Term t = termEnum.term();
-        if (t != null) {
-          final int val = NumericUtils.prefixCodedToInt(t.text());
-          assertTrue("value not in bounds", val >= lower && val <= upper);
-          count++;
-        } else break;
-      } while (termEnum.next());
-      assertFalse(termEnum.next());
-      System.out.println("TermEnum on 'field4' for range [" + lower + "," + upper + "] contained
" + count + " terms.");
-    } finally {
-      termEnum.close();
-    }
-  }
+//  Removed for now  - NumericRangeQuery does not currently implement getEnum 
   
-  public void testEnum() throws Exception {
-    int count=3000;
-    int lower=(distance*3/2)+startOffset, upper=lower + count*distance + (distance/3);
-    // test enum with values
-    testEnum(lower, upper);
-    // test empty enum
-    testEnum(upper, lower);
-    // test empty enum outside of bounds
-    lower = distance*noDocs+startOffset;
-    upper = 2 * lower;
-    testEnum(lower, upper);
-  }
+//  private void testEnum(int lower, int upper) throws Exception {
+//    NumericRangeQuery<Integer> q = NumericRangeQuery.newIntRange("field4", 4, lower,
upper, true, true);
+//    FilteredTermEnum termEnum = q.getEnum(searcher.getIndexReader());
+//    try {
+//      int count = 0;
+//      do {
+//        final Term t = termEnum.term();
+//        if (t != null) {
+//          final int val = NumericUtils.prefixCodedToInt(t.text());
+//          assertTrue("value not in bounds", val >= lower && val <= upper);
+//          count++;
+//        } else break;
+//      } while (termEnum.next());
+//      assertFalse(termEnum.next());
+//      System.out.println("TermEnum on 'field4' for range [" + lower + "," + upper + "]
contained " + count + " terms.");
+//    } finally {
+//      termEnum.close();
+//    }
+//  }
+//  
+//  public void testEnum() throws Exception {
+//    int count=3000;
+//    int lower=(distance*3/2)+startOffset, upper=lower + count*distance + (distance/3);
+//    // test enum with values
+//    testEnum(lower, upper);
+//    // test empty enum
+//    testEnum(upper, lower);
+//    // test empty enum outside of bounds
+//    lower = distance*noDocs+startOffset;
+//    upper = 2 * lower;
+//    testEnum(lower, upper);
+//  }
   
 }

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java?rev=886184&r1=886183&r2=886184&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
Wed Dec  2 15:51:41 2009
@@ -104,8 +104,9 @@
     MultiTermQuery wq = new WildcardQuery(new Term("field", ""));
     wq.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
     assertMatches(searcher, wq, 0);
-    BooleanQuery expected = new BooleanQuery();
-    assertEquals(searcher.rewrite(expected), searcher.rewrite(wq));
+    Query q = searcher.rewrite(wq);
+    assertTrue(q instanceof BooleanQuery);
+    assertEquals(0, ((BooleanQuery) q).clauses().size());
   }
   
   /**



Mime
View raw message