lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject svn commit: r1167511 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/ lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/ lucene/contrib/spatial/src/test/org/a...
Date Sat, 10 Sep 2011 13:13:10 GMT
Author: chrism
Date: Sat Sep 10 13:13:09 2011
New Revision: 1167511

URL: http://svn.apache.org/viewvc?rev=1167511&view=rev
Log:
LUCENE-3419: Cleaned up JUnit asset deprecations due to missing epsilons or arrays

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
    lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FieldQueryTest.java
    lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java
    lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
    lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestWildcard.java
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java
    lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
    lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/TestUtils.java
    lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
    lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java
    lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/SolrParamTest.java

Modified: lucene/dev/branches/branch_3x/lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
Sat Sep 10 13:13:09 2011
@@ -894,7 +894,7 @@ public class TestGrouping extends Lucene
 
       assertEquals(group1.groupValue, group2.groupValue);
       if (doSortValues) {
-        assertEquals(group1.sortValues, group2.sortValues);
+        assertArrayEquals(group1.sortValues, group2.sortValues);
       }
     }
     assertFalse(iter2.hasNext());
@@ -1037,7 +1037,7 @@ public class TestGrouping extends Lucene
         //System.out.println("  actual doc=" + docIDtoID[actualFD.doc] + " score=" + actualFD.score);
         assertEquals(expectedFD.doc, docIDtoID[actualFD.doc]);
         if (testScores) {
-          assertEquals(expectedFD.score, actualFD.score);
+          assertEquals(expectedFD.score, actualFD.score, 0.1);
         } else {
           // TODO: too anal for now
           //assertEquals(Float.NaN, actualFD.score);

Modified: lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FieldQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FieldQueryTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FieldQueryTest.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FieldQueryTest.java
Sat Sep 10 13:13:09 2011
@@ -266,7 +266,7 @@ public class FieldQueryTest extends Abst
     assertEquals( 1, qpm.subMap.size() );
     assertTrue( qpm.subMap.get( "a" ) != null );
     assertTrue( qpm.subMap.get( "a" ).terminal );
-    assertEquals( 1F, qpm.subMap.get( "a" ).boost );
+    assertEquals( 1F, qpm.subMap.get( "a" ).boost, 0);
     
     // phraseHighlight = true, fieldMatch = false
     fq = new FieldQuery( query, true, false );
@@ -278,7 +278,7 @@ public class FieldQueryTest extends Abst
     assertEquals( 1, qpm.subMap.size() );
     assertTrue( qpm.subMap.get( "a" ) != null );
     assertTrue( qpm.subMap.get( "a" ).terminal );
-    assertEquals( 1F, qpm.subMap.get( "a" ).boost );
+    assertEquals( 1F, qpm.subMap.get( "a" ).boost, 0);
     
     // phraseHighlight = false, fieldMatch = true
     fq = new FieldQuery( query, false, true );
@@ -290,7 +290,7 @@ public class FieldQueryTest extends Abst
     assertEquals( 1, qpm.subMap.size() );
     assertTrue( qpm.subMap.get( "a" ) != null );
     assertTrue( qpm.subMap.get( "a" ).terminal );
-    assertEquals( 1F, qpm.subMap.get( "a" ).boost );
+    assertEquals( 1F, qpm.subMap.get( "a" ).boost, 0);
     
     // phraseHighlight = false, fieldMatch = false
     fq = new FieldQuery( query, false, false );
@@ -302,14 +302,14 @@ public class FieldQueryTest extends Abst
     assertEquals( 1, qpm.subMap.size() );
     assertTrue( qpm.subMap.get( "a" ) != null );
     assertTrue( qpm.subMap.get( "a" ).terminal );
-    assertEquals( 1F, qpm.subMap.get( "a" ).boost );
+    assertEquals( 1F, qpm.subMap.get( "a" ).boost, 0);
     
     // boost != 1
     query = tq( 2, "a" );
     fq = new FieldQuery( query, true, true );
     map = fq.rootMaps;
     qpm = map.get( F );
-    assertEquals( 2F, qpm.subMap.get( "a" ).boost );
+    assertEquals( 2F, qpm.subMap.get( "a" ).boost, 0);
   }
   
   public void testQueryPhraseMap1Phrase() throws Exception {
@@ -330,7 +330,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
     
     // phraseHighlight = true, fieldMatch = false
     fq = new FieldQuery( query, true, false );
@@ -347,7 +347,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
     
     // phraseHighlight = false, fieldMatch = true
     fq = new FieldQuery( query, false, true );
@@ -360,17 +360,17 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm.subMap.get( "a" ) );
     qpm2 = qpm.subMap.get( "a" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     assertEquals( 1, qpm2.subMap.size() );
     assertNotNull( qpm2.subMap.get( "b" ) );
     qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     assertNotNull( qpm.subMap.get( "b" ) );
     qpm2 = qpm.subMap.get( "b" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     
     // phraseHighlight = false, fieldMatch = false
     fq = new FieldQuery( query, false, false );
@@ -383,17 +383,17 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm.subMap.get( "a" ) );
     qpm2 = qpm.subMap.get( "a" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     assertEquals( 1, qpm2.subMap.size() );
     assertNotNull( qpm2.subMap.get( "b" ) );
     qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     assertNotNull( qpm.subMap.get( "b" ) );
     qpm2 = qpm.subMap.get( "b" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
 
     // boost != 1
     query = pqF( 2, "a", "b" );
@@ -402,11 +402,11 @@ public class FieldQueryTest extends Abst
     map = fq.rootMaps;
     qpm = map.get( null );
     qpm2 = qpm.subMap.get( "a" );
-    assertEquals( 2F, qpm2.boost );
+    assertEquals( 2F, qpm2.boost, 0);
     qpm3 = qpm2.subMap.get( "b" );
-    assertEquals( 2F, qpm3.boost );
+    assertEquals( 2F, qpm3.boost, 0);
     qpm2 = qpm.subMap.get( "b" );
-    assertEquals( 2F, qpm2.boost );
+    assertEquals( 2F, qpm2.boost, 0);
   }
   
   public void testQueryPhraseMap1PhraseAnother() throws Exception {
@@ -427,7 +427,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "engines" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "engines" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
   }
   
   public void testQueryPhraseMap2Phrases() throws Exception {
@@ -452,7 +452,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "c d"^2
     assertNotNull( qpm.subMap.get( "c" ) );
@@ -462,7 +462,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "d" ) );
     qpm3 = qpm2.subMap.get( "d" );
     assertTrue( qpm3.terminal );
-    assertEquals( 2F, qpm3.boost );
+    assertEquals( 2F, qpm3.boost, 0);
   }
   
   public void testQueryPhraseMap2PhrasesFields() throws Exception {
@@ -487,7 +487,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "c d"^2
     assertNotNull( map.get( F2 ) );
@@ -500,7 +500,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "d" ) );
     qpm3 = qpm2.subMap.get( "d" );
     assertTrue( qpm3.terminal );
