log.info("Complete.");
}
public void testCWD() throws Exception
{
Log log = getLogger(FtpConst.Commands.CMD_CWD);
log.info("Test...");
// success
FtpClientSession client = FtpTestConfig.getTestFtpClient();
client.connect();
assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));
assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));
CmdPwd cmdPwd = new CmdPwd();
assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
assertEquals("/production", cmdPwd.getCurrentPath());
assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("../backup/")));
cmdPwd = new CmdPwd();
assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
assertEquals("/backup", cmdPwd.getCurrentPath());
assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(new CmdCwd("production")));
client.close();
// denied
client = FtpTestConfig.getTestFtpClient();
client.connect();
assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(new CmdCwd("production")));
client.close();
log.info("Complete.");
}