Fix tests so they compile; fix ant file so it compiles tests properly

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brian Goetz 2001-11-01 01:13:00 +00:00
parent 584d2b394b
commit 49bd4164b8
8 changed files with 21 additions and 10 deletions

View File

@ -39,7 +39,7 @@ build.test = ${build.dir}/test
build.test.src = ${build.test}/src
build.test.classes = ${build.test}/classes
junit.src = ${basedir}/test/unit
junit.src = ${basedir}/src/test
junit.classes = ${build.dir}/unit-classes
junit.reports = ${build.dir}/unit-reports

View File

@ -182,7 +182,7 @@
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="test-unit" depends="compile" if="junit.present">
<target name="test-unit" depends="compile,test" if="junit.present">
<!-- Import JUnit task -->
<taskdef
name="junit"

View File

@ -100,7 +100,7 @@ final class FieldInfos {
}
}
private final void add(String name, boolean isIndexed) {
final void add(String name, boolean isIndexed) {
FieldInfo fi = fieldInfo(name);
if (fi == null)
addInternal(name, isIndexed);

View File

@ -111,7 +111,7 @@ class SearchTest {
//DateFilter filter = DateFilter.Before("modified", Time(1997,00,01));
//System.out.println(filter);
hits = searcher.search(query, null);
hits = searcher.search(query);
System.out.println(hits.length() + " total results");
for (int i = 0 ; i < hits.length() && i < 10; i++) {

View File

@ -98,7 +98,7 @@ class SearchTestForDuplicates {
Query query = parser.parse(HIGH_PRIORITY);
System.out.println("Query: " + query.toString(PRIORITY_FIELD));
hits = searcher.search(query, null);
hits = searcher.search(query);
printHits(hits);
searcher.close();
@ -112,7 +112,7 @@ class SearchTestForDuplicates {
query = parser.parse(HIGH_PRIORITY + " OR " + MED_PRIORITY);
System.out.println("Query: " + query.toString(PRIORITY_FIELD));
hits = searcher.search(query, null);
hits = searcher.search(query);
printHits(hits);
searcher.close();

View File

@ -85,7 +85,7 @@ class StoreTest {
if (ram)
store = new RAMDirectory();
else
store = new FSDirectory("test.store", true);
store = FSDirectory.getDirectory("test.store", true);
final int LENGTH_MASK = 0xFFF;
@ -114,7 +114,7 @@ class StoreTest {
start = new Date();
if (!ram)
store = new FSDirectory("test.store", false);
store = FSDirectory.getDirectory("test.store", false);
for (i = 0; i < count; i++) {
String name = i + ".dat";

View File

@ -120,7 +120,7 @@ class TermInfosTest {
start = new Date();
Directory store = new FSDirectory("test.store", true);
Directory store = FSDirectory.getDirectory("test.store", true);
FieldInfos fis = new FieldInfos();
TermInfosWriter writer = new TermInfosWriter(store, "words", fis);

View File

@ -62,8 +62,19 @@ class PriorityQueueTest {
test(10000);
}
private static class IntegerQueue extends PriorityQueue {
public IntegerQueue(int count) {
super();
initialize(count);
}
protected boolean lessThan(Object a, Object b) {
return ((Integer) a).intValue() < ((Integer) b).intValue();
}
}
public static void test(int count) {
PriorityQueue pq = new PriorityQueue(count);
PriorityQueue pq = new IntegerQueue(count);
Random gen = new Random();
int i;