1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-16 08:34:50 +02:00

Remove Socks5ProxyTest.shouldOnlyStartOneServerThread()

The unit test relied on Thread.activeCount() which made the whole test
unreliable.
This commit is contained in:
Florian Schmaus 2016-08-31 09:52:07 +02:00
parent 47a4856cae
commit 9a16f68433

View file

@ -155,39 +155,6 @@ public class Socks5ProxyTest {
assertEquals(1, sameCount); assertEquals(1, sameCount);
} }
/**
* There should be only one thread executing the SOCKS5 proxy process.
*/
@Test
public void shouldOnlyStartOneServerThread() {
int threadCount = Thread.activeCount();
Socks5Proxy.setLocalSocks5ProxyPort(7890);
Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy();
proxy.start();
assertTrue(proxy.isRunning());
assertEquals(threadCount + 1, Thread.activeCount());
proxy.start();
assertTrue(proxy.isRunning());
assertEquals(threadCount + 1, Thread.activeCount());
proxy.stop();
assertFalse(proxy.isRunning());
assertEquals(threadCount, Thread.activeCount());
proxy.start();
assertTrue(proxy.isRunning());
assertEquals(threadCount + 1, Thread.activeCount());
proxy.stop();
}
/** /**
* If the SOCKS5 proxy accepts a connection that is not a SOCKS5 connection it should close the * If the SOCKS5 proxy accepts a connection that is not a SOCKS5 connection it should close the
* corresponding socket. * corresponding socket.