mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Fixed a test.
Connections can occasionally be made to a server socket after ServerSocket.close() has returned, so don't check that a connection attempt fails.
This commit is contained in:
@@ -46,16 +46,10 @@ public class SimpleSocketPluginTest extends BriarTestCase {
|
|||||||
InetSocketAddress addr = new InetSocketAddress(host, port);
|
InetSocketAddress addr = new InetSocketAddress(host, port);
|
||||||
Socket s = new Socket();
|
Socket s = new Socket();
|
||||||
s.connect(addr, 100);
|
s.connect(addr, 100);
|
||||||
assertTrue(callback.connectionsLatch.await(1, TimeUnit.MINUTES));
|
assertTrue(callback.connectionsLatch.await(5, TimeUnit.SECONDS));
|
||||||
s.close();
|
s.close();
|
||||||
// Stop the plugin
|
// Stop the plugin
|
||||||
plugin.stop();
|
plugin.stop();
|
||||||
// The plugin should no longer be listening
|
|
||||||
try {
|
|
||||||
s = new Socket();
|
|
||||||
s.connect(addr, 100);
|
|
||||||
fail();
|
|
||||||
} catch(IOException expected) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -90,7 +84,7 @@ public class SimpleSocketPluginTest extends BriarTestCase {
|
|||||||
DuplexTransportConnection d = plugin.createConnection(contactId);
|
DuplexTransportConnection d = plugin.createConnection(contactId);
|
||||||
assertNotNull(d);
|
assertNotNull(d);
|
||||||
// Check that the connection was accepted
|
// Check that the connection was accepted
|
||||||
assertTrue(latch.await(1, TimeUnit.MINUTES));
|
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
||||||
assertFalse(error.get());
|
assertFalse(error.get());
|
||||||
// Clean up
|
// Clean up
|
||||||
d.dispose(false, true);
|
d.dispose(false, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user