/external/mockftpserver/MockFtpServer/src/test/groovy/org/mockftpserver/fake/filesystem/ |
UnixFakeFileSystemTest.groovy | 16 package org.mockftpserver.fake.filesystem 45 assert !fileSystem.exists(FILE) 46 fileSystem.add(new FileEntry(FILE)) 47 def names = fileSystem.listNames(DIR) 52 assert fileSystem.path(null, null) == "" 53 assert fileSystem.path(null, "abc") == "abc" 54 assert fileSystem.path("abc", null) == "abc" 55 assert fileSystem.path("", "") == "" 56 assert fileSystem.path("", "abc") == "abc" 57 assert fileSystem.path("abc", "") == "abc [all...] |
WindowsFakeFileSystemTest.groovy | 16 package org.mockftpserver.fake.filesystem 46 assertFalse(X, fileSystem.exists(X)) 47 assertFalse(Y, fileSystem.exists(Y)) 49 fileSystem.add(new DirectoryEntry(X)) 50 fileSystem.add(new DirectoryEntry(Y)) 52 assertTrue(X, fileSystem.exists(X)) 53 assertTrue(Y, fileSystem.exists(Y)) 57 assert fileSystem.path(null, null) == "" 58 assert fileSystem.path(null, "abc") == "abc" 59 assert fileSystem.path("abc", null) == "abc [all...] |
AbstractFakeFileSystemTestCase.groovy | 16 package org.mockftpserver.fake.filesystem 34 assert fileSystem.directoryListingFormatter.class == expectedDirectoryListingFormatterClass 39 fileSystem.add(dirEntry) 41 fileSystem.add(fileEntry) 49 final NEW_SUBDIR = fileSystem.path(NEW_DIR, "sub") 50 assert !fileSystem.exists(NEW_DIR), "Before createDirectory" 51 assert !fileSystem.exists(NEW_SUBDIR), "Before createDirectory" 53 fileSystem.createParentDirectoriesAutomatically = true 54 fileSystem.add(new DirectoryEntry(NEW_SUBDIR)) 55 assert fileSystem.exists(NEW_DIR), "After createDirectory [all...] |
AbstractFileSystemTestCase.groovy | 16 package org.mockftpserver.fake.filesystem 21 * Abstract superclass for tests of FileSystem implementation classes. Contains common 46 protected FileSystem fileSystem 53 assert !fileSystem.exists(NEW_FILE) 54 assert !fileSystem.exists(NEW_DIR) 55 assert !fileSystem.exists(ILLEGAL_FILE) 56 assert fileSystem.exists(EXISTING_FILE) 57 assert fileSystem.exists(EXISTING_DIR) 59 shouldFailWithMessageContaining("path") { fileSystem.exists(null) [all...] |
/external/mockftpserver/MockFtpServer/src/test/groovy/org/mockftpserver/fake/ |
RunFakeFtpServer.groovy | 20 import org.mockftpserver.fake.filesystem.DirectoryEntry
21 import org.mockftpserver.fake.filesystem.FileEntry
22 import org.mockftpserver.fake.filesystem.UnixFakeFileSystem
37 def fileSystem = new UnixFakeFileSystem()
38 fileSystem.createParentDirectoriesAutomatically = true
39 fileSystem.add(new DirectoryEntry(HOME_DIR))
40 fileSystem.add(new DirectoryEntry("$HOME_DIR/subdir"))
41 fileSystem.add(new DirectoryEntry("$HOME_DIR/subdir2"))
42 fileSystem.add(new FileEntry(path: "$HOME_DIR/abc.txt", contents: '1234567890'))
43 fileSystem.add(new FileEntry(path: "$HOME_DIR/def.txt", contents: '1234567890')) [all...] |
FakeFtpServerIntegrationTest.groovy | 24 import org.mockftpserver.fake.filesystem.DirectoryEntry
25 import org.mockftpserver.fake.filesystem.FileEntry
26 import org.mockftpserver.fake.filesystem.FileSystem
27 import org.mockftpserver.fake.filesystem.UnixFakeFileSystem
28 import org.mockftpserver.fake.filesystem.WindowsFakeFileSystem
60 private FileSystem fileSystem
86 fileSystem.add(new FileEntry(path: FILE1, contents: ORIGINAL_CONTENTS))
93 def contents = fileSystem.getEntry(FILE1).createInputStream().text [all...] |
StubServerConfiguration.groovy | 20 import org.mockftpserver.fake.filesystem.FileSystem
33 FileSystem fileSystem
|
/external/mockftpserver/MockFtpServer/src/test/java/org/mockftpserver/fake/example/ |
SimpleUnixFakeFtpServerTest.java | 20 import org.mockftpserver.fake.filesystem.DirectoryEntry;
21 import org.mockftpserver.fake.filesystem.FileEntry;
22 import org.mockftpserver.fake.filesystem.FileSystem;
23 import org.mockftpserver.fake.filesystem.UnixFakeFileSystem;
29 * filesystem.
38 FileSystem fileSystem = new UnixFakeFileSystem();
39 fileSystem.add(new DirectoryEntry("/data"));
40 fileSystem.add(new FileEntry("/data/file1.txt", "abcdef 1234567890")); [all...] |
SimpleWindowsFakeFtpServerTest.java | 20 import org.mockftpserver.fake.filesystem.DirectoryEntry;
21 import org.mockftpserver.fake.filesystem.FileEntry;
22 import org.mockftpserver.fake.filesystem.FileSystem;
23 import org.mockftpserver.fake.filesystem.WindowsFakeFileSystem;
29 * filesystem.
38 FileSystem fileSystem = new WindowsFakeFileSystem();
39 fileSystem.add(new DirectoryEntry("c:\\data"));
40 fileSystem.add(new FileEntry("c:\\data\\file1.txt", "abcdef 1234567890")); [all...] |
WindowsFakeFileSystemPermissionsTest.java | 21 import org.mockftpserver.fake.filesystem.DirectoryEntry;
22 import org.mockftpserver.fake.filesystem.FileEntry;
23 import org.mockftpserver.fake.filesystem.FileSystem;
24 import org.mockftpserver.fake.filesystem.Permissions;
25 import org.mockftpserver.fake.filesystem.WindowsFakeFileSystem;
31 * filesystem, and including file/directory permissions.
44 FileSystem fileSystem = new WindowsFakeFileSystem();
65 fileSystem.add(directoryEntry1); [all...] |
RemoteFileTest.java | 20 import org.mockftpserver.fake.filesystem.FileEntry;
21 import org.mockftpserver.fake.filesystem.FileSystem;
22 import org.mockftpserver.fake.filesystem.UnixFakeFileSystem;
61 FileSystem fileSystem = new UnixFakeFileSystem();
62 fileSystem.add(new FileEntry(FILE, CONTENTS));
63 fakeFtpServer.setFileSystem(fileSystem);
|
/external/mockftpserver/MockFtpServer/src/test/groovy/org/mockftpserver/fake/command/ |
AbstractStoreFileCommandHandlerTestCase.groovy | 21 import org.mockftpserver.fake.filesystem.FileEntry 22 import org.mockftpserver.fake.filesystem.FileSystemEntry 23 import org.mockftpserver.fake.filesystem.FileSystemException 24 import org.mockftpserver.fake.filesystem.Permissions 45 fileSystem.add(new FileEntry(path: FILE)) 46 fileSystem.getEntry(FILE).permissions = Permissions.NONE 48 assertSessionReply(ReplyCodes.WRITE_FILE_ERROR, ['filesystem.cannotWrite', FILE]) 52 fileSystem.getEntry(DIR).permissions = new Permissions('r-xr-xr-x') 54 assertSessionReply(ReplyCodes.WRITE_FILE_ERROR, ['filesystem.cannotWrite', DIR]) 58 fileSystem.add(new FileEntry(path: FILE) [all...] |
RntoCommandHandlerTest.groovy | 23 import org.mockftpserver.fake.filesystem.FileSystemException 24 import org.mockftpserver.fake.filesystem.Permissions 44 assert !fileSystem.exists(FROM_FILE), FROM_FILE 45 assert fileSystem.exists(TO_FILE), TO_FILE 53 assert !fileSystem.exists(FROM_FILE), FROM_FILE 54 assert fileSystem.exists(TO_FILE), TO_FILE 76 assert !fileSystem.exists(FROM_DIR), FROM_DIR 77 assert fileSystem.exists(TO_DIR), TO_DIR 90 assert !fileSystem.exists(FROM_DIR), FROM_DIR 91 assert fileSystem.exists(TO_DIR), TO_DI [all...] |
DeleCommandHandlerTest.groovy | 22 import org.mockftpserver.fake.filesystem.FileSystemException 23 import org.mockftpserver.fake.filesystem.Permissions 42 assert fileSystem.exists(FILE) == false 50 assert fileSystem.exists(FILE) == false 55 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.isNotAFile', FILE]) 61 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.isNotAFile', FILE]) 62 assert fileSystem.exists(FILE) 72 fileSystem.deleteMethodException = new FileSystemException("bad", ERROR_MESSAGE_KEY) 79 fileSystem.getEntry(DIR).permissions = new Permissions('r-xr-xr-x') 81 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.cannotWrite', DIR] [all...] |
ListCommandHandlerTest.groovy | 23 import org.mockftpserver.fake.filesystem.DirectoryEntry 24 import org.mockftpserver.fake.filesystem.DirectoryListingFormatter 25 import org.mockftpserver.fake.filesystem.FileEntry 26 import org.mockftpserver.fake.filesystem.FileSystemEntry 27 import org.mockftpserver.fake.filesystem.FileSystemException 28 import org.mockftpserver.fake.filesystem.Permissions 45 fileSystem.add(entry) 55 fileSystem.add(entry1) 56 fileSystem.add(entry2) 57 fileSystem.add(entry3 [all...] |
RmdCommandHandlerTest.groovy | 23 import org.mockftpserver.fake.filesystem.FileSystemException 24 import org.mockftpserver.fake.filesystem.Permissions 42 assert fileSystem.exists(DIR) == false 51 assert fileSystem.exists(p(DIR, SUB)) == false 56 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.doesNotExist', DIR]) 62 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.isNotADirectory', DIR]) 63 assert fileSystem.exists(DIR) 70 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.directoryIsNotEmpty', DIR]) 71 assert fileSystem.exists(DIR) 72 assert fileSystem.exists(FILE [all...] |
MkdCommandHandlerTest.groovy | 24 import org.mockftpserver.fake.filesystem.FileSystemException 25 import org.mockftpserver.fake.filesystem.Permissions 45 assert fileSystem.exists(DIR) 46 def dirEntry = fileSystem.getEntry(DIR) 54 assert fileSystem.exists(DIR) 55 def dirEntry = fileSystem.getEntry(DIR) 61 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.doesNotExist', '/abc']) 67 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.alreadyExists', DIR]) 68 assert fileSystem.exists(DIR) 76 fileSystem.getEntry(PARENT).permissions = new Permissions('r-xr-xr-x' [all...] |
AppeCommandHandlerTest.groovy | 22 import org.mockftpserver.fake.filesystem.FileEntry 23 import org.mockftpserver.fake.filesystem.Permissions 45 fileSystem.add(new FileEntry(path: FILE, contents: ORIGINAL_CONTENTS)) 83 assert fileSystem.isFile(FILE)
|
RetrCommandHandlerTest.groovy | 23 import org.mockftpserver.fake.filesystem.FileEntry 24 import org.mockftpserver.fake.filesystem.FileSystemException 25 import org.mockftpserver.fake.filesystem.Permissions 65 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.isNotAFile', DIR]) 71 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.doesNotExist', path]) 75 fileSystem.getEntry(FILE).permissions = Permissions.NONE 77 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.cannotRead', FILE]) 81 fileSystem.getEntry(DIR).permissions = Permissions.NONE 83 assertSessionReply(ReplyCodes.READ_FILE_ERROR, ['filesystem.cannotExecute', DIR]) 87 fileSystem.delete(FILE [all...] |
AbstractFakeCommandHandlerTestCase.groovy | 25 import org.mockftpserver.fake.filesystem.DirectoryEntry 26 import org.mockftpserver.fake.filesystem.FileEntry 27 import org.mockftpserver.fake.filesystem.FileSystemException 28 import org.mockftpserver.fake.filesystem.TestUnixFakeFileSystem 47 protected fileSystem 105 fileSystem = new TestUnixFakeFileSystem() 106 fileSystem.createParentDirectoriesAutomatically = true 107 serverConfiguration.setFileSystem(fileSystem) 260 * Override the named method (that takes a single String arg) of the fileSystem object to throw a (generic) FileSystemException 261 * @param methodName - the name of the fileSystem method to overrid [all...] |
NlstCommandHandlerTest.groovy | 23 import org.mockftpserver.fake.filesystem.FileSystemException 24 import org.mockftpserver.fake.filesystem.Permissions 81 fileSystem.getEntry(DIR).permissions = new Permissions('-wx-wx-wx') 84 assertSessionReply(1, ReplyCodes.READ_FILE_ERROR, ['filesystem.cannotRead', DIR]) 88 fileSystem.listNamesMethodException = new FileSystemException("bad", ERROR_MESSAGE_KEY)
|
/libcore/luni/src/test/java/libcore/java/nio/file/ |
LinuxFileSystemTest.java | 26 import java.nio.file.FileSystem; 49 FileSystem fileSystem = FileSystems.getDefault(); 53 assertTrue(fileSystem.provider() instanceof LinuxFileSystemProvider); 58 assertTrue(fileSystem.isOpen()); 65 fileSystem.close(); 72 assertFalse(fileSystem.isReadOnly()); 77 assertEquals("/", fileSystem.getSeparator()); 82 Iterable<Path> rootDirectories = fileSystem.getRootDirectories(); 91 Iterable<FileStore> fileStores = fileSystem.getFileStores() [all...] |
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/ |
DiskLruCacheTest.java | 18 import com.squareup.okhttp.internal.io.FileSystem; 55 private final FaultyFileSystem fileSystem = new FaultyFileSystem(FileSystem.SYSTEM); 70 cache = new DiskLruCache(fileSystem, cacheDir, appVersion, 2, maxSize, executor); 271 assertFalse(fileSystem.exists(k1)); 327 assertFalse(fileSystem.exists(cleanFile0)); 328 assertFalse(fileSystem.exists(cleanFile1)); 329 assertFalse(fileSystem.exists(dirtyFile0)); 330 assertFalse(fileSystem.exists(dirtyFile1)); 389 BufferedSink sink = Okio.buffer(fileSystem.sink(journalFile)) [all...] |
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/ |
DiskLruCache.java | 19 import com.squareup.okhttp.internal.io.FileSystem; 45 * A cache that uses a bounded amount of space on a filesystem. Each cache 51 * <p>The cache stores its data in a directory on the filesystem. This 57 * filesystem. When the number of stored bytes exceeds the limit, the cache will 60 * deleted. The limit does not include filesystem overhead or the cache 83 * filesystem, the corresponding entries will be dropped from the cache. If 141 private final FileSystem fileSystem; 187 DiskLruCache(FileSystem fileSystem, File directory, int appVersion, int valueCount, long maxSize [all...] |
/external/mockftpserver/MockFtpServer/src/main/java/org/mockftpserver/fake/ |
FakeFtpServer.java | 25 import org.mockftpserver.fake.filesystem.FileSystem;
36 * for most testing and simulation scenarios. You define a filesystem (internal, in-memory) containing
42 * reply messages consistent with its configuration and the contents of its internal filesystem,
51 * <li>Create and configure a <b>FileSystem</b>, and attach to the <b>FakeFtpServer</b> instance.</li>
59 * FileSystem fileSystem = new WindowsFakeFileSystem();
60 * fileSystem.add(new DirectoryEntry("c:\\"));
61 * fileSystem.add(new DirectoryEntry("c:\\data"));
62 * fileSystem.add(new FileEntry("c:\\data\\file1.txt", "abcdef 1234567890")); [all...] |