@Test
public void clientGetCanDownloadData() throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt");
+ Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "ReturnType=direct", "URI=KSK@foo.txt"));
@Test
public void clientGetDownloadsDataForCorrectIdentifier()
throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt");
+ Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt"));
@Test
public void clientGetRecognizesGetFailed() throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt");
+ Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt"));
@Test
public void clientGetRecognizesGetFailedForCorrectIdentifier()
throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt");
+ Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt"));
@Test(expected = ExecutionException.class)
public void clientGetRecognizesConnectionClosed() throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt");
+ Future<Optional<Data>> dataFuture = fcpClient.clientGet().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt"));
@Test
public void clientGetWithIgnoreDataStoreSettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().ignoreDataStore().uri("KSK@foo.txt");
+ fcpClient.clientGet().ignoreDataStore().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "IgnoreDS=true"));
@Test
public void clientGetWithDataStoreOnlySettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().dataStoreOnly().uri("KSK@foo.txt");
+ fcpClient.clientGet().dataStoreOnly().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "DSonly=true"));
@Test
public void clientGetWithMaxSizeSettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().maxSize(1048576).uri("KSK@foo.txt");
+ fcpClient.clientGet().maxSize(1048576).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "MaxSize=1048576"));
@Test
public void clientGetWithPrioritySettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().priority(Priority.interactive).uri("KSK@foo.txt");
+ fcpClient.clientGet().priority(Priority.interactive).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "PriorityClass=1"));
@Test
public void clientGetWithRealTimeSettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().realTime().uri("KSK@foo.txt");
+ fcpClient.clientGet().realTime().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "RealTimeFlag=true"));
@Test
public void clientGetWithGlobalSettingSendsCorrectCommands()
throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientGet().global().uri("KSK@foo.txt");
+ fcpClient.clientGet().global().uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines, matchesFcpMessage("ClientGet", "URI=KSK@foo.txt", "Global=true"));
fcpClient.clientPut()
.from(new ByteArrayInputStream("Hello\n".getBytes()))
.length(6)
- .uri("KSK@foo.txt");
+ .uri("KSK@foo.txt")
+ .execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("Hello"));
assertThat(lines, matchesFcpMessage("ClientPut", "UploadFrom=direct", "DataLength=6", "URI=KSK@foo.txt"));
Future<Optional<Key>> key = fcpClient.clientPut()
.from(new ByteArrayInputStream("Hello\n".getBytes()))
.length(6)
- .uri("KSK@foo.txt");
+ .uri("KSK@foo.txt")
+ .execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("Hello"));
String identifier = extractIdentifier(lines);
Future<Optional<Key>> key = fcpClient.clientPut()
.from(new ByteArrayInputStream("Hello\n".getBytes()))
.length(6)
- .uri("KSK@foo.txt");
+ .uri("KSK@foo.txt")
+ .execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("Hello"));
String identifier = extractIdentifier(lines);
.named("otherName.txt")
.from(new ByteArrayInputStream("Hello\n".getBytes()))
.length(6)
- .uri("KSK@foo.txt");
+ .uri("KSK@foo.txt")
+ .execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("Hello"));
assertThat(lines, matchesFcpMessage("ClientPut", "TargetFilename=otherName.txt", "UploadFrom=direct",
@Test
public void clientPutWithRedirectSendsCorrectCommand()
throws IOException, ExecutionException, InterruptedException {
- fcpClient.clientPut().redirectTo("KSK@bar.txt").uri("KSK@foo.txt");
+ fcpClient.clientPut().redirectTo("KSK@bar.txt").uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines,
@Test
public void clientPutWithFileSendsCorrectCommand() throws InterruptedException, ExecutionException, IOException {
- fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt");
+ fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
assertThat(lines,
public void clientPutWithFileCanCompleteTestDdaSequence()
throws IOException, ExecutionException, InterruptedException {
File tempFile = createTempFile();
- fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt");
+ fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);
@Test
public void clientPutDoesNotReactToProtocolErrorForDifferentIdentifier()
throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Key>> key = fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt");
+ Future<Optional<Key>> key = fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);
@Test
public void clientPutAbortsOnProtocolErrorOtherThan25()
throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Key>> key = fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt");
+ Future<Optional<Key>> key = fcpClient.clientPut().from(new File("/tmp/data.txt")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);
public void clientPutDoesNotReplyToWrongTestDdaReply() throws IOException, ExecutionException,
InterruptedException {
File tempFile = createTempFile();
- fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt");
+ fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);
public void clientPutSendsResponseEvenIfFileCanNotBeRead()
throws IOException, ExecutionException, InterruptedException {
File tempFile = createTempFile();
- fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt");
+ fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);
public void clientPutDoesNotResendOriginalClientPutOnTestDDACompleteWithWrongDirectory()
throws IOException, ExecutionException, InterruptedException {
File tempFile = createTempFile();
- fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt");
+ fcpClient.clientPut().from(new File(tempFile.getParent(), "test.dat")).uri("KSK@foo.txt").execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);