Close FCP server after each test
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 1 Jul 2015 19:27:44 +0000 (21:27 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 1 Jul 2015 19:29:48 +0000 (21:29 +0200)
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java

index 86e7fae..affe1e9 100644 (file)
@@ -12,6 +12,7 @@ import java.util.concurrent.Future;
 import net.pterodactylus.fcp.FcpKeyPair;
 import net.pterodactylus.fcp.fake.FakeTcpServer;
 
+import org.junit.After;
 import org.junit.Test;
 
 /**
@@ -30,6 +31,11 @@ public class DefaultFcpClientTest {
                fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test", () -> "2.0");
        }
 
+       @After
+       public void tearDown() throws IOException {
+               fcpServer.close();
+       }
+
        @Test
        public void defaultFcpClientCanGenerateKeypair() throws ExecutionException, InterruptedException, IOException {
                Future<FcpKeyPair> keyPairFuture = fcpClient.generateKeypair().execute();