- Fixed tests to use non-deprecated JUnit assert methods.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149662 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2002-01-28 20:25:21 +00:00
parent 495d7206a5
commit d5f1f175fc
2 changed files with 12 additions and 13 deletions

View File

@ -158,9 +158,9 @@ public class TestQueryParser extends TestCase {
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 @@ public class TestQueryParser extends TestCase {
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 @@ public class TestQueryParser extends TestCase {
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 @@ public class TestQueryParser extends TestCase {
assertQueryEquals("gack ( bar blar { a z}) ", null, "gack (bar blar {a-z})");
}
}

View File

@ -101,12 +101,12 @@ public class TestPriorityQueue extends TestCase {
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);