use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpCase method testCachedConnection_DisconnectedClient.
@Test
public void testCachedConnection_DisconnectedClient() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnection connection = createConnection();
connection.setCacheConnection(true);
try {
start(connection);
FileTransferClient client = connection.connect(getDestinationString());
// Should be cached, and equivalent.
FileTransferClient cached = connection.connect(getDestinationString());
assertEquals(client, cached);
client.disconnect();
// Now it should be a new entry.
cached = connection.connect(getDestinationString());
assertNotSame(client, cached);
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpCase method testCachedConnection.
@Test
public void testCachedConnection() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnection connection = createConnection();
connection.setCacheConnection(true);
try {
start(connection);
FileTransferClient client = null;
client = connection.connect(getDestinationString());
// Should be cached, and equivalent.
FileTransferClient cached = connection.connect(getDestinationString());
assertEquals(client, cached);
FileTransferClient client2 = connection.connect(getDestinationStringWithOverride());
// Even though it's effectively the same "host", they become different keys.
assertNotSame(client, client2);
cached = connection.connect(getDestinationStringWithOverride());
assertEquals(client2, cached);
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpConnectionCase method testCachedConnection_DisconnectedClient.
@Test
public void testCachedConnection_DisconnectedClient() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnection connection = createConnection();
connection.setCacheConnection(true);
try {
start(connection);
FileTransferClient client = connection.connect(getDestinationString());
// Should be cached, and equivalent.
FileTransferClient cached = connection.connect(getDestinationString());
assertEquals(client, cached);
client.disconnect();
// Now it should be a new entry.
cached = connection.connect(getDestinationString());
assertNotSame(client, cached);
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpConnectionCase method testCachedConnection.
@Test
public void testCachedConnection() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnection connection = createConnection();
connection.setCacheConnection(true);
try {
start(connection);
FileTransferClient client = null;
client = connection.connect(getDestinationString());
// Should be cached, and equivalent.
FileTransferClient cached = connection.connect(getDestinationString());
assertEquals(client, cached);
FileTransferClient client2 = connection.connect(getDestinationStringWithOverride());
// Even though it's effectively the same "host", they become different keys.
assertNotSame(client, client2);
cached = connection.connect(getDestinationStringWithOverride());
assertEquals(client2, cached);
} finally {
stop(connection);
}
}
use of com.adaptris.filetransfer.FileTransferClient in project interlok by adaptris.
the class FtpConnectionCase method testConnection_Cached_Disconnect.
@Test
public void testConnection_Cached_Disconnect() throws Exception {
Assume.assumeTrue(areTestsEnabled());
FileTransferConnection connection = createConnection();
connection.setCacheConnection(true);
try {
start(connection);
FileTransferClient client = null;
client = connection.connect(getDestinationString());
connection.disconnect(client);
assertTrue(client.isConnected());
} finally {
stop(connection);
}
}
Aggregations