cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject svn commit: r1178868 - in /cassandra/branches/cassandra-1.0.0: CHANGES.txt test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
Date Tue, 04 Oct 2011 17:16:09 GMT
Author: xedin
Date: Tue Oct  4 17:16:08 2011
New Revision: 1178868

URL: http://svn.apache.org/viewvc?rev=1178868&view=rev
Log:
Fix broken CompressedRandomAccessReaderTest
patch by Pavel Yaskevich; reviewed by Jonathan Ellis for CASSANDRA-3298

Modified:
    cassandra/branches/cassandra-1.0.0/CHANGES.txt
    cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java

Modified: cassandra/branches/cassandra-1.0.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/CHANGES.txt?rev=1178868&r1=1178867&r2=1178868&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0.0/CHANGES.txt Tue Oct  4 17:16:08 2011
@@ -14,6 +14,7 @@
  * Change default heap thresholds to max(min(1/2 ram, 1G), min(1/4 ram, 8GB))
    (CASSANDRA-3295)
  * Fix missing fields in CLI `show schema` output (CASSANDRA-3304)
+ * Fix broken CompressedRandomAccessReaderTest (CASSANDRA-3298)
 
 1.0.0-rc2
  * Log a meaningful warning when a node receives a message for a repair session

Modified: cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java?rev=1178868&r1=1178867&r2=1178868&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
(original)
+++ cassandra/branches/cassandra-1.0.0/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
Tue Oct  4 17:16:08 2011
@@ -36,22 +36,21 @@ public class CompressedRandomAccessReade
     public void testResetAndTruncate() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(false, 10);
-        testResetAndTruncate(false, CompressionParameters.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("normal", "1"), false, 10);
+        testResetAndTruncate(File.createTempFile("normal", "2"), false, CompressionParameters.DEFAULT_CHUNK_LENGTH);
     }
 
     @Test
     public void testResetAndTruncateCompressed() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(true, 10);
-        testResetAndTruncate(true, CompressionParameters.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("compressed", "1"), true, 10);
+        testResetAndTruncate(File.createTempFile("compressed", "2"), true, CompressionParameters.DEFAULT_CHUNK_LENGTH);
     }
 
-    private void testResetAndTruncate(boolean compressed, int junkSize) throws IOException
+    private void testResetAndTruncate(File f, boolean compressed, int junkSize) throws IOException
     {
-        String filename = "corruptFile";
-        File f = new File(filename);
+        final String filename = f.getAbsolutePath();
 
         try
         {



Mime
View raw message