lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r927996 - in /lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene: index/ store/ util/
Date Fri, 26 Mar 2010 18:13:39 GMT
Author: uschindler
Date: Fri Mar 26 18:13:39 2010
New Revision: 927996

URL: http://svn.apache.org/viewvc?rev=927996&view=rev
Log:
Use preferably sysprop "temptDir" also in backwards tests.

Modified:
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/store/TestRAMDirectory.java
    lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/_TestUtil.java

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestFieldsReader.java
(original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestFieldsReader.java
Fri Mar 26 18:13:39 2010
@@ -384,9 +384,9 @@ public class TestFieldsReader extends Lu
 
   // LUCENE-1262
   public void testExceptions() throws Throwable {
-    String tempDir = System.getProperty("java.io.tmpdir");
+    String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
     if (tempDir == null)
-      throw new IOException("java.io.tmpdir undefined, cannot run test");
+      throw new IOException("System property tempDir undefined, cannot run test");
     File indexDir = new File(tempDir, "testfieldswriterexceptions");
 
     try {

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
(original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
Fri Mar 26 18:13:39 2010
@@ -81,10 +81,9 @@ public class TestIndexReaderCloneNorms e
    */
   public void testNorms() throws IOException {
     // tmp dir
-    String tempDir = System.getProperty("java.io.tmpdir");
-    if (tempDir == null) {
-      throw new IOException("java.io.tmpdir undefined, cannot run test");
-    }
+    String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
+    if (tempDir == null)
+      throw new IOException("System property tempDir undefined, cannot run test");
 
     // test with a single index: index1
     File indexDir1 = new File(tempDir, "lucenetestindex1");

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
(original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
Fri Mar 26 18:13:39 2010
@@ -1095,9 +1095,9 @@ public class TestIndexReaderReopen exten
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    String tempDir = System.getProperty("java.io.tmpdir");
+    String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
     if (tempDir == null)
-      throw new IOException("java.io.tmpdir undefined, cannot run test");
+      throw new IOException("System property tempDir undefined, cannot run test");
     indexDir = new File(tempDir, "IndexReaderReopen");
   }
   

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
(original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
Fri Mar 26 18:13:39 2010
@@ -39,8 +39,10 @@ public class TestIndexWriterLockRelease 
     public void setUp() throws Exception {
         super.setUp();
         if (this.__test_dir == null) {
-            String tmp_dir = System.getProperty("java.io.tmpdir", "tmp");
-            this.__test_dir = new File(tmp_dir, "testIndexWriter");
+            String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
+            if (tempDir == null)
+              throw new IOException("System property tempDir undefined, cannot run test");
+            this.__test_dir = new File(tempDir, "testIndexWriter");
 
             if (this.__test_dir.exists()) {
                 throw new IOException("test directory \"" + this.__test_dir.getPath() + "\"
already exists (please remove by hand)");

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/store/TestRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/store/TestRAMDirectory.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/store/TestRAMDirectory.java
(original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/store/TestRAMDirectory.java
Fri Mar 26 18:13:39 2010
@@ -49,9 +49,9 @@ public class TestRAMDirectory extends Lu
   @Override
   public void setUp () throws Exception {
     super.setUp();
-    String tempDir = System.getProperty("java.io.tmpdir");
+    String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
     if (tempDir == null)
-      throw new IOException("java.io.tmpdir undefined, cannot run test");
+      throw new IOException("System property tempDir undefined, cannot run test");
     indexDir = new File(tempDir, "RAMDirIndex");
     
     Directory dir = FSDirectory.open(indexDir);

Modified: lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/_TestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/_TestUtil.java?rev=927996&r1=927995&r2=927996&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/_TestUtil.java (original)
+++ lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/_TestUtil.java Fri Mar
26 18:13:39 2010
@@ -33,9 +33,9 @@ public class _TestUtil {
   /** Returns temp dir, containing String arg in its name;
    *  does not create the directory. */
   public static File getTempDir(String desc) {
-    String tempDir = System.getProperty("java.io.tmpdir");
+    String tempDir = System.getProperty("tempDir", System.getProperty("java.io.tmpdir"));
     if (tempDir == null)
-      throw new RuntimeException("java.io.tmpdir undefined, cannot run test");
+      throw new RuntimeException("System property tempDir undefined, cannot run test");
     return new File(tempDir, desc + "." + new Random().nextLong());
   }
 



Mime
View raw message