You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/24 15:50:25 UTC
svn commit: r1438029 -
/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
Author: tabish
Date: Thu Jan 24 14:50:24 2013
New Revision: 1438029
URL: http://svn.apache.org/viewvc?rev=1438029&view=rev
Log:
apply patch for: https://issues.apache.org/jira/browse/AMQ-4270 thanks!
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java?rev=1438029&r1=1438028&r2=1438029&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java Thu Jan 24 14:50:24 2013
@@ -16,6 +16,10 @@
*/
package org.apache.activemq.network;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -36,8 +40,6 @@ import javax.jms.QueueBrowser;
import javax.jms.Session;
import javax.management.ObjectName;
-import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerTestSupport;
@@ -63,6 +65,9 @@ import org.apache.activemq.transport.Tra
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.util.Wait;
import org.apache.commons.io.FileUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,7 +77,7 @@ import org.slf4j.LoggerFactory;
* and connectors are created. Also, this test asserts message counts via JMX on
* each broker.
*/
-public class BrokerNetworkWithStuckMessagesTest extends TestCase /*NetworkTestSupport*/ {
+public class BrokerNetworkWithStuckMessagesTest {
private static final Logger LOG = LoggerFactory.getLogger(BrokerNetworkWithStuckMessagesTest.class);
@@ -94,8 +99,8 @@ public class BrokerNetworkWithStuckMessa
protected String amqDomain = "org.apache.activemq";
- @Override
- protected void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
// For those who want visual confirmation:
// Uncomment the following to enable JMX support on a port number to use
@@ -131,7 +136,6 @@ public class BrokerNetworkWithStuckMessa
bridge.start();
waitForBridgeFormation();
-
}
protected void waitForBridgeFormation() throws Exception {
@@ -147,13 +151,14 @@ public class BrokerNetworkWithStuckMessa
}
}
- @Override
- protected void tearDown() throws Exception {
+ @After
+ public void tearDown() throws Exception {
bridge.stop();
localBroker.stop();
remoteBroker.stop();
}
+ @Test(timeout=120000)
public void testBrokerNetworkWithStuckMessages() throws Exception {
int sendNumMessages = 10;
@@ -181,7 +186,6 @@ public class BrokerNetworkWithStuckMessa
Object[] messages = browseQueueWithJmx(localBroker);
assertEquals(sendNumMessages, messages.length);
-
// Create a synchronous consumer on the remote broker
StubConnection connection2 = createRemoteConnection();
ConnectionInfo connectionInfo2 = createConnectionInfo();