mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22:06 +01:00
Remove Socks5ProxyTest.shouldOnlyStartOneServerThread()
The unit test relied on Thread.activeCount() which made the whole test unreliable.
This commit is contained in:
parent
47a4856cae
commit
9a16f68433
1 changed files with 0 additions and 33 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue