projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shutdown thread pool after use
[jFCPlib.git]
/
src
/
test
/
java
/
net
/
pterodactylus
/
fcp
/
quelaton
/
DefaultFcpClientTest.java
diff --git
a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
index
3ea9570
..
35a2857
100644
(file)
--- a/
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
+++ b/
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java
@@
-58,13
+58,13
@@
public class DefaultFcpClientTest {
private static final String REQUEST_URI =
"SSK@wtbgd2loNcJCXvtQVOftl2tuWBomDQHfqS6ytpPRhfw,7SHH53gletBVb9JD7nBsyClbLQsBubDPEIcwg908r7Y,AQACAAE/";
private static final String REQUEST_URI =
"SSK@wtbgd2loNcJCXvtQVOftl2tuWBomDQHfqS6ytpPRhfw,7SHH53gletBVb9JD7nBsyClbLQsBubDPEIcwg908r7Y,AQACAAE/";
- private static int threadCounter = 0;
+ private int threadCounter = 0;
+ private final ExecutorService threadPool =
+ Executors.newCachedThreadPool(r -> new Thread(r, "Test-Thread-" + threadCounter++));
private final FakeTcpServer fcpServer;
private final DefaultFcpClient fcpClient;
public DefaultFcpClientTest() throws IOException {
private final FakeTcpServer fcpServer;
private final DefaultFcpClient fcpClient;
public DefaultFcpClientTest() throws IOException {
- ExecutorService threadPool =
- Executors.newCachedThreadPool(r -> new Thread(r, "Test-Thread-" + threadCounter++));
fcpServer = new FakeTcpServer(threadPool);
fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test");
}
fcpServer = new FakeTcpServer(threadPool);
fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test");
}
@@
-72,6
+72,7
@@
public class DefaultFcpClientTest {
@After
public void tearDown() throws IOException {
fcpServer.close();
@After
public void tearDown() throws IOException {
fcpServer.close();
+ threadPool.shutdown();
}
@Test(expected = ExecutionException.class)
}
@Test(expected = ExecutionException.class)