From 0ffc6016f46848130b90bbff820219bdfa024fd9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Jul 2015 14:44:32 +0200 Subject: [PATCH] Add test for reusing connections --- .../fcp/quelaton/DefaultFcpClientTest.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index c01d3b7..360b498 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -244,6 +244,33 @@ public class DefaultFcpClientTest { } @Test + public void defaultFcpClientReusesConnection() throws InterruptedException, ExecutionException, IOException { + Future keyPair = fcpClient.generateKeypair().execute(); + connectNode(); + List lines = fcpServer.collectUntil(is("EndMessage")); + String identifier = extractIdentifier(lines); + fcpServer.writeLine( + "SSKKeypair", + "InsertURI=" + INSERT_URI + "", + "RequestURI=" + REQUEST_URI + "", + "Identifier=" + identifier, + "EndMessage" + ); + keyPair.get(); + keyPair = fcpClient.generateKeypair().execute(); + lines = fcpServer.collectUntil(is("EndMessage")); + identifier = extractIdentifier(lines); + fcpServer.writeLine( + "SSKKeypair", + "InsertURI=" + INSERT_URI + "", + "RequestURI=" + REQUEST_URI + "", + "Identifier=" + identifier, + "EndMessage" + ); + keyPair.get(); + } + + @Test public void clientGetWithIgnoreDataStoreSettingSendsCorrectCommands() throws InterruptedException, ExecutionException, IOException { fcpClient.clientGet().ignoreDataStore().uri("KSK@foo.txt"); -- 2.7.4