Commit a02ca920 authored by Matija Obreza's avatar Matija Obreza
Browse files

Renamed ftpsClient to ftp

parent d24b7510
......@@ -6,3 +6,4 @@
target
doc
data
ftpserver.jks
......@@ -46,30 +46,30 @@ public class FtpServerTest {
@Test
public void serverListeningFTPS() throws SocketException, IOException {
final FTPSClient ftpsClient = new FTPSClient(true);
final FTPSClient ftp = new FTPSClient(true);
try {
ftpsClient.setConnectTimeout(2000);
ftpsClient.connect("localhost", 8021);
assertThat("FTP server refused connection", FTPReply.isPositiveCompletion(ftpsClient.getReplyCode()), is(true));
ftp.setConnectTimeout(2000);
ftp.connect("localhost", 8021);
assertThat("FTP server refused connection", FTPReply.isPositiveCompletion(ftp.getReplyCode()), is(true));
} finally {
ftpsClient.disconnect();
ftp.disconnect();
}
}
@Test
public void userLoginFTPS() throws SocketException, IOException {
final FTPSClient ftpsClient = new FTPSClient(true);
final FTPSClient ftp = new FTPSClient(true);
try {
ftpsClient.setConnectTimeout(2000);
ftpsClient.connect("localhost", 8021);
assertThat("FTP server refused connection", FTPReply.isPositiveCompletion(ftpsClient.getReplyCode()), is(true));
ftp.setConnectTimeout(2000);
ftp.connect("localhost", 8021);
assertThat("FTP server refused connection", FTPReply.isPositiveCompletion(ftp.getReplyCode()), is(true));
ftpsClient.login(username, password);
assertThat("Login failed", FTPReply.isPositiveCompletion(ftpsClient.getReplyCode()), is(true));
ftp.login(username, password);
assertThat("Login failed", FTPReply.isPositiveCompletion(ftp.getReplyCode()), is(true));
} finally {
ftpsClient.disconnect();
ftp.disconnect();
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment