use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class StandardSftpConnectionTest method testConnectOnly_StrictKnownHosts_KnownHost.
@Test
public void testConnectOnly_StrictKnownHosts_KnownHost() throws Exception {
Assume.assumeTrue(areTestsEnabled());
File tempHostsFile = copyHostsFile(new File(PROPERTIES.getProperty(CFG_KNOWN_HOSTS_FILE)));
StandardSftpConnection conn = createConnection();
conn.setConfiguration(new InlineConfigRepositoryBuilder(true).build());
conn.setKnownHostsFile(tempHostsFile.getCanonicalPath());
try {
start(conn);
FileTransferClient c = conn.connect(getDestinationString());
assertTrue(c.isConnected());
c.disconnect();
} finally {
stop(conn);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class StandardSftpConnectionTest method testConnectOnly_LenientKnownHosts_UnknownHost.
@Test
public void testConnectOnly_LenientKnownHosts_UnknownHost() throws Exception {
Assume.assumeTrue(areTestsEnabled());
File tempHostsFile = copyHostsFile(new File(PROPERTIES.getProperty(CFG_UNKNOWN_HOSTS_FILE)));
StandardSftpConnection conn = createConnection();
conn.setConfiguration(new InlineConfigRepositoryBuilder(false).build());
conn.setKnownHostsFile(tempHostsFile.getCanonicalPath());
try {
start(conn);
FileTransferClient c = conn.connect(getDestinationString());
assertTrue(c.isConnected());
c.disconnect();
} finally {
stop(conn);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpPasswordConnectionCase method testConnect_BadEncodedPassword.
@Test
public void testConnect_BadEncodedPassword() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnectionUsingPassword connection = (FileTransferConnectionUsingPassword) createConnection();
connection.setDefaultPassword("PW:BHFYENGMWEYQ");
try {
start(connection);
FileTransferClient client = connection.connect(getDestinationString());
fail();
} catch (IOException | PasswordException expected) {
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpPasswordConnectionCase method testConnect_PasswordOverride.
@Test
public void testConnect_PasswordOverride() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnectionUsingPassword connection = (FileTransferConnectionUsingPassword) createConnection();
connection.setDefaultPassword(null);
try {
start(connection);
log.trace("testConnection_PasswordOverride = " + getDestinationStringWithOverride());
FileTransferClient client = connection.connect(getDestinationStringWithOverride());
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpPasswordConnectionCase method testConnect_NoPassword.
@Test
public void testConnect_NoPassword() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnectionUsingPassword connection = (FileTransferConnectionUsingPassword) createConnection();
connection.setDefaultPassword(null);
try {
start(connection);
FileTransferClient client = connection.connect(getDestinationString());
fail();
} catch (Exception expected) {
} finally {
stop(connection);
}
}
Aggregations