From 78e1513aae6100a4c78f99e41c68e72ed1926936 Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Wed, 16 May 2012 17:57:17 +0200
Subject: [PATCH] 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.
---
 .../briar/plugins/socket/SimpleSocketPluginTest.java   | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
index a5aa9c7169..3b160df85c 100644
--- a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
+++ b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
@@ -46,16 +46,10 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 		InetSocketAddress addr = new InetSocketAddress(host, port);
 		Socket s = new Socket();
 		s.connect(addr, 100);
-		assertTrue(callback.connectionsLatch.await(1, TimeUnit.MINUTES));
+		assertTrue(callback.connectionsLatch.await(5, TimeUnit.SECONDS));
 		s.close();
 		// Stop the plugin
 		plugin.stop();
-		// The plugin should no longer be listening
-		try {
-			s = new Socket();
-			s.connect(addr, 100);
-			fail();
-		} catch(IOException expected) {}
 	}
 
 	@Test
@@ -90,7 +84,7 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 		DuplexTransportConnection d = plugin.createConnection(contactId);
 		assertNotNull(d);
 		// Check that the connection was accepted
-		assertTrue(latch.await(1, TimeUnit.MINUTES));
+		assertTrue(latch.await(5, TimeUnit.SECONDS));
 		assertFalse(error.get());
 		// Clean up
 		d.dispose(false, true);
-- 
GitLab