-    assertEquals( 2F, qpm3.boost );
+    assertEquals( 2F, qpm3.boost, 0);
     
     // phraseHighlight = true, fieldMatch = false
     fq = new FieldQuery( query, true, false );
@@ -520,7 +520,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "c d"^2
     assertNotNull( qpm.subMap.get( "c" ) );
@@ -530,7 +530,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "d" ) );
     qpm3 = qpm2.subMap.get( "d" );
     assertTrue( qpm3.terminal );
-    assertEquals( 2F, qpm3.boost );
+    assertEquals( 2F, qpm3.boost, 0);
   }
   
   /*
@@ -568,11 +568,11 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm3.subMap.get( "c" ) );
     QueryPhraseMap qpm4 = qpm3.subMap.get( "c" );
     assertTrue( qpm4.terminal );
-    assertEquals( 1F, qpm4.boost );
+    assertEquals( 1F, qpm4.boost, 0);
     assertNotNull( qpm4.subMap.get( "d" ) );
     QueryPhraseMap qpm5 = qpm4.subMap.get( "d" );
     assertTrue( qpm5.terminal );
-    assertEquals( 1F, qpm5.boost );
+    assertEquals( 1F, qpm5.boost, 0);
 
     // "b c d"^2, "b d"^3
     assertNotNull( qpm.subMap.get( "b" ) );
@@ -586,11 +586,11 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm3.subMap.get( "d" ) );
     qpm4 = qpm3.subMap.get( "d" );
     assertTrue( qpm4.terminal );
-    assertEquals( 2F, qpm4.boost );
+    assertEquals( 2F, qpm4.boost, 0);
     assertNotNull( qpm2.subMap.get( "d" ) );
     qpm3 = qpm2.subMap.get( "d" );
     assertTrue( qpm3.terminal );
-    assertEquals( 3F, qpm3.boost );
+    assertEquals( 3F, qpm3.boost, 0);
   }
   
   /*
@@ -621,14 +621,14 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "b" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "a b c"^2
     assertEquals( 1, qpm3.subMap.size() );
     assertNotNull( qpm3.subMap.get( "c" ) );
     QueryPhraseMap qpm4 = qpm3.subMap.get( "c" );
     assertTrue( qpm4.terminal );
-    assertEquals( 2F, qpm4.boost );
+    assertEquals( 2F, qpm4.boost, 0);
   }
   
   /*
@@ -705,14 +705,14 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "bc" ) );
     QueryPhraseMap qpm3 = qpm2.subMap.get( "bc" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "ab bc cd"
     assertEquals( 1, qpm3.subMap.size() );
     assertNotNull( qpm3.subMap.get( "cd" ) );
     QueryPhraseMap qpm4 = qpm3.subMap.get( "cd" );
     assertTrue( qpm4.terminal );
-    assertEquals( 1F, qpm4.boost );
+    assertEquals( 1F, qpm4.boost, 0);
 
     // "bc cd"
     assertNotNull( qpm.subMap.get( "bc" ) );
@@ -722,7 +722,7 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm2.subMap.get( "cd" ) );
     qpm3 = qpm2.subMap.get( "cd" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
     
     // phraseHighlight = false, fieldMatch = true
     fq = new FieldQuery( query, false, true );
@@ -737,36 +737,36 @@ public class FieldQueryTest extends Abst
     assertNotNull( qpm.subMap.get( "ab" ) );
     qpm2 = qpm.subMap.get( "ab" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     assertEquals( 1, qpm2.subMap.size() );
     assertNotNull( qpm2.subMap.get( "bc" ) );
     qpm3 = qpm2.subMap.get( "bc" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "ab bc cd"
     assertEquals( 1, qpm3.subMap.size() );
     assertNotNull( qpm3.subMap.get( "cd" ) );
     qpm4 = qpm3.subMap.get( "cd" );
     assertTrue( qpm4.terminal );
-    assertEquals( 1F, qpm4.boost );
+    assertEquals( 1F, qpm4.boost, 0);
 
     // "bc cd"
     assertNotNull( qpm.subMap.get( "bc" ) );
     qpm2 = qpm.subMap.get( "bc" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     assertEquals( 1, qpm2.subMap.size() );
     assertNotNull( qpm2.subMap.get( "cd" ) );
     qpm3 = qpm2.subMap.get( "cd" );
     assertTrue( qpm3.terminal );
-    assertEquals( 1F, qpm3.boost );
+    assertEquals( 1F, qpm3.boost, 0);
 
     // "cd"
     assertNotNull( qpm.subMap.get( "cd" ) );
     qpm2 = qpm.subMap.get( "cd" );
     assertTrue( qpm2.terminal );
-    assertEquals( 1F, qpm2.boost );
+    assertEquals( 1F, qpm2.boost, 0);
     assertEquals( 0, qpm2.subMap.size() );
   }
   

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/DistanceUtilsTest.java
Sat Sep 10 13:13:09 2011
@@ -34,28 +34,28 @@ public class DistanceUtilsTest extends T
     double[] oneOne = new double[]{1, 1};
     double[] pt1 = new double[]{1.5, 110.3};
     double[] result = DistanceUtils.vectorBoxCorner(zero, null, Math.sqrt(2), true);
-    assertEquals(1.0, result[0]);
-    assertEquals(1.0, result[1]);
+    assertEquals(1.0, result[0], 0);
+    assertEquals(1.0, result[1], 0);
 
     result = DistanceUtils.vectorBoxCorner(zero, null, Math.sqrt(2), false);
-    assertEquals(-1.0, result[0]);
-    assertEquals(-1.0, result[1]);
+    assertEquals(-1.0, result[0], 0);
+    assertEquals(-1.0, result[1], 0);
 
     result = DistanceUtils.vectorBoxCorner(oneOne, null, Math.sqrt(2), true);
-    assertEquals(2.0, result[0]);
-    assertEquals(2.0, result[1]);
+    assertEquals(2.0, result[0], 0);
+    assertEquals(2.0, result[1], 0);
 
     result = DistanceUtils.vectorBoxCorner(zeroOne, null, Math.sqrt(2), true);
-    assertEquals(1.0, result[0]);
-    assertEquals(2.0, result[1]);
+    assertEquals(1.0, result[0], 0);
+    assertEquals(2.0, result[1], 0);
 
     result = DistanceUtils.vectorBoxCorner(pt1, null, Math.sqrt(2), true);
-    assertEquals(2.5, result[0]);
-    assertEquals(111.3, result[1]);
+    assertEquals(2.5, result[0], 0.1);
+    assertEquals(111.3, result[1], 0.1);
 
     result = DistanceUtils.vectorBoxCorner(pt1, null, Math.sqrt(2), false);
-    assertEquals(0.5, result[0]);
-    assertEquals(109.3, result[1]);
+    assertEquals(0.5, result[0], 0.1);
+    assertEquals(109.3, result[1], 0.1);
 
   }
 
@@ -153,9 +153,9 @@ public class DistanceUtilsTest extends T
     double[] oneOne = new double[]{1, 1};
     double distance;
     distance = DistanceUtils.vectorDistance(zero, zeroOne, 2);
-    assertEquals(1.0, distance);
+    assertEquals(1.0, distance, 0);
     distance = DistanceUtils.vectorDistance(zero, oneZero, 2);
-    assertEquals(1.0, distance);
+    assertEquals(1.0, distance, 0);
     distance = DistanceUtils.vectorDistance(zero, oneOne, 2);
     assertEquals(Math.sqrt(2), distance, 0.001);
 
@@ -249,9 +249,9 @@ public class DistanceUtilsTest extends T
 
     double[] dbls = DistanceUtils.parsePointDouble(null, "89.0         ,   73.2 ,       
      -92.3", 3);
     assertEquals(3, dbls.length);
-    assertEquals(89.0, dbls[0]);
-    assertEquals(73.2, dbls[1]);
-    assertEquals(-92.3, dbls[2]);
+    assertEquals(89.0, dbls[0], 0);
+    assertEquals(73.2, dbls[1], 0.1);
+    assertEquals(-92.3, dbls[2], 0.1);
 
     try {
       dbls = DistanceUtils.parsePointDouble(null, "89.0         ,   foo ,              -92.3",
3);
@@ -261,8 +261,8 @@ public class DistanceUtilsTest extends T
 
     dbls = DistanceUtils.parseLatitudeLongitude(null, "89.0         ,   73.2    ");
     assertEquals(2, dbls.length);
-    assertEquals(89.0, dbls[0]);
-    assertEquals(73.2, dbls[1]);
+    assertEquals(89.0, dbls[0], 0.1);
+    assertEquals(73.2, dbls[1], 0.1);
 
     //test some bad lat/long pairs
     try {

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
Sat Sep 10 13:13:09 2011
@@ -163,12 +163,12 @@ public class TestCartesian extends Lucen
       System.out.println("testDistances");
       System.out.println("miles:" + miles);
     }
-    assertEquals(2288.82495932794, miles); 
+    assertEquals(2288.82495932794, miles, 0.001);
     LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
     LatLng p4 = new FloatLatLng( 55.0, 4.0 );
     miles = p3.arcDistance( p4, DistanceUnits.MILES );
     if (VERBOSE) System.out.println("miles:" + miles);
-    assertEquals(3474.331719997617, miles); 
+    assertEquals(3474.331719997617, miles, 0.001);
   }
 
   /*public void testCartesianPolyFilterBuilder() throws Exception {

Modified: lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java
Sat Sep 10 13:13:09 2011
@@ -491,7 +491,7 @@ public class _TestUtil {
       Assert.assertEquals("wrong hit score", expectedSD.score, actualSD.score, 0.0);
       if (expectedSD instanceof FieldDoc) {
         Assert.assertTrue(actualSD instanceof FieldDoc);
-        Assert.assertEquals("wrong sort field values",
+        Assert.assertArrayEquals("wrong sort field values",
                             ((FieldDoc) expectedSD).fields,
                             ((FieldDoc) actualSD).fields);
       } else {

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
Sat Sep 10 13:13:09 2011
@@ -63,7 +63,7 @@ public class TestConstantScoreQuery exte
       
       @Override
       public void collect(int doc) throws IOException {
-        assertEquals("Score differs from expected", expectedScore, this.scorer.score());
+        assertEquals("Score differs from expected", expectedScore, this.scorer.score(), 0);
         count[0]++;
       }
       

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
Sat Sep 10 13:13:09 2011
@@ -165,7 +165,7 @@ public class TestMultiTermConstantScore 
     float score = result[0].score;
     for (int i = 1; i < numHits; i++) {
       assertEquals("score for " + i + " was not the same", score,
-          result[i].score);
+          result[i].score, SCORE_COMP_THRESH);
     }
 
     result = search.search(csrq("data", "1", "6", T, T, MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE),
null, 1000).scoreDocs;
@@ -173,7 +173,7 @@ public class TestMultiTermConstantScore 
     assertEquals("wrong number of results", 6, numHits);
     for (int i = 0; i < numHits; i++) {
       assertEquals("score for " + i + " was not the same", score,
-          result[i].score);
+          result[i].score, SCORE_COMP_THRESH);
     }
 
     search.close();
@@ -198,7 +198,7 @@ public class TestMultiTermConstantScore 
       }
       @Override
       public void collect(int doc) throws IOException {
-        assertEquals("score for doc " + (doc + base) + " was not correct", 1.0f, scorer.score());
+        assertEquals("score for doc " + (doc + base) + " was not correct", 1.0f, scorer.score(),
SCORE_COMP_THRESH);
       }
       @Override
       public void setNextReader(IndexReader reader, int docBase) {

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestSimilarity.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestSimilarity.java
Sat Sep 10 13:13:09 2011
@@ -91,7 +91,7 @@ public class TestSimilarity extends Luce
          }
          @Override
         public final void collect(int doc) throws IOException {
-           assertEquals(1.0f, scorer.score());
+           assertEquals(1.0f, scorer.score(), 0);
          }
          @Override
         public void setNextReader(IndexReader reader, int docBase) {}
@@ -115,7 +115,7 @@ public class TestSimilarity extends Luce
          @Override
         public final void collect(int doc) throws IOException {
            //System.out.println("Doc=" + doc + " score=" + score);
-           assertEquals((float)doc+base+1, scorer.score());
+           assertEquals((float)doc+base+1, scorer.score(), 0);
          }
          @Override
         public void setNextReader(IndexReader reader, int docBase) {
@@ -141,7 +141,7 @@ public class TestSimilarity extends Luce
          @Override
          public final void collect(int doc) throws IOException {
            //System.out.println("Doc=" + doc + " score=" + score);
-           assertEquals(1.0f, scorer.score());
+           assertEquals(1.0f, scorer.score(), 0);
          }
          @Override
          public void setNextReader(IndexReader reader, int docBase) {}
@@ -162,7 +162,7 @@ public class TestSimilarity extends Luce
       @Override
       public final void collect(int doc) throws IOException {
         //System.out.println("Doc=" + doc + " score=" + score);
-        assertEquals(2.0f, scorer.score());
+        assertEquals(2.0f, scorer.score(), 0);
       }
       @Override
       public void setNextReader(IndexReader reader, int docBase) {}

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestWildcard.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestWildcard.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestWildcard.java
Sat Sep 10 13:13:09 2011
@@ -77,25 +77,25 @@ public class TestWildcard
       wq.setBoost(0.1F);
       Query q = searcher.rewrite(wq);
       assertTrue(q instanceof TermQuery);
-      assertEquals(q.getBoost(), wq.getBoost());
+      assertEquals(q.getBoost(), wq.getBoost(), 0);
       
       wq.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);
       wq.setBoost(0.2F);
       q = searcher.rewrite(wq);
       assertTrue(q instanceof ConstantScoreQuery);
-      assertEquals(q.getBoost(), wq.getBoost());
+      assertEquals(q.getBoost(), wq.getBoost(), 0.1);
       
       wq.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT);
       wq.setBoost(0.3F);
       q = searcher.rewrite(wq);
       assertTrue(q instanceof ConstantScoreQuery);
-      assertEquals(q.getBoost(), wq.getBoost());
+      assertEquals(q.getBoost(), wq.getBoost(), 0.1);
       
       wq.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE);
       wq.setBoost(0.4F);
       q = searcher.rewrite(wq);
       assertTrue(q instanceof ConstantScoreQuery);
-      assertEquals(q.getBoost(), wq.getBoost());
+      assertEquals(q.getBoost(), wq.getBoost(), 0.1);
       searcher.close();
       indexStore.close();
   }

Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java
Sat Sep 10 13:13:09 2011
@@ -95,7 +95,7 @@ public class JsonLoaderTest extends Solr
     AddUpdateCommand add = p.addCommands.get(0);
     SolrInputDocument d = add.solrDoc;
     SolrInputField f = d.getField( "boosted" );
-    assertEquals(6.7f, f.getBoost());
+    assertEquals(6.7f, f.getBoost(), 0.1);
     assertEquals(2, f.getValues().size());
 
     // 
@@ -103,7 +103,7 @@ public class JsonLoaderTest extends Solr
     d = add.solrDoc;
     f = d.getField( "f1" );
     assertEquals(2, f.getValues().size());
-    assertEquals(3.45f, d.getDocumentBoost());
+    assertEquals(3.45f, d.getDocumentBoost(), 0.001);
     assertEquals(false, !add.allowDups);
 
     assertEquals(0, d.getField("f2").getValueCount());

Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
Sat Sep 10 13:13:09 2011
@@ -69,11 +69,11 @@ public class XmlUpdateRequestHandlerTest
     SolrInputDocument doc = loader.readDoc( parser );
     
     // Read boosts
-    assertEquals( 5.5f, doc.getDocumentBoost() );
-    assertEquals( 1.0f, doc.getField( "name" ).getBoost() );
-    assertEquals( 2.2f, doc.getField( "id" ).getBoost() );
+    assertEquals( 5.5f, doc.getDocumentBoost(), 0.1);
+    assertEquals( 1.0f, doc.getField( "name" ).getBoost(), 0.1);
+    assertEquals( 2.2f, doc.getField( "id" ).getBoost(), 0.1);
     // Boost is the product of each value
-    assertEquals( (3*4*5.0f), doc.getField( "cat" ).getBoost() );
+    assertEquals( (3*4*5.0f), doc.getField( "cat" ).getBoost(), 0.1);
     
     // Read values
     assertEquals( "12345", doc.getField( "id" ).getValue() );

Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/TestUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/TestUtils.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/TestUtils.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/TestUtils.java Sat
Sep 10 13:13:09 2011
@@ -123,7 +123,7 @@ public class TestUtils extends LuceneTes
   {
     double number = 1.234;
     String sortable = NumberUtils.double2sortableStr( number );
-    assertEquals( number, NumberUtils.SortableStr2double(sortable) );
+    assertEquals( number, NumberUtils.SortableStr2double(sortable), 0.001);
     
     long num = System.currentTimeMillis();
     sortable = NumberUtils.long2sortableStr( num );

Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
Sat Sep 10 13:13:09 2011
@@ -195,7 +195,7 @@ public class SolrQueryTest extends Lucen
     
     // check getters
     assertEquals(false, q.getTerms());
-    assertEquals(null, q.getTermsFields());
+    assertArrayEquals(null, q.getTermsFields());
     assertEquals("", q.getTermsLower());
     assertEquals("", q.getTermsUpper());
     assertEquals(false, q.getTermsUpperInclusive());
@@ -207,7 +207,7 @@ public class SolrQueryTest extends Lucen
     assertEquals(false, q.getTermsRaw());
     assertEquals("count", q.getTermsSortString());
     assertEquals(null, q.getTermsRegex());
-    assertEquals(null, q.getTermsRegexFlags());
+    assertArrayEquals(null, q.getTermsRegexFlags());
 
     // check setters
     q.setTerms(true);

Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/ModifiableSolrParamsTest.java
Sat Sep 10 13:13:09 2011
@@ -45,7 +45,7 @@ public class ModifiableSolrParamsTest ex
     values[0] = null;
     modifiable.add(key, values);
     String[] result = modifiable.getParams(key);
-    assertEquals("params", values, result);
+    assertArrayEquals("params", values, result);
   }
 
 
@@ -57,7 +57,7 @@ public class ModifiableSolrParamsTest ex
     String[] universe = new String[] { "Universe" };
     String[] helloWorldUniverse = new String[] { "Hello", "World", "Universe" };
     modifiable.add(key, helloWorld);
-    assertEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
+    assertArrayEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
 
     modifiable.add(key, universe);
     String[] result = modifiable.getParams(key);
@@ -73,7 +73,7 @@ public class ModifiableSolrParamsTest ex
     String[] universe = new String[] { null };
     String[] helloWorldUniverse = new String[] { "Hello", "World", null };
     modifiable.add(key, helloWorld);
-    assertEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
+    assertArrayEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
 
     modifiable.add(key, universe);
     String[] result = modifiable.getParams(key);
@@ -89,7 +89,7 @@ public class ModifiableSolrParamsTest ex
     String[] universe = new String[] { "Universe" };
     String[] helloWorldUniverse = new String[] { "Universe" };
     modifiable.add(key, helloWorld);
-    assertEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
+    assertArrayEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
 
     modifiable.add(key, universe);
     String[] result = modifiable.getParams(key);
@@ -105,7 +105,7 @@ public class ModifiableSolrParamsTest ex
     String[] universe = new String[] { "Universe", null };
     String[] helloWorldUniverse = new String[] { "Hello", "World", "Universe", null };
     modifiable.add(key, helloWorld);
-    assertEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
+    assertArrayEquals("checking Hello World: ", helloWorld, modifiable.getParams(key));
 
     modifiable.add(key, universe);
     String[] result = modifiable.getParams(key);

Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/SolrParamTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/SolrParamTest.java?rev=1167511&r1=1167510&r2=1167511&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/SolrParamTest.java
(original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/params/SolrParamTest.java
Sat Sep 10 13:13:09 2011
@@ -108,10 +108,10 @@ public class SolrParamTest extends Lucen
     assertEquals( pstr                  , params.get(          "xxx", pstr   ) );
     assertEquals( pbool.booleanValue()  , params.getBool(      "xxx", pbool   ) );
     assertEquals( pint.intValue()       , params.getInt(       "xxx", pint   ) );
-    assertEquals( pfloat.floatValue()   , params.getFloat(     "xxx", pfloat  ) );
+    assertEquals( pfloat.floatValue()   , params.getFloat(     "xxx", pfloat  ), 0.1);
     assertEquals( pbool.booleanValue()  , params.getFieldBool( "xxx", "bool", pbool ) );
     assertEquals( pint.intValue()       , params.getFieldInt(  "xxx", "int", pint  ) );
-    assertEquals( pfloat.floatValue()   , params.getFieldFloat("xxx", "float", pfloat  )
);
+    assertEquals( pfloat.floatValue()   , params.getFieldFloat("xxx", "float", pfloat  ),
0.1);
     assertEquals( pstr                  , params.getFieldParam("xxx", "str", pstr  ) );
 
     // Required params testing uses decorator



Mime
View raw message