use of org.h2.dev.ftp.server.FtpServer in project h2database by h2database.
the class TestFtp method test.
private void test(String dir) throws Exception {
Server server = FtpServer.createFtpServer("-ftpDir", dir, "-ftpPort", "8121").start();
FtpServer ftp = (FtpServer) server.getService();
ftp.setEventListener(this);
FtpClient client = FtpClient.open("localhost:8121");
client.login("sa", "sa");
client.makeDirectory("ftp");
client.changeWorkingDirectory("ftp");
assertEquals("CWD", lastEvent.getCommand());
client.makeDirectory("hello");
client.changeWorkingDirectory("hello");
client.changeDirectoryUp();
assertEquals("CDUP", lastEvent.getCommand());
client.nameList("hello");
client.removeDirectory("hello");
client.close();
server.stop();
}