blob: 10cf8394070a80350c393319ef29deb0f0b489ac [file] [log] [blame]
Index: contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieUtils.java
===================================================================
--- contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieUtils.java (revision 723238)
+++ contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieUtils.java (working copy)
@@ -20,9 +20,9 @@
import java.util.Date;
import java.util.GregorianCalendar;
-import org.apache.lucene.util.LuceneTestCase;
+import junit.framework.TestCase;
-public class TestTrieUtils extends LuceneTestCase {
+public class TestTrieUtils extends TestCase {
public void testSpecialValues() throws Exception {
// Variant 8bit values
@@ -81,6 +81,7 @@
for (int i=0; i<vals.length; i++) {
trieVals[i]=variant.longToTrieCoded(vals[i]);
assertEquals( "Back and forth conversion should return same value", vals[i], variant.trieCodedToLong(trieVals[i]) );
+ assertEquals( "Automatic back conversion with encoding detection should return same value", vals[i], TrieUtils.trieCodedToLongAuto(trieVals[i]) );
}
// check sort order (trieVals should be ascending)
@@ -112,6 +113,7 @@
for (int i=0; i<vals.length; i++) {
trieVals[i]=variant.doubleToTrieCoded(vals[i]);
assertTrue( "Back and forth conversion should return same value", vals[i]==variant.trieCodedToDouble(trieVals[i]) );
+ assertTrue( "Automatic back conversion with encoding detection should return same value", vals[i]==TrieUtils.trieCodedToDoubleAuto(trieVals[i]) );
}
// check sort order (trieVals should be ascending)
@@ -145,6 +147,7 @@
for (int i=0; i<vals.length; i++) {
trieVals[i]=variant.dateToTrieCoded(vals[i]);
assertEquals( "Back and forth conversion should return same value", vals[i], variant.trieCodedToDate(trieVals[i]) );
+ assertEquals( "Automatic back conversion with encoding detection should return same value", vals[i], TrieUtils.trieCodedToDateAuto(trieVals[i]) );
}
// check sort order (trieVals should be ascending)