lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r928243 - /lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Date Sat, 27 Mar 2010 18:34:21 GMT
Author: uschindler
Date: Sat Mar 27 18:34:21 2010
New Revision: 928243

URL: http://svn.apache.org/viewvc?rev=928243&view=rev
Log:
Use getDataDir also for index backwards compatibility tests

Modified:
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=928243&r1=928242&r2=928243&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
(original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Sat Mar 27 18:34:21 2010
@@ -74,11 +74,11 @@ public class TestBackwardsCompatibility 
   }
   */
 
-  /* Unzips dirName + ".zip" --> dirName, removing dirName
+  /* Unzips zipName --> dirName, removing dirName
      first */
-  public void unzip(String zipName, String destDirName) throws IOException {
+  public void unzip(File zipName, String destDirName) throws IOException {
 
-    ZipFile zipFile = new ZipFile(zipName + ".zip");
+    ZipFile zipFile = new ZipFile(zipName);
 
     Enumeration<? extends ZipEntry> entries = zipFile.entries();
 
@@ -205,8 +205,7 @@ public class TestBackwardsCompatibility 
     int hasTested29 = 0;
     
     for(int i=0;i<oldNames.length;i++) {
-      String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];
-      unzip(dirName, oldNames[i]);
+      unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);
       String fullPath = fullDir(oldNames[i]);
       Directory dir = FSDirectory.open(new File(fullPath));
 
@@ -236,8 +235,7 @@ public class TestBackwardsCompatibility 
 
   public void testSearchOldIndex() throws IOException {
     for(int i=0;i<oldNames.length;i++) {
-      String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];
-      unzip(dirName, oldNames[i]);
+      unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);
       searchIndex(oldNames[i], oldNames[i]);
       rmDir(oldNames[i]);
     }
@@ -245,8 +243,7 @@ public class TestBackwardsCompatibility 
 
   public void testIndexOldIndexNoAdds() throws IOException {
     for(int i=0;i<oldNames.length;i++) {
-      String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];
-      unzip(dirName, oldNames[i]);
+      unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);
       changeIndexNoAdds(oldNames[i]);
       rmDir(oldNames[i]);
     }
@@ -254,8 +251,7 @@ public class TestBackwardsCompatibility 
 
   public void testIndexOldIndex() throws IOException {
     for(int i=0;i<oldNames.length;i++) {
-      String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];
-      unzip(dirName, oldNames[i]);
+      unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);
       changeIndexWithAdds(oldNames[i]);
       rmDir(oldNames[i]);
     }



Mime
View raw message