Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.file.Files;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
Expand All @@ -33,7 +34,7 @@ public class TestFileChannelLogWriter
public void testLogRecordBounds()
throws Exception
{
File file = File.createTempFile("test", ".log");
File file = Files.createTempFile("test", ".log").toFile();
try {
int recordSize = LogConstants.BLOCK_SIZE - LogConstants.HEADER_SIZE;
Slice record = new Slice(recordSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.file.Files;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
Expand All @@ -33,7 +34,7 @@ public class TestMMapLogWriter
public void testLogRecordBounds()
throws Exception
{
File file = File.createTempFile("test", ".log");
File file = Files.createTempFile("test", ".log").toFile();
try {
int recordSize = LogConstants.BLOCK_SIZE - LogConstants.HEADER_SIZE;
Slice record = new Slice(recordSize);
Expand Down
3 changes: 2 additions & 1 deletion leveldb/src/test/java/org/iq80/leveldb/table/TableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Expand Down Expand Up @@ -168,7 +169,7 @@ public void setUp()
private void reopenFile()
throws IOException
{
file = File.createTempFile("table", ".db");
file = Files.createTempFile("table", ".db").toFile();
file.delete();
randomAccessFile = new RandomAccessFile(file, "rw");
fileChannel = randomAccessFile.getChannel();
Expand Down