mirror of https://github.com/apache/lucene.git
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:
parent
584d2b394b
commit
49bd4164b8
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue