Home
last modified time | relevance | path

Searched refs:mockPath (Results 1 – 3 of 3) sorted by relevance

/libcore/luni/src/test/java/libcore/java/nio/file/
DFilesTest.java69 private Path mockPath; field in FilesTest
79 when(mockPath.getFileSystem()).thenReturn(mockFileSystem); in setUp()
88 when(mockFileSystemProvider.newInputStream(mockPath, READ)).thenReturn(is); in test_newInputStream()
90 assertSame(is, Files.newInputStream(mockPath, READ)); in test_newInputStream()
92 verify(mockFileSystemProvider).newInputStream(mockPath, READ); in test_newInputStream()
100 when(mockFileSystemProvider.newOutputStream(mockPath, APPEND)).thenReturn(os); in test_newOutputStream()
102 assertSame(os, Files.newOutputStream(mockPath, APPEND)); in test_newOutputStream()
104 verify(mockFileSystemProvider).newOutputStream(mockPath, APPEND); in test_newOutputStream()
114 when(mockFileSystemProvider.newByteChannel(mockPath, openOptions)).thenReturn(sfc); in test_newByteChannel()
116 assertSame(sfc, Files.newByteChannel(mockPath, READ)); in test_newByteChannel()
[all …]
DFiles2Test.java102 private Path mockPath; field in Files2Test
112 when(mockPath.getFileSystem()).thenReturn(mockFileSystem); in setUp()
120 assertEquals(mockPath2, Files.move(mockPath, mockPath2, mockCopyOption)); in test_move()
121 verify(mockFileSystemProvider).move(mockPath, mockPath2, mockCopyOption); in test_move()
126 when(mockFileSystemProvider.readSymbolicLink(mockPath)).thenReturn(mockPath2); in test_readSymbolicLink()
127 assertEquals(mockPath2, Files.readSymbolicLink(mockPath)); in test_readSymbolicLink()
128 verify(mockFileSystemProvider).readSymbolicLink(mockPath); in test_readSymbolicLink()
133 when(mockFileSystemProvider.isSameFile(mockPath, mockPath2)).thenReturn(true); in test_isSameFile()
134 when(mockFileSystemProvider.isSameFile(mockPath2, mockPath)).thenReturn(false); in test_isSameFile()
135 assertTrue(Files.isSameFile(mockPath, mockPath2)); in test_isSameFile()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DFileChannelTest.java302 Path mockPath = mock(Path.class); in test_open_Path_Set_FileAttributes() local
314 when(mockPath.getFileSystem()).thenReturn(mockFileSystem); in test_open_Path_Set_FileAttributes()
316 when(mockFileSystemProvider.newFileChannel(mockPath, standardOpenOptions, in test_open_Path_Set_FileAttributes()
319 assertEquals(mockFileChannel, FileChannel.open(mockPath, standardOpenOptions, in test_open_Path_Set_FileAttributes()
330 Path mockPath = mock(Path.class); in test_open_Path_OpenOptions() local
339 when(mockPath.getFileSystem()).thenReturn(mockFileSystem); in test_open_Path_OpenOptions()
341 when(mockFileSystemProvider.newFileChannel(mockPath, standardOpenOptions)) in test_open_Path_OpenOptions()
344 assertEquals(mockFileChannel, FileChannel.open(mockPath, READ, WRITE)); in test_open_Path_OpenOptions()