lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r927635 - /lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java
Date Thu, 25 Mar 2010 23:09:56 GMT
Author: yonik
Date: Thu Mar 25 23:09:55 2010
New Revision: 927635

URL: http://svn.apache.org/viewvc?rev=927635&view=rev
Log:
tests: set ramdir for junit4 based tests too

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java?rev=927635&r1=927634&r2=927635&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java Thu Mar 25 23:09:55
2010
@@ -154,14 +154,26 @@ public class SolrTestCaseJ4 extends Luce
 
   public static Logger log = LoggerFactory.getLogger(SolrTestCaseJ4.class);
 
+  private static String factoryProp;
+
   public static void initCore() throws Exception {
     log.info("####initCore");
+    ignoreException("ignore_exception");
+    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());
             + System.currentTimeMillis());
     dataDir.mkdirs();
 
+    // other  methods like starting a jetty instance need these too
+    System.setProperty("solr.test.sys.prop1", "propone");
+    System.setProperty("solr.test.sys.prop2", "proptwo");
+
     String configFile = getSolrConfigFile();
     if (configFile != null) {
 
@@ -211,6 +223,10 @@ public class SolrTestCaseJ4 extends Luce
       }
     }
 
+    if (factoryProp == null) {
+      System.clearProperty("solr.directoryFactory");
+    }
+    
     dataDir = null;
     solrConfig = null;
     h = null;



Mime
View raw message