FtpClientSession client = FtpTestConfig.getTestFtpClient();
client.connect();
{
CmdNlst cmdNlst = new CmdNlst();
assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(cmdNlst));
}
{
CmdUser cmdUser = new CmdUser(FtpTestConfig.USER_ID);
assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(cmdUser));
}
{
CmdPass cmdPass = new CmdPass(FtpTestConfig.USER_PASS);
assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(cmdPass));
}
{
CmdNlst cmdNlst = new CmdNlst();
assertEquals(FtpConst.Replyes.REPLY_425, client.executeCommand(cmdNlst));
}
{
{
CmdPasv cmdPasv = new CmdPasv();
assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
}
{
CmdNlst cmdNlst = new CmdNlst("NotExistFolder");
assertEquals(FtpConst.Replyes.REPLY_450, client.executeCommand(cmdNlst));
}
}
{
{
CmdPasv cmdPasv = new CmdPasv();
assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
}
// Normal executing replies sequence 125..226
// 125 used in NLst command inside
{
CmdNlst cmdNlst = new CmdNlst();
assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdNlst));
}
}
client.close();