lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r950836 - /lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py
Date Thu, 03 Jun 2010 00:48:26 GMT
Author: vajda
Date: Thu Jun  3 00:48:26 2010
New Revision: 950836

URL: http://svn.apache.org/viewvc?rev=950836&view=rev
Log:
fixed test failure

Modified:
    lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py

Modified: lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py?rev=950836&r1=950835&r2=950836&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py
(original)
+++ lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/indexing/LockTest.py
Thu Jun  3 00:48:26 2010
@@ -26,8 +26,17 @@ class LockTest(TestCase):
 
         indexDir = os.path.join(System.getProperty("java.io.tmpdir", "tmp"),
                                 "index")
+        self.rmdir(indexDir)
         self.dir = SimpleFSDirectory(File(indexDir))
 
+    def rmdir(self, dir):
+
+        for dir, dirnames, filenames in os.walk(dir):
+            for filename in filenames:
+                os.remove(os.path.join(dir, filename))
+            for dirname in dirnames:
+                os.rmdir(os.path.join(dir, dirname))
+
     def testWriteLock(self):
 
         writer1 = IndexWriter(self.dir, SimpleAnalyzer(),
@@ -42,6 +51,5 @@ class LockTest(TestCase):
             except:
                 pass
         finally:
-            IndexWriter.unlock(self.dir)
             writer1.close()
             self.assert_(writer2 is None)



Mime
View raw message