From 8edbf10b2a4cbc3e43853c9c042a1f40500c94be Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 1 Jul 2015 21:27:16 +0200 Subject: [PATCH] Add close() method, implement AutoCloseable --- src/test/java/net/pterodactylus/fcp/fake/FakeTcpServer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/pterodactylus/fcp/fake/FakeTcpServer.java b/src/test/java/net/pterodactylus/fcp/fake/FakeTcpServer.java index 07afb24..6b3674a 100644 --- a/src/test/java/net/pterodactylus/fcp/fake/FakeTcpServer.java +++ b/src/test/java/net/pterodactylus/fcp/fake/FakeTcpServer.java @@ -15,7 +15,7 @@ import org.hamcrest.Matcher; * * @author David ‘Bombe’ Roden */ -public class FakeTcpServer { +public class FakeTcpServer implements AutoCloseable { private final ServerSocket serverSocket; private final ExecutorService executorService; @@ -52,4 +52,9 @@ public class FakeTcpServer { return clientSocket.get().readLine(); } + @Override + public void close() throws IOException { + clientSocket.get().close(); + } + } -- 2.7.4