chrismair | 00dc7bd | 2014-05-11 21:21:28 +0000 | [diff] [blame] | 1 | --------------------------------------------------
|
| 2 | FakeFtpServer Features and Limitations
|
| 3 | --------------------------------------------------
|
| 4 |
|
| 5 | FakeFtpServer Features
|
| 6 | ~~~~~~~~~~~~~~~~~~~~~~
|
| 7 |
|
| 8 | * Standalone dummy FTP server. Run either within the same JVM as test code or in a different JVM.
|
| 9 |
|
| 10 | * Implements common FTP server commands.
|
| 11 |
|
| 12 | * Works out of the box with reasonable and expected behavior. Can simulate most mainline success and error scenarios.
|
| 13 |
|
| 14 | * In most cases, requires little or no knowledge or understanding of FTP server commands and reply codes.
|
| 15 |
|
| 16 | * Provides a simulated server file system, including support for file and directory permissions and owner and
|
| 17 | group authorization based on Unix. This file system can be populated at startup (or thereafter) with
|
| 18 | directories and files (including arbitrary content) to be retrieved by an FTP client. Any files sent to the server
|
| 19 | by an FTP client exist within that file system as well, and can be accessed through the file system API, or
|
| 20 | can even be subsequently retrieved by an FTP client.
|
| 21 |
|
| 22 | * Allows defining the set of user accounts that control which users can login to the FTP server, and their home
|
| 23 | (default) directories.
|
| 24 |
|
| 25 | * Supports active and passive mode data transfers.
|
| 26 |
|
| 27 | * Use a dynamically chosen free port number for the server control port instead of using the default (21)
|
| 28 | or hard-coding some other value (set the serverControlPort property of the server to 0).
|
| 29 |
|
| 30 | * Supports extended address (IPv6) data transfers (RFC2428)
|
| 31 |
|
| 32 | * Fully supports configuration within the <<Spring Framework>> or other dependency-injection container.
|
| 33 |
|
| 34 | * Can be used to test FTP client code written in any language
|
| 35 |
|
| 36 | FTP Scenarios Supported by FakeFtpServer
|
| 37 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 38 |
|
| 39 | Some of the mainline success scenarios that you can simulate with <<FakeFtpServer>> include:
|
| 40 |
|
| 41 | * Login (USER/PASS): with password, or when no password is required
|
| 42 |
|
| 43 | * Retrieve existing file (RETR) from the server
|
| 44 |
|
| 45 | * Send file to the server (STOR,STOU,APPE)
|
| 46 |
|
| 47 | * List of file entries (LIST) and list of filenames (NLST)
|
| 48 |
|
| 49 | * Print current working directory (PWD)
|
| 50 |
|
| 51 | * Change current working directory (CWD)
|
| 52 |
|
| 53 | * Rename an existing file (RNFR/RNTO)
|
| 54 |
|
| 55 | * Delete an existing file (DELE)
|
| 56 |
|
| 57 | * Create directory (MKD)
|
| 58 |
|
| 59 | * Remove directory (RMD)
|
| 60 |
|
| 61 | * Both active and passive mode (PASV) data transfers
|
| 62 |
|
| 63 | * Extended Address (IPv6) data transfers (EPRT and EPSV commands)
|
| 64 |
|
| 65 | Some of the error scenarios that you can simulate with <<FakeFtpServer>> include:
|
| 66 |
|
| 67 | * Failed login (USER/PASS): no such user, wrong password
|
| 68 |
|
| 69 | * Invalid client requests: missing required parameter, not logged in
|
| 70 |
|
| 71 | * Failed retrieve (RETR): no such file, missing required access permissions for the current user
|
| 72 |
|
| 73 | * Failed send (STOR,STOU,APPE): missing required access permissions for the current user
|
| 74 |
|
| 75 | * Failed change current working directory (CWD): no such directory, missing required access permissions for the current user
|
| 76 |
|
| 77 | * Failed delete an existing file (DELE): file does not exist, missing required access permissions for the current user
|
| 78 |
|
| 79 | * Failed rename (RNFR/RNTO): no such file, missing required access permissions for the current user
|
| 80 |
|
| 81 | * Failed create directory (MKD): parent directory does not exist, directory already exists, missing required access permissions for the current user
|
| 82 |
|
| 83 | * Failed remove directory (RMD): no such directory, directory not empty, missing required access permissions for the current user
|
| 84 |
|
| 85 |
|
| 86 | FakeFtpServer Limitations
|
| 87 | ~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 88 |
|
| 89 | Not all FTP features, error scenarios and reply codes can be simulated using <<FakeFtpServer>>. Features and
|
| 90 | scenarios not supported include:
|
| 91 |
|
| 92 | * Leaving the data connection open across multiple client requests.
|
| 93 |
|
| 94 | * Transmission mode other than 'Stream'. The STRU command is implemented but has no effect (NOOP).
|
| 95 |
|
| 96 | * Data Types other than ASCII and IMAGE (binary).
|
| 97 |
|
| 98 | * Vertical Format Control other than the default (NON PRINT).
|
| 99 |
|
| 100 | * Record Structure and Page Structure. The STRU command is implemented but has no effect (NOOP).
|
| 101 |
|
| 102 | * Error Recovery and Restart. The REST command is implemented but has no effect (NOOP).
|
| 103 |
|
| 104 | * Structure Mount. The SMNT command is implemented but has no effect (NOOP).
|
| 105 |
|
| 106 | * Abort. The ABOR command is implemented but has no effect (NOOP).
|
| 107 |
|
| 108 | * Allocate. The ALLO command is implemented but has no effect (NOOP).
|
| 109 |
|
| 110 | []
|
| 111 |
|
| 112 | For unsupported features, error scenarios and reply codes, consider using <<StubFtpServer>> instead, which
|
| 113 | provides a lower-level abstraction and finer control over exact server reply codes and responses.
|