lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/util TestPriorityQueue.java
Date Mon, 28 Jan 2002 20:25:21 GMT
otis        02/01/28 12:25:21

  Modified:    src/test/org/apache/lucene/queryParser TestQueryParser.java
               src/test/org/apache/lucene/util TestPriorityQueue.java
  Log:
  - Fixed tests to use non-deprecated JUnit assert methods.
  
  Revision  Changes    Path
  1.9       +10 -11    jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
  
  Index: TestQueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestQueryParser.java	24 Jan 2002 19:03:52 -0000	1.8
  +++ TestQueryParser.java	28 Jan 2002 20:25:20 -0000	1.9
  @@ -158,9 +158,9 @@
       assertQueryEquals("term AND \"phrase phrase\"", null, 
                         "+term +\"phrase phrase\"");
       assertQueryEquals("\"hello there\"", null, "\"hello there\"");
  -    assert(getQuery("a AND b", null) instanceof BooleanQuery);
  -    assert(getQuery("hello", null) instanceof TermQuery);
  -    assert(getQuery("\"hello there\"", null) instanceof PhraseQuery);
  +    assertTrue(getQuery("a AND b", null) instanceof BooleanQuery);
  +    assertTrue(getQuery("hello", null) instanceof TermQuery);
  +    assertTrue(getQuery("\"hello there\"", null) instanceof PhraseQuery);
   
       assertQueryEquals("germ term^2.0", null, "germ term^2.0");
       assertQueryEquals("term^2.0", null, "term^2.0");
  @@ -205,10 +205,10 @@
       assertQueryEquals("term*germ", null, "term*germ");
       assertQueryEquals("term*germ^3", null, "term*germ^3.0");
   
  -    assert(getQuery("term*", null) instanceof PrefixQuery);
  -    assert(getQuery("term*^2", null) instanceof PrefixQuery);
  -    assert(getQuery("term~", null) instanceof FuzzyQuery);
  -    assert(getQuery("term*germ", null) instanceof WildcardQuery);
  +    assertTrue(getQuery("term*", null) instanceof PrefixQuery);
  +    assertTrue(getQuery("term*^2", null) instanceof PrefixQuery);
  +    assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
  +    assertTrue(getQuery("term*germ", null) instanceof WildcardQuery);
     }
   
     public void testQPA() throws Exception {
  @@ -221,13 +221,13 @@
       assertQueryEquals("term AND NOT phrase term", qpAnalyzer, 
                         "+term -\"phrase1 phrase2\" term");
       assertQueryEquals("stop", qpAnalyzer, "");
  -    assert(getQuery("term term term", qpAnalyzer) instanceof BooleanQuery);
  -    assert(getQuery("term +stop", qpAnalyzer) instanceof TermQuery);
  +    assertTrue(getQuery("term term term", qpAnalyzer) instanceof BooleanQuery);
  +    assertTrue(getQuery("term +stop", qpAnalyzer) instanceof TermQuery);
     }
   
     public void testRange() throws Exception {
       assertQueryEquals("[ a z]", null, "[a-z]");
  -    assert(getQuery("[ a z]", null) instanceof RangeQuery);
  +    assertTrue(getQuery("[ a z]", null) instanceof RangeQuery);
       assertQueryEquals("[ a z ]", null, "[a-z]");
       assertQueryEquals("{ a z}", null, "{a-z}");
       assertQueryEquals("{ a z }", null, "{a-z}");
  @@ -238,4 +238,3 @@
       assertQueryEquals("gack ( bar blar { a z}) ", null, "gack (bar blar {a-z})");
     }
   }
  -
  
  
  
  1.2       +2 -2      jakarta-lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java
  
  Index: TestPriorityQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/util/TestPriorityQueue.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestPriorityQueue.java	3 Nov 2001 02:12:27 -0000	1.1
  +++ TestPriorityQueue.java	28 Jan 2002 20:25:21 -0000	1.2
  @@ -101,12 +101,12 @@
       int last = Integer.MIN_VALUE;
       for (int i = 0; i < count; i++) {
         Integer next = (Integer)pq.pop();
  -      assert(next.intValue() >= last);
  +      assertTrue(next.intValue() >= last);
         last = next.intValue();
         sum2 += last;
       }
   
  -    assert(sum == sum2); 
  +    assertEquals(sum, sum2); 
   //      end = new Date();
   
   //      System.out.print(((float)(end.getTime()-start.getTime()) / count) * 1000);
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message