activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1448470 - in /activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt: AbstractMQTTTest.java MQTTTest.java
Date Wed, 20 Feb 2013 23:17:15 GMT
Author: tabish
Date: Wed Feb 20 23:17:15 2013
New Revision: 1448470

URL: http://svn.apache.org/r1448470
Log:
add patch for: https://issues.apache.org/jira/browse/AMQ-4338

Modified:
    activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/AbstractMQTTTest.java
    activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java

Modified: activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/AbstractMQTTTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/AbstractMQTTTest.java?rev=1448470&r1=1448469&r2=1448470&view=diff
==============================================================================
--- activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/AbstractMQTTTest.java
(original)
+++ activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/AbstractMQTTTest.java
Wed Feb 20 23:17:15 2013
@@ -29,7 +29,6 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.AutoFailTestSupport;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.command.ActiveMQMessage;
@@ -55,11 +54,9 @@ public abstract class AbstractMQTTTest {
     protected BrokerService brokerService;
     protected LinkedList<Throwable> exceptions = new LinkedList<Throwable>();
     protected int numberOfMessages;
-    AutoFailTestSupport autoFailTestSupport = new AutoFailTestSupport() {};
 
     @Before
     public void startBroker() throws Exception {
-        autoFailTestSupport.startAutoFailThread();
         exceptions.clear();
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
@@ -73,10 +70,9 @@ public abstract class AbstractMQTTTest {
         if (brokerService != null) {
             brokerService.stop();
         }
-        autoFailTestSupport.stopAutoFailThread();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAndReceiveMQTT() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -119,7 +115,7 @@ public abstract class AbstractMQTTTest {
         publishProvider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAtMostOnceReceiveExactlyOnce() throws Exception {
         /**
          * Although subscribing with EXACTLY ONCE, the message gets published
@@ -142,7 +138,7 @@ public abstract class AbstractMQTTTest {
         provider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAtLeastOnceReceiveExactlyOnce() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -160,7 +156,7 @@ public abstract class AbstractMQTTTest {
         provider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAtLeastOnceReceiveAtMostOnce() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -179,7 +175,7 @@ public abstract class AbstractMQTTTest {
     }
 
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAndReceiveAtMostOnce() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -197,7 +193,7 @@ public abstract class AbstractMQTTTest {
         provider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAndReceiveAtLeastOnce() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -215,7 +211,7 @@ public abstract class AbstractMQTTTest {
         provider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAndReceiveExactlyOnce() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -231,14 +227,14 @@ public abstract class AbstractMQTTTest {
             String payload = "Test Message: " + i;
             publisher.publish("foo", payload.getBytes(), EXACTLY_ONCE);
             byte[] message = subscriber.receive(5000);
-            assertNotNull("Should get a message", message);
+            assertNotNull("Should get a message + ["+ i + "]", message);
             assertEquals(payload, new String(message));
         }
         subscriber.disconnect();
         publisher.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendAndReceiveLargeMessages() throws Exception {
         byte[] payload = new byte[1024 * 32];
         for (int i = 0; i < payload.length; i++){
@@ -266,7 +262,7 @@ public abstract class AbstractMQTTTest {
     }
 
 
-    @Test
+    @Test(timeout=30000)
     public void testSendMQTTReceiveJMS() throws Exception {
         addMQTTConnector();
         TransportConnector openwireTransport = brokerService.addConnector("tcp://localhost:0");
@@ -297,7 +293,7 @@ public abstract class AbstractMQTTTest {
         provider.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testSendJMSReceiveMQTT() throws Exception {
         addMQTTConnector();
         TransportConnector openwireTransport = brokerService.addConnector("tcp://localhost:0");

Modified: activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java?rev=1448470&r1=1448469&r2=1448470&view=diff
==============================================================================
--- activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
(original)
+++ activemq/trunk/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
Wed Feb 20 23:17:15 2013
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertTru
 
 public class MQTTTest extends AbstractMQTTTest {
 
-    @Test
+    @Test(timeout=30000)
     public void testPingKeepsInactivityMonitorAlive() throws Exception {
         addMQTTConnector();
         brokerService.start();
@@ -45,7 +45,7 @@ public class MQTTTest extends AbstractMQ
         connection.disconnect();
     }
 
-    @Test
+    @Test(timeout=30000)
     public void testTurnOffInactivityMonitor()throws Exception{
         addMQTTConnector("?transport.useInactivityMonitor=false");
         brokerService.start();
@@ -66,7 +66,7 @@ public class MQTTTest extends AbstractMQ
     }
 
 
-    @Test
+    @Test(timeout=30000)
     public void testDefaultKeepAliveWhenClientSpecifiesZero() throws Exception {
         // default keep alive in milliseconds
         addMQTTConnector("?transport.defaultKeepAlive=2000");



Mime
View raw message