lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject [1/2] lucene-solr:master: SOLR-8610: Fix temporary dir usage in DIH
Date Tue, 07 Jun 2016 08:54:30 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master a9dea9a98 -> 5c672e14f


SOLR-8610: Fix temporary dir usage in DIH


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3c9e36b1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3c9e36b1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3c9e36b1

Branch: refs/heads/master
Commit: 3c9e36b1e10324cb5dd8a68fda64e8c0262d860f
Parents: a9dea9a
Author: Uwe Schindler <uschindler@apache.org>
Authored: Tue Jun 7 10:51:41 2016 +0200
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Tue Jun 7 10:51:41 2016 +0200

----------------------------------------------------------------------
 .../handler/dataimport/TestDocBuilder2.java     |  2 +-
 .../dataimport/TestFileListEntityProcessor.java | 21 +++++++++++---------
 .../handler/dataimport/TestJdbcDataSource.java  |  4 +---
 3 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3c9e36b1/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
index 17564b7..40ee2b9 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
@@ -253,7 +253,7 @@ public class TestDocBuilder2 extends AbstractDataImportHandlerTestCase
{
   @Test
   @Ignore("Fix Me. See SOLR-4103.")
   public void testFileListEntityProcessor_lastIndexTime() throws Exception  {
-    File tmpdir = File.createTempFile("test", "tmp", createTempDir().toFile());
+    File tmpdir = createTempDir().toFile();
 
     Map<String, String> params = createMap("baseDir", tmpdir.getAbsolutePath());
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3c9e36b1/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
index 28f0278..7674dd5 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
@@ -15,18 +15,23 @@
  * limitations under the License.
  */
 package org.apache.solr.handler.dataimport;
-import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.TestUtil;
-import org.apache.solr.common.util.SuppressForbidden;
-import org.junit.Ignore;
-import org.junit.Test;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.solr.common.util.SuppressForbidden;
+import org.junit.Test;
 
 /**
  * <p>
@@ -65,9 +70,7 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
   
   @Test
   public void testBiggerSmallerFiles() throws IOException {
-    File tmpdir = File.createTempFile("test", "tmp", createTempDir().toFile());
-    Files.delete(tmpdir.toPath());
-    tmpdir.mkdir();
+    File tmpdir = createTempDir().toFile();
 
     long minLength = Long.MAX_VALUE;
     String smallestFile = "";

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3c9e36b1/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
index 3b1568f..38ca83e 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
@@ -465,9 +465,7 @@ public class TestJdbcDataSource extends AbstractDataImportHandlerTestCase
{
   }
   
   private String createEncryptionKeyFile() throws IOException {
-    File tmpdir = File.createTempFile("test", "tmp", createTempDir().toFile());
-    Files.delete(tmpdir.toPath());
-    tmpdir.mkdir();
+    File tmpdir = createTempDir().toFile();
     byte[] content = "secret".getBytes(StandardCharsets.UTF_8);
     createFile(tmpdir, "enckeyfile.txt", content, false);
     return new File(tmpdir, "enckeyfile.txt").getAbsolutePath();


Mime
View raw message