lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r960490 - in /lucene/dev/branches/branch_3x/lucene: ./ backwards/ backwards/lib/ backwards/src/demo/ backwards/src/java/ backwards/src/jsp/ backwards/src/site/ backwards/src/test/org/apache/lucene/ backwards/src/test/org/apache/lucene/index...
Date Mon, 05 Jul 2010 08:58:03 GMT
Author: uschindler
Date: Mon Jul  5 08:58:02 2010
New Revision: 960490

URL: http://svn.apache.org/viewvc?rev=960490&view=rev
Log:
LUCENE-2516: Backwards tests are now compiled against released lucene-core.jar from tarball
of previous version. Backwards tests are now packaged together with src distribution.

Added:
    lucene/dev/branches/branch_3x/lucene/backwards/lib/
    lucene/dev/branches/branch_3x/lucene/backwards/lib/lucene-core-3.0.2.jar   (with props)
Removed:
    lucene/dev/branches/branch_3x/lucene/backwards/src/demo/
    lucene/dev/branches/branch_3x/lucene/backwards/src/java/
    lucene/dev/branches/branch_3x/lucene/backwards/src/jsp/
    lucene/dev/branches/branch_3x/lucene/backwards/src/site/
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/search/CachingWrapperFilterHelper.java
Modified:
    lucene/dev/branches/branch_3x/lucene/CHANGES.txt
    lucene/dev/branches/branch_3x/lucene/backwards/backwards-readme.txt
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/MockRAMDirectory.java
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/TestHugeRamFile.java
    lucene/dev/branches/branch_3x/lucene/build.xml

Modified: lucene/dev/branches/branch_3x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/CHANGES.txt?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/CHANGES.txt Mon Jul  5 08:58:02 2010
@@ -386,7 +386,11 @@ Build
   can force them to run sequentially by passing -Drunsequential=1 on the command
   line. The number of threads that are spwaned per CPU defaults to '1'. If you 
   wish to change that, you can run the tests with -DthreadsPerProcessor=[num].
-  (Robert Muir, Shai Erera, Peter Kofler) 
+  (Robert Muir, Shai Erera, Peter Kofler)
+
+* LUCENE-2516: Backwards tests are now compiled against released lucene-core.jar
+  from tarball of previous version. Backwards tests are now packaged together
+  with src distribution.  (Uwe Schindler)
 
 Test Cases
 

Modified: lucene/dev/branches/branch_3x/lucene/backwards/backwards-readme.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/backwards-readme.txt?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/backwards-readme.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/backwards-readme.txt Mon Jul  5 08:58:02
2010
@@ -1,13 +1,14 @@
 This folder contains the src/ folder of the previous Lucene major version.
 
-The test-backwards ANT task compiles the core classes of the previous version and its tests
-against these class files. After that the compiled test classes are run against the new
-lucene-core.jar file.
+The test-backwards ANT task compiles the previous version's tests (bundled) against the
+previous released lucene-core.jar file (bundled). After that the compiled test classes
+are run against the new lucene-core.jar file, created by ANT before.
 
 After branching a new Lucene major version (branch name "lucene_X_Y") do the following:
 
-* svn rm backwards/src/
-* svn cp https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_X_Y/lucene/src/ backwards/src/
+* svn rm backwards/src/test
+* svn cp https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_X_Y/lucene/src/test
backwards/src/test
+* Copy the lucene-core.jar from the last release tarball to backwards/lib and delete old
one.
 * Check that everything is correct: The backwards folder should contain a src/ folder
-  that now contains java, test, demo,.... The files should be the ones from the branch.
+  that now contains "test". The files should be the ones from the branch.
 * Run "ant test-backwards"

Added: lucene/dev/branches/branch_3x/lucene/backwards/lib/lucene-core-3.0.2.jar
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/lib/lucene-core-3.0.2.jar?rev=960490&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lucene/dev/branches/branch_3x/lucene/backwards/lib/lucene-core-3.0.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
Mon Jul  5 08:58:02 2010
@@ -421,7 +421,7 @@ public class TestAddIndexesNoOptimize ex
   private IndexWriter newWriter(Directory dir, boolean create)
       throws IOException {
     final IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), create, IndexWriter.MaxFieldLength.UNLIMITED);
-    writer.setMergePolicy(new LogDocMergePolicy());
+    //BACKWARDS TEST PASS WITHOUT THIS: writer.setMergePolicy(new LogDocMergePolicy());
     return writer;
   }
 
@@ -495,7 +495,7 @@ public class TestAddIndexesNoOptimize ex
 
     Directory dir = new MockRAMDirectory();
     IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
