Skip to content

Commit 8790058

Browse files
cmhulbertbogovicj
authored andcommitted
cleanup(test): cleanup uses of old FileSystemKVA constructor
Signed-off-by: Caleb Hulbert <cmhulbert@gmail.com>
1 parent 3b60ded commit 8790058

6 files changed

Lines changed: 10 additions & 15 deletions

File tree

src/test/java/org/janelia/saalfeldlab/n5/N5CachedFSTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void cacheBehaviorTest() throws IOException, URISyntaxException {
171171

172172
final String loc = tempN5Location();
173173
// make an uncached n5 writer
174-
try (final N5TrackingStorage n5 = new N5TrackingStorage(new FileSystemKeyValueAccess(FileSystems.getDefault()), loc,
174+
try (final N5TrackingStorage n5 = new N5TrackingStorage(new FileSystemKeyValueAccess(), loc,
175175
new GsonBuilder(), true)) {
176176

177177
cacheBehaviorHelper(n5);

src/test/java/org/janelia/saalfeldlab/n5/benchmarks/N5BlockWriteBenchmarks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void setup() {
113113
File tmpDir;
114114
try {
115115
tmpDir = Files.createTempDirectory("n5-blockWriteBenchmark-").toFile();
116-
FileSystemKeyValueAccess kva = new FileSystemKeyValueAccess(FileSystems.getDefault());
116+
FileSystemKeyValueAccess kva = new FileSystemKeyValueAccess();
117117
n5 = new N5KeyValueWriter(kva, tmpDir.getAbsolutePath(), new GsonBuilder(), true);
118118

119119
int[] blockSize = new int[numDimensions];

src/test/java/org/janelia/saalfeldlab/n5/benchmarks/ReadDataBenchmarks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected Path getPath() {
109109
public void setup() throws IOException {
110110

111111
random = new Random();
112-
kva = new FileSystemKeyValueAccess(FileSystems.getDefault());
112+
kva = new FileSystemKeyValueAccess();
113113

114114
basePath = Files.createTempDirectory("ReadDataBenchmark-");
115115
tmpPaths = new ArrayList<>();

src/test/java/org/janelia/saalfeldlab/n5/kva/FileSystemKeyValueAccessTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class FileSystemKeyValueAccessTest extends AbstractKeyValueAccessTest {
5757

5858
private static String separator = FileSystems.getDefault().getSeparator();
5959

60-
private static final FileSystemKeyValueAccess fileSystemKva = new FileSystemKeyValueAccess(FileSystems.getDefault());
60+
private static final FileSystemKeyValueAccess fileSystemKva = new FileSystemKeyValueAccess();
6161
@Override
6262
protected KeyValueAccess newKeyValueAccess(URI root) {
6363

src/test/java/org/janelia/saalfeldlab/n5/readdata/ReadDataTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void testFileKvaReadData() throws IOException {
113113
os.write(data);
114114
}
115115

116-
try( final VolatileReadData readData = new FileSystemKeyValueAccess(FileSystems.getDefault())
116+
try( final VolatileReadData readData = new FileSystemKeyValueAccess()
117117
.createReadData(tmpF.getAbsolutePath())) {
118118

119119
assertEquals("file read data length", -1, readData.length());

src/test/java/org/janelia/saalfeldlab/n5/shard/ShardTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@
3737
import java.nio.ByteBuffer;
3838
import java.nio.ByteOrder;
3939
import java.nio.channels.FileChannel;
40-
import java.nio.file.FileSystem;
41-
import java.nio.file.FileSystems;
42-
import java.nio.file.Files;
43-
import java.nio.file.NoSuchFileException;
44-
import java.nio.file.Path;
45-
import java.nio.file.StandardOpenOption;
40+
import java.nio.file.*;
4641
import java.util.ArrayList;
4742
import java.util.Arrays;
4843
import java.util.Collection;
@@ -691,7 +686,7 @@ public static class TrackingN5Writer extends N5KeyValueWriter {
691686
final TrackingFileSystemKeyValueAccess tkva;
692687
public TrackingN5Writer(String basePath) {
693688

694-
super( new TrackingFileSystemKeyValueAccess(FileSystems.getDefault()), basePath, new GsonBuilder(), false);
689+
super( new TrackingFileSystemKeyValueAccess(), basePath, new GsonBuilder(), false);
695690
tkva = (TrackingFileSystemKeyValueAccess)getKeyValueAccess();
696691
}
697692

@@ -732,8 +727,8 @@ private static class TrackingFileSystemKeyValueAccess extends FileSystemKeyValue
732727
private int numIsFileCalls = 0;
733728
private long totalBytesRead = 0;
734729

735-
protected TrackingFileSystemKeyValueAccess(FileSystem fileSystem) {
736-
super(fileSystem);
730+
protected TrackingFileSystemKeyValueAccess() {
731+
super();
737732
}
738733

739734
@Override
@@ -745,7 +740,7 @@ public boolean isFile(String normalPath) {
745740
@Override
746741
public VolatileReadData createReadData(final String normalPath) {
747742
try {
748-
return VolatileReadData.from(new TrackingFileLazyRead(fileSystem.getPath(normalPath)));
743+
return VolatileReadData.from(new TrackingFileLazyRead(Paths.get(normalPath)));
749744
} catch (N5NoSuchKeyException e) {
750745
// return VolatileReadData.from(new NoSuchKeyLazyRead());
751746
return null;

0 commit comments

Comments
 (0)