activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [03/48] activemq-artemis git commit: ARTEMIS-388 fixing testsuite (the socket.bind not being closed was preventing other tests to run successfully)
Date Tue, 16 Feb 2016 20:10:17 GMT
ARTEMIS-388 fixing testsuite
(the socket.bind not being closed was preventing other tests to run successfully)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ece5d81e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ece5d81e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ece5d81e

Branch: refs/heads/refactor-openwire
Commit: ece5d81e3d835367927db9adec8f7ff5b654eab0
Parents: 5399717
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Feb 9 18:59:14 2016 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Feb 9 18:59:47 2016 -0500

----------------------------------------------------------------------
 .../server/ActivationFailureListenerTest.java   | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ece5d81e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ActivationFailureListenerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ActivationFailureListenerTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ActivationFailureListenerTest.java
index 6732b7a..a43e2c8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ActivationFailureListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ActivationFailureListenerTest.java
@@ -37,16 +37,21 @@ public class ActivationFailureListenerTest extends ActiveMQTestBase {
    @Test
    public void simpleTest() throws Exception {
       Socket s = new Socket();
-      s.bind(new InetSocketAddress("127.0.0.1", 61616));
-      server = createServer(false, createDefaultNettyConfig());
-      final CountDownLatch latch = new CountDownLatch(1);
-      server.registerActivationFailureListener(new ActivationFailureListener() {
-         @Override
-         public void activationFailed(Exception exception) {
-            latch.countDown();
-         }
-      });
-      server.start();
-      assertTrue(latch.await(3000, TimeUnit.MILLISECONDS));
+      try {
+         s.bind(new InetSocketAddress("127.0.0.1", 61616));
+         server = createServer(false, createDefaultNettyConfig());
+         final CountDownLatch latch = new CountDownLatch(1);
+         server.registerActivationFailureListener(new ActivationFailureListener() {
+            @Override
+            public void activationFailed(Exception exception) {
+               latch.countDown();
+            }
+         });
+         server.start();
+         assertTrue(latch.await(3000, TimeUnit.MILLISECONDS));
+      }
+      finally {
+         s.close();
+      }
    }
 }


Mime
View raw message