-    writer.setMergePolicy(new LogByteSizeMergePolicy());
+    //BACKWARDS TEST PASS WITHOUT THIS: writer.setMergePolicy(new LogByteSizeMergePolicy());
     writer.setMaxBufferedDocs(5);
     writer.setUseCompoundFile(false);
     writer.setMergeFactor(100);
@@ -521,9 +521,11 @@ public class TestAddIndexesNoOptimize ex
 
     Directory dir2 = new MockRAMDirectory();
     writer = new IndexWriter(dir2, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+    /* BACKWARDS TEST PASS WITHOUT THIS: 
     LogByteSizeMergePolicy lmp = new LogByteSizeMergePolicy();
     lmp.setMinMergeMB(0.0001);
     writer.setMergePolicy(lmp);
+    */
     writer.setMergeFactor(4);
     writer.setUseCompoundFile(false);
     writer.setMergeScheduler(new SerialMergeScheduler());

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
Mon Jul  5 08:58:02 2010
@@ -110,6 +110,8 @@ public class TestConcurrentMergeSchedule
     directory.close();
   }
 
+  //BACKWARDS_BREAK: 
+  /*
   // Test that deletes committed after a merge started and
   // before it finishes, are correctly merged back:
   public void testDeleteMerging() throws IOException {
@@ -152,7 +154,7 @@ public class TestConcurrentMergeSchedule
     assertEquals(450, reader.numDocs());
     reader.close();
     directory.close();
-  }
+  }*/
 
   public void testNoExtraFiles() throws IOException {
 

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
Mon Jul  5 08:58:02 2010
@@ -951,7 +951,7 @@ public class TestIndexReaderReopen exten
     IndexWriter.unlock(dir);
     IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED);
 
-    w.setMergePolicy(new LogDocMergePolicy());
+    //BACKWARDS TEST PASS WITHOUT THIS: w.setMergePolicy(new LogDocMergePolicy());
     
     for (int i = 0; i < 100; i++) {
       w.addDocument(createDocument(i, 4));

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriter.java
Mon Jul  5 08:58:02 2010
@@ -600,7 +600,8 @@ public class TestIndexWriter extends Luc
       dir.close();
     }
 
