Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Add 4.1 indexes to TestBackwardsCompatibility

Steven Rowea78a2b6fb538
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 87727db3d76..4968bd5af9c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -81,14 +81,22 @@ import org.junit.BeforeClass;
@SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom"})
public class TestBackwardsCompatibility extends LuceneTestCase {
- // Uncomment these cases & run them on an older Lucene
- // version, to generate an index to test backwards
- // compatibility. Then, cd to build/test/index.cfs and
- // run "zip index.<VERSION>.cfs.zip *"; cd to
- // build/test/index.nocfs and run "zip
- // index.<VERSION>.nocfs.zip *". Then move those 2 zip
- // files to your trunk checkout and add them to the
- // oldNames array.
+ // Uncomment these cases & run them on an older Lucene version,
+ // to generate indexes to test backwards compatibility. These
+ // indexes will be created under directory /tmp/idx/.
+ //
+ // However, you must first disable the Lucene TestSecurityManager,
+ // which will otherwise disallow writing outside of the build/
+ // directory - to do this, comment out the "java.security.manager"
+ // <sysproperty> under the "test-macro" <macrodef>.
+ //
+ // Zip up the generated indexes:
+ //
+ // cd /tmp/idx/index.cfs ; zip index.<VERSION>.cfs.zip *
+ // cd /tmp/idx/index.nocfs ; zip index.<VERSION>.nocfs.zip *
+ //
+ // Then move those 2 zip files to your trunk checkout and add them
+ // to the oldNames array.
/*
public void testCreateCFS() throws IOException {
@@ -149,6 +157,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
final static String[] oldNames = {"40.cfs",
"40.nocfs",
+ "41.cfs",
+ "41.nocfs",
};
final String[] unsupportedNames = {"19.cfs",
@@ -537,7 +547,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
public File createIndex(String dirName, boolean doCFS, boolean fullyMerged) throws IOException {
// we use a real directory name that is not cleaned up, because this method is only used to create backwards indexes:
- File indexDir = new File("/tmp/4x", dirName);
+ File indexDir = new File("/tmp/idx", dirName);
_TestUtil.rmDir(indexDir);
Directory dir = newFSDirectory(indexDir);
LogByteSizeMergePolicy mp = new LogByteSizeMergePolicy();
diff --git a/lucene/core/src/test/org/apache/lucene/index/index.41.cfs.zip b/lucene/core/src/test/org/apache/lucene/index/index.41.cfs.zip
new file mode 100644
index 00000000000..4d911a27005
Binary files /dev/null and b/lucene/core/src/test/org/apache/lucene/index/index.41.cfs.zip differ
diff --git a/lucene/core/src/test/org/apache/lucene/index/index.41.nocfs.zip b/lucene/core/src/test/org/apache/lucene/index/index.41.nocfs.zip
new file mode 100644
index 00000000000..7c18c451b66
Binary files /dev/null and b/lucene/core/src/test/org/apache/lucene/index/index.41.nocfs.zip differ