use of org.ftp4che.reply.Reply in project pentaho-kettle by pentaho.
the class FTPSConnectionTest method testEnforceProtPOnPut.
@Test
public void testEnforceProtPOnPut() throws Exception {
FileObject file = KettleVFS.createTempFile("FTPSConnectionTest_testEnforceProtPOnPut", KettleVFS.Suffix.TMP);
file.createFile();
try {
FTPSTestConnection connection = spy(new FTPSTestConnection(FTPSConnection.CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED, "the.perfect.host", 2010, "warwickw", "julia", null));
connection.replies.put("PWD", new Reply(Arrays.asList("257 \"/la\" is current directory")));
connection.connect();
connection.uploadFile(file.getPublicURIString(), "uploaded-file");
assertEquals("buffer not set", "PBSZ 0\r\n", connection.commands.get(0).toString());
assertEquals("data privacy not set", "PROT P\r\n", connection.commands.get(1).toString());
} finally {
file.delete();
}
}
use of org.ftp4che.reply.Reply in project pentaho-kettle by pentaho.
the class FTPSConnectionTest method testEnforceProtP.
@Test
public void testEnforceProtP() throws Exception {
FTPSTestConnection connection = spy(new FTPSTestConnection(FTPSConnection.CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED, "the.perfect.host", 2010, "warwickw", "julia", null));
connection.replies.put("PWD", new Reply(Arrays.asList("257 \"/la\" is current directory")));
connection.connect();
connection.getFileNames();
assertEquals("buffer not set", "PBSZ 0\r\n", connection.commands.get(1).toString());
assertEquals("data privacy not set", "PROT P\r\n", connection.commands.get(2).toString());
}
Aggregations