lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rjer...@apache.org
Subject svn commit: r1596094 - in /lucene/dev/branches/lucene5650/solr: contrib/analysis-extras/src/test/org/apache/solr/schema/ contrib/clustering/src/test/org/apache/solr/handler/clustering/ contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimpo...
Date Mon, 19 May 2014 23:11:47 GMT
Author: rjernst
Date: Mon May 19 23:11:47 2014
New Revision: 1596094

URL: http://svn.apache.org/r1596094
Log:
LUCENE-5650: fix more contrib tests

Modified:
    lucene/dev/branches/lucene5650/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
    lucene/dev/branches/lucene5650/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
    lucene/dev/branches/lucene5650/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
    lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
    lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java

Modified: lucene/dev/branches/lucene5650/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5650/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java?rev=1596094&r1=1596093&r2=1596094&view=diff
==============================================================================
--- lucene/dev/branches/lucene5650/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
(original)
+++ lucene/dev/branches/lucene5650/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
Mon May 19 23:11:47 2014
@@ -17,16 +17,21 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
+import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 
+import java.io.File;
+
 /**
  * Tests expert options of {@link ICUCollationField}.
  */
 public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-icucollate.xml","schema-icucollateoptions.xml", "analysis-extras/solr");
+    File testHome = createTempDir();
+    FileUtils.copyDirectory(getFile("analysis-extras/solr"), testHome);
+    initCore("solrconfig-icucollate.xml","schema-icucollateoptions.xml", testHome.getAbsolutePath());
     // add some docs
     assertU(adoc("id", "1", "text", "foo-bar"));
     assertU(adoc("id", "2", "text", "foo bar"));

Modified: lucene/dev/branches/lucene5650/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5650/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java?rev=1596094&r1=1596093&r2=1596094&view=diff
==============================================================================
--- lucene/dev/branches/lucene5650/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
(original)
+++ lucene/dev/branches/lucene5650/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
Mon May 19 23:11:47 2014
@@ -16,8 +16,10 @@ package org.apache.solr.handler.clusteri
  * limitations under the License.
  */
 
+import java.io.File;
 import java.util.Map;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.BeforeClass;
@@ -31,7 +33,9 @@ public abstract class AbstractClustering
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig.xml", "schema.xml", "clustering/solr");
+    File testHome = createTempDir();
+    FileUtils.copyDirectory(getFile("clustering/solr"), testHome);
+    initCore("solrconfig.xml", "schema.xml", testHome.getAbsolutePath());
     numberOfDocs = 0;
     for (String[] doc : DOCUMENTS) {
       assertNull(h.validateUpdate(adoc("id", Integer.toString(numberOfDocs), "url", doc[0],
"title", doc[1], "snippet", doc[2])));

Modified: lucene/dev/branches/lucene5650/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5650/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java?rev=1596094&r1=1596093&r2=1596094&view=diff
==============================================================================
--- lucene/dev/branches/lucene5650/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
(original)
+++ lucene/dev/branches/lucene5650/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
Mon May 19 23:11:47 2014
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.handler.dataimport;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.LocalSolrQueryRequest;
@@ -55,7 +56,9 @@ public abstract class AbstractDataImport
 
   // note, a little twisted that we shadow this static method
   public static void initCore(String config, String schema) throws Exception {
-    initCore(config, schema, getFile("dih/solr").getAbsolutePath());
+    File testHome = createTempDir();
+    FileUtils.copyDirectory(getFile("dih/solr"), testHome);
+    initCore(config, schema, testHome.getAbsolutePath());
   }
   
   @Override

Modified: lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java?rev=1596094&r1=1596093&r2=1596094&view=diff
==============================================================================
--- lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
(original)
+++ lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
Mon May 19 23:11:47 2014
@@ -92,7 +92,7 @@ public class TestLBHttpSolrServer extend
     httpClient = HttpClientUtil.createClient(null);
     HttpClientUtil.setConnectionTimeout(httpClient,  1000);
     for (int i = 0; i < solr.length; i++) {
-      solr[i] = new SolrInstance("solr/collection1" + i, 0);
+      solr[i] = new SolrInstance("solr/collection1" + i, createTempDir("instance-" + i),
0);
       solr[i].setUp();
       solr[i].startJetty();
       addDocs(solr[i]);
@@ -250,9 +250,13 @@ public class TestLBHttpSolrServer extend
     int port;
     JettySolrRunner jetty;
 
-    public SolrInstance(String name, int port) {
+    public SolrInstance(String name, File homeDir, int port) {
       this.name = name;
+      this.homeDir = homeDir;
       this.port = port;
+
+      dataDir = new File(homeDir + "/collection1", "data");
+      confDir = new File(homeDir + "/collection1", "conf");
     }
 
     public String getHomeDir() {
@@ -285,12 +289,6 @@ public class TestLBHttpSolrServer extend
 
 
     public void setUp() throws Exception {
-      File home = new File(dataDir,
-              getClass().getName() + "-" + System.currentTimeMillis());
-      homeDir = new File(home, name);
-      dataDir = new File(homeDir + "/collection1", "data");
-      confDir = new File(homeDir + "/collection1", "conf");
-
       homeDir.mkdirs();
       dataDir.mkdirs();
       confDir.mkdirs();
@@ -301,7 +299,6 @@ public class TestLBHttpSolrServer extend
       FileUtils.copyFile(SolrTestCaseJ4.getFile(getSolrConfigFile()), f);
       f = new File(confDir, "schema.xml");
       FileUtils.copyFile(SolrTestCaseJ4.getFile(getSchemaFile()), f);
-
     }
 
     public void tearDown() throws Exception {

Modified: lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java?rev=1596094&r1=1596093&r2=1596094&view=diff
==============================================================================
--- lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
(original)
+++ lucene/dev/branches/lucene5650/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java
Mon May 19 23:11:47 2014
@@ -38,13 +38,7 @@ public class SolrPingTest extends SolrJe
   @BeforeClass
   public static void beforeClass() throws Exception {
     File testHome = createTempDir();
-    File testConf = new File(testHome, "collection1/conf");
-    testConf.mkdirs();
-    File originalHome = getFile("solrj/solr");
-    FileUtils.copyFile(new File(originalHome, "solr.xml"), new File(testHome, "solr.xml"));
-    File originalConf = new File(originalHome, "collection1/conf");
-    FileUtils.copyFile(new File(originalConf, "solrconfig.xml"), new File(testConf, "solrconfig.xml"));
-    FileUtils.copyFile(new File(originalConf, "schema.xml"), new File(testConf, "schema.xml"));
+    FileUtils.copyDirectory(getFile("solrj/solr"), testHome);
     initCore("solrconfig.xml", "schema.xml", testHome.getAbsolutePath(), "collection1");
   }
   



Mime
View raw message