FtpClientSession client = FtpTestConfig.getTestFtpClient();
client.connect();
{
CmdPort cmdPort = new CmdPort("127.0.0.1", 80);
assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(cmdPort));
}
{
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));
}
{
CmdPort cmdPort = new CmdPort(null, 80);
assertEquals(FtpConst.Replyes.REPLY_500, client.executeCommand(cmdPort));
}
{
CmdPort cmdPort = new CmdPort("invalidhost", 80);
assertEquals(FtpConst.Replyes.REPLY_500, client.executeCommand(cmdPort));
}
{
CmdPort cmdPort = new CmdPort("127,0,0,1", 80);
assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(cmdPort));
}
client.close();