Repository: cassandra
Updated Branches:
  refs/heads/trunk a9138c5e9 -> 73ebd200c


Create Temporary folder for CompressedInputStreamTest

Use JUnit temporary folder which will be auto deleted after the test.

patch by Jay Zhuang; reviewed by Marcus Eriksson for CASSANDRA-14791


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/73ebd200
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/73ebd200
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/73ebd200

Branch: refs/heads/trunk
Commit: 73ebd200c04335624f956e79624cf8494d872f19
Parents: a9138c5
Author: Jay Zhuang <[email protected]>
Authored: Sun Oct 7 16:16:38 2018 -0700
Committer: Jay Zhuang <[email protected]>
Committed: Mon Oct 8 08:47:11 2018 -0700

----------------------------------------------------------------------
 .../streaming/compression/CompressedInputStreamTest.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/73ebd200/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
----------------------------------------------------------------------
diff --git 
a/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
 
b/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
index 14321fa..be443b5 100644
--- 
a/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
+++ 
b/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
@@ -21,7 +21,9 @@ import java.io.*;
 import java.util.*;
 
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ClusteringComparator;
@@ -47,6 +49,9 @@ import static org.junit.Assert.fail;
  */
 public class CompressedInputStreamTest
 {
+    @Rule
+    public TemporaryFolder tempFolder = new TemporaryFolder();
+
     @BeforeClass
     public static void setupDD()
     {
@@ -109,7 +114,7 @@ public class CompressedInputStreamTest
         assert valuesToCheck != null && valuesToCheck.length > 0;
 
         // write compressed data file of longs
-        File parentDir = FileUtils.getTempDir();
+        File parentDir = tempFolder.newFolder();
         Descriptor desc = new Descriptor(parentDir, "ks", "cf", 1);
         File tmp = new File(desc.filenameFor(Component.DATA));
         MetadataCollector collector = new MetadataCollector(new 
ClusteringComparator(BytesType.instance));


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to