@Test public void testOpen() throws Exception { FileHandleFiller filler = mock(FileHandleFiller.class); Path fooBar = mockPath("foo.bar"); when(fileSystem.provider().newFileChannel(eq(fooBar), eq(set(StandardOpenOption.READ)))).thenReturn(mock(FileChannel.class)); int result = fs.open("foo.bar", filler); assertThat(result).isEqualTo(SUCCESS); verify(filler).setFileHandle(gt(0)); verifyNoMoreInteractions(filler); verify(fileSystem.provider()).newFileChannel(eq(fooBar), eq(set(StandardOpenOption.READ))); verifyNoMoreInteractions(fileSystem.provider()); }
@Override public int open(String path, FileHandleFiller filler) { logger.info(path); return openReal(real(path), filler); }
MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem { @Override public int open(String path, FileHandleFiller filler) { logger.info(path); return openReal(real(path), filler); } }
MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem { @Override public int open(String path, FileHandleFiller filler) { logger.info(path); return openReal(real(path), filler); } MirrorFs(Path mirroredPath); @VisibleForTesting protected  MirrorFs(Path mirroredPath, FileChannelCloser fileChannelCloser); }
MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem { @Override public int open(String path, FileHandleFiller filler) { logger.info(path); return openReal(real(path), filler); } MirrorFs(Path mirroredPath); @VisibleForTesting protected  MirrorFs(Path mirroredPath, FileChannelCloser fileChannelCloser); @Override String getFSName(); @Override int getattr(String path, StatFiller stat); @Override int readdir(String path, DirectoryFiller filler); @Override int readLink(String path, Consumer<String> buf, int size); @Override int open(String path, FileHandleFiller filler); @Override int read(String path, Consumer<byte[]> buf, int size, long offset, int fileHandle); @Override int release(String path, int fileHandle); @Override void destroy(); }
MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem { @Override public int open(String path, FileHandleFiller filler) { logger.info(path); return openReal(real(path), filler); } MirrorFs(Path mirroredPath); @VisibleForTesting protected  MirrorFs(Path mirroredPath, FileChannelCloser fileChannelCloser); @Override String getFSName(); @Override int getattr(String path, StatFiller stat); @Override int readdir(String path, DirectoryFiller filler); @Override int readLink(String path, Consumer<String> buf, int size); @Override int open(String path, FileHandleFiller filler); @Override int read(String path, Consumer<byte[]> buf, int size, long offset, int fileHandle); @Override int release(String path, int fileHandle); @Override void destroy();  }