index.apt revision 75c1cbb179839ff6f1e78262ee58193626d67efb
1 -------------------------------------------------- 2 Home 3 -------------------------------------------------- 4 5MockFtpServer 6 7 The <<MockFtpServer>> project provides a mock/dummy FTP server implementations that can be very 8 useful for testing of FTP client code. Two FTP Server implementations are provided, each at a different 9 level of abstraction. 10 11 <<FakeFtpServer>> provides a high-level abstraction for an FTP server and is suitable for most testing 12 and simulation scenarios. You define a filesystem (internal, in-memory) containing an arbitrary set of 13 files and directories. These files and directories can (optionally) have associated access permissions. 14 You also configure a set of one or more user accounts that control which users can login to the FTP server, 15 and their home (default) directories. The user account is also used when assigning file and directory 16 ownership for new files. See {{{fakeftpserver-features.html}FakeFtpServer Features and Limitations}}. 17 18 <<StubFtpServer>> is a "stub" implementation of an FTP server. It supports the main FTP commands by 19 implementing command handlers for each of the corresponding low-level FTP server commands (e.g. RETR, 20 DELE, LIST). These <CommandHandler>s can be individually configured to return custom data or reply codes, 21 allowing simulation of a complete range of both success and failure scenarios. The <CommandHandler>s can 22 also be interrogated to verify command invocation data such as command parameters and timestamps. 23 See {{{stubftpserver-features.html}StubFtpServer Features and Limitations}}. 24 25 See the {{{fakeftpserver-versus-stubftpserver.html}FakeFtpServer versus StubFtpServer}} page for more 26 information on deciding whether to use <<FakeFtpServer>> or <<StubFtpServer>>. 27 28 The <<MockFtpServer>> project is written in Java, and is ideally suited to testing Java code. But because 29 communication with the FTP server is across the network using sockets, it can be used to test FTP client 30 code written in any language. 31 32 For projects built using {{{http://maven.apache.org/}Maven}}, <<MockFtpServer>> is now available 33 from the <<Maven Central Repository>>. Add a dependency to your POM like this: 34 35-------------------- 36 <dependency> 37 <groupId>org.mockftpserver</groupId> 38 <artifactId>MockFtpServer</artifactId> 39 <version>1.2.1</version> 40 <scope>test</scope> 41 </dependency> 42--------------------