Create distinctive thread names
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 5 Jul 2015 20:11:31 +0000 (22:11 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 5 Jul 2015 20:11:31 +0000 (22:11 +0200)
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java

index 4670828..020ee33 100644 (file)
@@ -32,7 +32,8 @@ public class DefaultFcpClientTest {
        private static final String INSERT_URI = "SSK@RVCHbJdkkyTCeNN9AYukEg76eyqmiosSaNKgE3U9zUw,7SHH53gletBVb9JD7nBsyClbLQsBubDPEIcwg908r7Y,AQECAAE/";
        private static final String REQUEST_URI = "SSK@wtbgd2loNcJCXvtQVOftl2tuWBomDQHfqS6ytpPRhfw,7SHH53gletBVb9JD7nBsyClbLQsBubDPEIcwg908r7Y,AQACAAE/";
 
-       private final ExecutorService threadPool = Executors.newCachedThreadPool();
+       private static int threadCounter = 0;
+       private final ExecutorService threadPool = Executors.newCachedThreadPool((r) -> new Thread(r, "Test-Thread-" + threadCounter++));
        private final FakeTcpServer fcpServer;
        private final DefaultFcpClient fcpClient;