use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class RelaxedFtpCase method tearDown.
@After
public void tearDown() throws Exception {
if (areTestsEnabled()) {
FileTransferClient client = connectRawClient();
cleanup(client, getRemoteDirectory());
client.rmdir(getRemoteDirectory());
client.disconnect();
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class StandardSftpConnectionTest method testConnectOnly_Composite_Fails.
@Test
public void testConnectOnly_Composite_Fails() throws Exception {
Assume.assumeTrue(areTestsEnabled());
StandardSftpConnection conn = createConnection();
SftpAuthenticationWrapper auth = new SftpAuthenticationWrapper(new SftpKeyAuthentication(PROPERTIES.getProperty(CFG_PRIVATE_KEY_FILE), "PW:abde"), new SftpKeyAuthentication("/some/path/that/does/not/exist", PROPERTIES.getProperty(CFG_PRIVATE_KEY_PW)));
conn.setAuthentication(auth);
try {
start(conn);
FileTransferClient c = conn.connect(getDestinationString());
fail();
} catch (IOException | PasswordException expected) {
} finally {
stop(conn);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class StandardSftpConnectionTest method testConnectOnly_StrictKnownHosts_UnknownHost.
@Test
public void testConnectOnly_StrictKnownHosts_UnknownHost() throws Exception {
Assume.assumeTrue(areTestsEnabled());
File tempHostsFile = copyHostsFile(new File(PROPERTIES.getProperty(CFG_UNKNOWN_HOSTS_FILE)));
StandardSftpConnection conn = createConnection();
conn.setConfiguration(new InlineConfigRepositoryBuilder(true).build());
conn.setKnownHostsFile(tempHostsFile.getCanonicalPath());
try {
start(conn);
FileTransferClient c = conn.connect(getDestinationString());
fail();
} catch (FileTransferException expected) {
} finally {
stop(conn);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class StandardSftpConnectionTest method testConnectOnly_LenientKnownHosts_KnownHost.
@Test
public void testConnectOnly_LenientKnownHosts_KnownHost() throws Exception {
Assume.assumeTrue(areTestsEnabled());
File tempHostsFile = copyHostsFile(new File(PROPERTIES.getProperty(CFG_KNOWN_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 StandardSftpConnectionTest method testConnectOnly_PasswordAuth_Override.
@Test
public void testConnectOnly_PasswordAuth_Override() throws Exception {
Assume.assumeTrue(areTestsEnabled());
StandardSftpConnection conn = createConnection();
try {
conn.setAuthentication(new SftpPasswordAuthentication(""));
start(conn);
FileTransferClient c = conn.connect(getDestinationStringWithOverridePassword());
assertTrue(c.isConnected());
c.disconnect();
} finally {
stop(conn);
}
}
Aggregations