The MockFtpServer project provides a mock/dummy FTP server for testing FTP client code. It can be configured to return custom data or reply codes, to simulate either success or failure scenarios. Expected command invocations can also be verified.
This project has been moved to https://github.com/dx42/MockFtpServer.
GiraffeFTP is a Java based FTP client and server. It includes GUI and command line tools. Good code to see to understand the FTP Protocol and sockets. Also includes a non-standard implementation of SSL sockets.