}
}
assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
assertEquals(FtpConst.Replyes.REPLY_350, client.executeCommand(new CmdRest(data.length)));
byte[] secondData = getBytes("_APPENDED");
cmdStor = new CmdStor(fileName);
cmdStor.setFileContent(secondData);
assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdStor));
assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
cmdRetr = new CmdRetr(fileName);
assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdRetr));
String secondString = "DATABYTES_APPENDED";
byte[] secondDataAfter = cmdRetr.getFileContent();
for (int i = 0; i < secondDataAfter.length; i++)
{
if (secondDataAfter[i] != (byte)secondString.charAt(i))
{
fail();
}
}
assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
assertEquals(FtpConst.Replyes.REPLY_350, client.executeCommand(new CmdRest(4)));
byte[] replasedData = getBytes("INT");
cmdStor = new CmdStor(fileName);
cmdStor.setFileContent(replasedData);