You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by us...@apache.org on 2009/06/23 17:34:37 UTC
svn commit: r787714 -
/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java
Author: uschindler
Date: Tue Jun 23 15:34:37 2009
New Revision: 787714
URL: http://svn.apache.org/viewvc?rev=787714&view=rev
Log:
LUCENE-1687: Change ExtendedFieldCache test in backwards-branch to test the changes because of the removed ExtendedFieldCache in trunk
Modified:
lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java
Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java?rev=787714&r1=787713&r2=787714&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java (original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestExtendedFieldCache.java Tue Jun 23 15:34:37 2009
@@ -54,14 +54,25 @@
public void test() throws IOException {
- ExtendedFieldCache cache = new ExtendedFieldCacheImpl();
- double [] doubles = cache.getDoubles(reader, "theDouble");
+ // This test was changed in tag to check the backwards-compatibility of Parsers coming from
+ // ExtendedFieldCache and not FieldCache (different class name).
+ // These dummy parsers do the same like the original ones in FieldCacheImpl!
+ ExtendedFieldCache cache = ExtendedFieldCache.EXT_DEFAULT;
+ double [] doubles = cache.getDoubles(reader, "theDouble", new ExtendedFieldCache.DoubleParser() {
+ public double parseDouble(String value) {
+ return Double.parseDouble(value);
+ }
+ });
assertTrue("doubles Size: " + doubles.length + " is not: " + NUM_DOCS, doubles.length == NUM_DOCS);
for (int i = 0; i < doubles.length; i++) {
assertTrue(doubles[i] + " does not equal: " + (Double.MAX_VALUE - i), doubles[i] == (Double.MAX_VALUE - i));
}
- long [] longs = cache.getLongs(reader, "theLong");
+ long [] longs = cache.getLongs(reader, "theLong", new ExtendedFieldCache.LongParser() {
+ public long parseLong(String value) {
+ return Long.parseLong(value);
+ }
+ });
assertTrue("longs Size: " + longs.length + " is not: " + NUM_DOCS, longs.length == NUM_DOCS);
for (int i = 0; i < longs.length; i++) {
assertTrue(longs[i] + " does not equal: " + (Long.MAX_VALUE - i), longs[i] == (Long.MAX_VALUE - i));