mirror of https://github.com/apache/lucene.git
- 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:
parent
495d7206a5
commit
d5f1f175fc
|
@ -158,9 +158,9 @@ public class TestQueryParser extends TestCase {
|
||||||
assertQueryEquals("term AND \"phrase phrase\"", null,
|
assertQueryEquals("term AND \"phrase phrase\"", null,
|
||||||
"+term +\"phrase phrase\"");
|
"+term +\"phrase phrase\"");
|
||||||
assertQueryEquals("\"hello there\"", null, "\"hello there\"");
|
assertQueryEquals("\"hello there\"", null, "\"hello there\"");
|
||||||
assert(getQuery("a AND b", null) instanceof BooleanQuery);
|
assertTrue(getQuery("a AND b", null) instanceof BooleanQuery);
|
||||||
assert(getQuery("hello", null) instanceof TermQuery);
|
assertTrue(getQuery("hello", null) instanceof TermQuery);
|
||||||
assert(getQuery("\"hello there\"", null) instanceof PhraseQuery);
|
assertTrue(getQuery("\"hello there\"", null) instanceof PhraseQuery);
|
||||||
|
|
||||||
assertQueryEquals("germ term^2.0", null, "germ term^2.0");
|
assertQueryEquals("germ term^2.0", null, "germ term^2.0");
|
||||||
assertQueryEquals("term^2.0", null, "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", null, "term*germ");
|
||||||
assertQueryEquals("term*germ^3", null, "term*germ^3.0");
|
assertQueryEquals("term*germ^3", null, "term*germ^3.0");
|
||||||
|
|
||||||
assert(getQuery("term*", null) instanceof PrefixQuery);
|
assertTrue(getQuery("term*", null) instanceof PrefixQuery);
|
||||||
assert(getQuery("term*^2", null) instanceof PrefixQuery);
|
assertTrue(getQuery("term*^2", null) instanceof PrefixQuery);
|
||||||
assert(getQuery("term~", null) instanceof FuzzyQuery);
|
assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
|
||||||
assert(getQuery("term*germ", null) instanceof WildcardQuery);
|
assertTrue(getQuery("term*germ", null) instanceof WildcardQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testQPA() throws Exception {
|
public void testQPA() throws Exception {
|
||||||
|
@ -221,13 +221,13 @@ public class TestQueryParser extends TestCase {
|
||||||
assertQueryEquals("term AND NOT phrase term", qpAnalyzer,
|
assertQueryEquals("term AND NOT phrase term", qpAnalyzer,
|
||||||
"+term -\"phrase1 phrase2\" term");
|
"+term -\"phrase1 phrase2\" term");
|
||||||
assertQueryEquals("stop", qpAnalyzer, "");
|
assertQueryEquals("stop", qpAnalyzer, "");
|
||||||
assert(getQuery("term term term", qpAnalyzer) instanceof BooleanQuery);
|
assertTrue(getQuery("term term term", qpAnalyzer) instanceof BooleanQuery);
|
||||||
assert(getQuery("term +stop", qpAnalyzer) instanceof TermQuery);
|
assertTrue(getQuery("term +stop", qpAnalyzer) instanceof TermQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRange() throws Exception {
|
public void testRange() throws Exception {
|
||||||
assertQueryEquals("[ a z]", null, "[a-z]");
|
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}");
|
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})");
|
assertQueryEquals("gack ( bar blar { a z}) ", null, "gack (bar blar {a-z})");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,12 +101,12 @@ public class TestPriorityQueue extends TestCase {
|
||||||
int last = Integer.MIN_VALUE;
|
int last = Integer.MIN_VALUE;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
Integer next = (Integer)pq.pop();
|
Integer next = (Integer)pq.pop();
|
||||||
assert(next.intValue() >= last);
|
assertTrue(next.intValue() >= last);
|
||||||
last = next.intValue();
|
last = next.intValue();
|
||||||
sum2 += last;
|
sum2 += last;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(sum == sum2);
|
assertEquals(sum, sum2);
|
||||||
// end = new Date();
|
// end = new Date();
|
||||||
|
|
||||||
// System.out.print(((float)(end.getTime()-start.getTime()) / count) * 1000);
|
// System.out.print(((float)(end.getTime()-start.getTime()) / count) * 1000);
|
||||||
|
|
Loading…
Reference in New Issue