-    public void testOptimizeMaxNumSegments() throws IOException {
+    //BACKWARDS_BREAK: 
+    /*public void testOptimizeMaxNumSegments() throws IOException {
 
       MockRAMDirectory dir = new MockRAMDirectory();
 
@@ -679,7 +680,7 @@ public class TestIndexWriter extends Luc
         else
           assertEquals(7, optSegCount);
       }
-    }
+    }*/
 
     /**
      * Make sure optimize doesn't use any more than 1X
@@ -2751,6 +2752,8 @@ public class TestIndexWriter extends Luc
     dir.close();
   }
 
+  //BACKWARDS_BREAK: 
+  /*
   // LUCENE-1168
   public void testTermVectorCorruption() throws IOException {
 
@@ -2887,7 +2890,7 @@ public class TestIndexWriter extends Luc
     }
     reader.close();
     dir.close();
-  }
+  }*/
 
   // LUCENE-1084: test user-specified field length
   public void testUserSpecifiedMaxFieldLength() throws IOException {

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterReader.java
Mon Jul  5 08:58:02 2010
@@ -573,7 +573,7 @@ public class TestIndexWriterReader exten
       boolean multiSegment) throws IOException {
     IndexWriter w = new IndexWriter(dir1, new WhitespaceAnalyzer(),
         IndexWriter.MaxFieldLength.LIMITED);
-    w.setMergePolicy(new LogDocMergePolicy());
+    //BACKWARDS TEST PASS WITHOUT THIS: w.setMergePolicy(new LogDocMergePolicy());
     for (int i = 0; i < 100; i++) {
       w.addDocument(createDocument(i, indexName, 4));
       if (multiSegment && (i % 10) == 0) {

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/MockRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/MockRAMDirectory.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/MockRAMDirectory.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/MockRAMDirectory.java
Mon Jul  5 08:58:02 2010
@@ -28,6 +28,7 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * This is a subclass of RAMDirectory that adds methods
@@ -213,7 +214,12 @@ public class MockRAMDirectory extends RA
       throw new IOException("file " + name + " already exists");
     else {
       if (existing!=null) {
-        sizeInBytes.getAndAdd(-existing.sizeInBytes);
+        //BACKWARDS BREAK in RamDirectory: sizeInBytes -= existing.sizeInBytes;
+        try {
+          ((AtomicLong) getClass().getSuperclass().getDeclaredField("sizeInBytes").get(this)).getAndAdd(-existing.sizeInBytes);
+        } catch (Exception e) {
+          throw new RuntimeException("Backwards-hack failed.", e);
+        }
         existing.directory = null;
       }
 

Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/TestHugeRamFile.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/TestHugeRamFile.java?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/TestHugeRamFile.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/store/TestHugeRamFile.java
Mon Jul  5 08:58:02 2010
@@ -33,7 +33,7 @@ public class TestHugeRamFile extends Luc
     private long capacity = 0;
     private HashMap singleBuffers = new HashMap();
     @Override
-    byte[] newBuffer(int size) {
+    protected byte[] newBuffer(int size) {
       capacity += size;
       if (capacity <= MAX_VALUE) {
         // below maxint we reuse buffers

Modified: lucene/dev/branches/branch_3x/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/build.xml?rev=960490&r1=960489&r2=960490&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/build.xml (original)
+++ lucene/dev/branches/branch_3x/lucene/build.xml Mon Jul  5 08:58:02 2010
@@ -53,7 +53,7 @@
   </path>
 
   <patternset id="src.dist.patterns"
-              includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/"
+              includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/,backwards/"
               excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/,contrib/benchmark/temp/,contrib/benchmark/work/"
   />
   <patternset id="binary.build.dist.patterns"
@@ -76,13 +76,11 @@
           description="Runs all unit tests (core, contrib and back-compat)"
   />
 
-  <path id="backwards.compile.classpath">
-    <pathelement location="${build.dir.backwards}/classes/java"/>
-  </path>
-	
   <path id="backwards.test.compile.classpath">
     <path refid="junit-path"/>
-    <pathelement location="${build.dir.backwards}/classes/java"/>
+    <fileset dir="${backwards.dir}/lib">
+      <include name="lucene-core*.jar"/>
+    </fileset>
   </path>
 	
   <path id="backwards.junit.classpath">
@@ -92,31 +90,15 @@
     <pathelement path="${java.class.path}"/>
   </path>
 
-  <available property="backwards.available" file="${backwards.dir}/src"/>
-  
   <!-- remove this -->
   <target name="test-tag" depends="test-backwards" description="deprecated"/>
   
-  <target name="test-backwards-message" unless="backwards.available">
-<echo level="warning">WARNING: Backwards compatibility tests can only be run from SVN
checkout.
-The source distribution does not contain sources of the previous Lucene Java version.</echo>
-  </target>
-
-  <target name="compile-backwards" depends="compile-core, jar-core, test-backwards-message"
-  	description="Runs tests of a previous Lucene version." if="backwards.available">
+  <target name="compile-backwards" depends="compile-core, jar-core"
+  	description="Runs tests of a previous Lucene version.">
     <sequential>
       <mkdir dir="${build.dir.backwards}"/>	  
-
-      <!-- first compile branch classes -->
-      <compile
-        srcdir="${backwards.dir}/src/java"
-        destdir="${build.dir.backwards}/classes/java"
-        javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"
-      >
-        <classpath refid="backwards.compile.classpath"/>
-      </compile>
           
-      <!-- compile branch tests against branch classpath -->	
+      <!-- compile branch tests against previous version JAR file -->	
       <compile-test-macro srcdir="${backwards.dir}/src/test" destdir="${build.dir.backwards}/classes/test"
                   test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}"
javac.target="${javac.target.backwards}"/>
       
@@ -124,10 +106,10 @@ The source distribution does not contain
     </sequential>
   </target>	
 
-  <target name="test-backwards" depends="compile-backwards, junit-backwards-mkdir, junit-backwards-sequential,
junit-backwards-parallel" if="backwards.available"/>
+  <target name="test-backwards" depends="compile-backwards, junit-backwards-mkdir, junit-backwards-sequential,
junit-backwards-parallel"/>
 
   <target name="junit-backwards-mkdir">
-	<mkdir dir="${build.dir.backwards}/test"/>
+    <mkdir dir="${build.dir.backwards}/test"/>
   </target>
 
   <macrodef name="backwards-test-macro">
@@ -145,20 +127,11 @@ The source distribution does not contain
   	</sequential>
   </macrodef>
 
-  <target name="check-backwards-cond">
-    <condition property="run-backwards-sequential">
-      <and>
-        <isset property="backwards.available"/>
-        <isset property="runsequential"/>
-      </and>
-    </condition>
-  </target>
-
-  <target name="junit-backwards-sequential" depends="check-backwards-cond" if="run-backwards-sequential">
+  <target name="junit-backwards-sequential" if="runsequential">
     <backwards-test-macro/>
   </target>
 
-  <target name="junit-backwards-parallel" unless="runsequential" if="backwards.available">
+  <target name="junit-backwards-parallel" unless="runsequential">
     <parallel threadsPerProcessor="${threadsPerProcessor}">
      <backwards-test-macro threadNum="1" threadTotal="8"/>
      <backwards-test-macro threadNum="2" threadTotal="8"/>



Mime
View raw message