lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From briango...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/util PriorityQueueTest.java
Date Thu, 01 Nov 2001 01:13:00 GMT
briangoetz    01/10/31 17:13:00

  Modified:    .        build.properties build.xml
               src/java/org/apache/lucene/index FieldInfos.java
               src/test/org/apache/lucene SearchTest.java
                        SearchTestForDuplicates.java StoreTest.java
               src/test/org/apache/lucene/index TermInfosTest.java
               src/test/org/apache/lucene/util PriorityQueueTest.java
  Log:
  Fix tests so they compile; fix ant file so it compiles tests properly
  
  Revision  Changes    Path
  1.12      +1 -1      jakarta-lucene/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/build.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- build.properties	2001/10/19 17:15:18	1.11
  +++ build.properties	2001/11/01 01:13:00	1.12
  @@ -39,7 +39,7 @@
   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
   
  
  
  
  1.14      +1 -1      jakarta-lucene/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/build.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- build.xml	2001/10/19 17:15:18	1.13
  +++ build.xml	2001/11/01 01:13:00	1.14
  @@ -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" 
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/index/FieldInfos.java
  
  Index: FieldInfos.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/FieldInfos.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FieldInfos.java	2001/09/18 16:29:52	1.1
  +++ FieldInfos.java	2001/11/01 01:13:00	1.2
  @@ -100,7 +100,7 @@
       }
     }
   
  -  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);
  
  
  
  1.3       +1 -1      jakarta-lucene/src/test/org/apache/lucene/SearchTest.java
  
  Index: SearchTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/SearchTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SearchTest.java	2001/09/18 17:35:57	1.2
  +++ SearchTest.java	2001/11/01 01:13:00	1.3
  @@ -111,7 +111,7 @@
         //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++) {
  
  
  
  1.3       +2 -2      jakarta-lucene/src/test/org/apache/lucene/SearchTestForDuplicates.java
  
  Index: SearchTestForDuplicates.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/SearchTestForDuplicates.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SearchTestForDuplicates.java	2001/09/18 17:35:57	1.2
  +++ SearchTestForDuplicates.java	2001/11/01 01:13:00	1.3
  @@ -98,7 +98,7 @@
         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 @@
         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();
  
  
  
  1.3       +2 -2      jakarta-lucene/src/test/org/apache/lucene/StoreTest.java
  
  Index: StoreTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/StoreTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StoreTest.java	2001/09/18 17:35:57	1.2
  +++ StoreTest.java	2001/11/01 01:13:00	1.3
  @@ -85,7 +85,7 @@
       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 @@
       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";
  
  
  
  1.2       +1 -1      jakarta-lucene/src/test/org/apache/lucene/index/TermInfosTest.java
  
  Index: TermInfosTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/index/TermInfosTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TermInfosTest.java	2001/09/18 16:30:01	1.1
  +++ TermInfosTest.java	2001/11/01 01:13:00	1.2
  @@ -120,7 +120,7 @@
   
       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);
  
  
  
  1.2       +12 -1     jakarta-lucene/src/test/org/apache/lucene/util/PriorityQueueTest.java
  
  Index: PriorityQueueTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/util/PriorityQueueTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PriorityQueueTest.java	2001/09/18 16:30:01	1.1
  +++ PriorityQueueTest.java	2001/11/01 01:13:00	1.2
  @@ -62,8 +62,19 @@
       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;
       
  
  
  

--
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