lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r925613 - /lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java
Date Sat, 20 Mar 2010 13:51:27 GMT
Author: yonik
Date: Sat Mar 20 13:51:27 2010
New Revision: 925613

URL: http://svn.apache.org/viewvc?rev=925613&view=rev
Log:
support for using RAMDirectory

Modified:
    lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java

Modified: lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java?rev=925613&r1=925612&r2=925613&view=diff
==============================================================================
--- lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java
(original)
+++ lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/util/AbstractSolrTestCase.java
Sat Mar 20 13:51:27 2010
@@ -100,8 +100,13 @@ public abstract class AbstractSolrTestCa
 
   public static Logger log = LoggerFactory.getLogger(AbstractSolrTestCase.class);
 
+  private String factoryProp;
   public void setUp() throws Exception {
     log.info("####SETUP_START " + getName());
+    factoryProp = System.getProperty("solr.directoryFactory");
+    if (factoryProp == null) {
+      // System.setProperty("solr.directoryFactory","solr.RAMDirectoryFactory");
+    }
     dataDir = new File(System.getProperty("java.io.tmpdir")
             + System.getProperty("file.separator")
             + getClass().getName() + "-" + System.currentTimeMillis());
@@ -144,6 +149,10 @@ public abstract class AbstractSolrTestCa
    */
   public void tearDown() throws Exception {
     log.info("####TEARDOWN_START " + getName());
+    if (factoryProp == null) {
+      System.clearProperty("solr.directoryFactory");
+    }
+
     if (h != null) { h.close(); }
     String skip = System.getProperty("solr.test.leavedatadir");
     if (null != skip && 0 != skip.trim().length()) {



Mime
View raw message