activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1455981 - in /activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp: Stomp11Test.java Stomp12Test.java
Date Wed, 13 Mar 2013 15:02:43 GMT
Author: tabish
Date: Wed Mar 13 15:02:43 2013
New Revision: 1455981

URL: http://svn.apache.org/r1455981
Log:
Update to the tests for better stability on some platforms.

Modified:
    activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java
    activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java

Modified: activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java?rev=1455981&r1=1455980&r2=1455981&view=diff
==============================================================================
--- activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java
(original)
+++ activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp11Test.java
Wed Mar 13 15:02:43 2013
@@ -36,6 +36,7 @@ import javax.management.ObjectName;
 
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.broker.jmx.BrokerViewMBean;
+import org.apache.activemq.broker.jmx.QueueViewMBean;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTextMessage;
 import org.junit.Test;
@@ -563,22 +564,29 @@ public class Stomp11Test extends StompTe
 
         assertTrue(f.startsWith("CONNECTED"));
 
-        String message = "SEND\n" + "destination:/queue/" + getQueueName() + "\n\n" + "Hello
World" + Stomp.NULL;
-
+        String message = "SEND\n" + "destination:/queue/" + getQueueName() +
+                         "\n\n" + "Hello World" + Stomp.NULL;
         stompConnection.sendFrame(message);
 
         String subscribe = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n"
+
+                           "activemq.prefetchSize=1" + "\n" +
                            "id:12345\n" + "ack:client\n\n" + Stomp.NULL;
         stompConnection.sendFrame(subscribe);
 
         StompFrame received = stompConnection.receive();
+        LOG.info("Received Frame: {}", received);
         assertTrue(received.getAction().equals("MESSAGE"));
 
+        message = "SEND\n" + "destination:/queue/" + getQueueName() +
+                "\n\n" + "Hello World" + Stomp.NULL;
+        stompConnection.sendFrame(message);
+
         String ack = "ACK\n" + "message-id:" +
                      received.getHeaders().get("message-id") + "\n\n" + Stomp.NULL;
         stompConnection.sendFrame(ack);
 
         StompFrame error = stompConnection.receive();
+        LOG.info("Received Frame: {}", error);
         assertTrue(error.getAction().equals("ERROR"));
 
         String unsub = "UNSUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n" +

Modified: activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java?rev=1455981&r1=1455980&r2=1455981&view=diff
==============================================================================
--- activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java
(original)
+++ activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java
Wed Mar 13 15:02:43 2013
@@ -47,7 +47,7 @@ public class Stomp12Test extends StompTe
     }
 
     @Override
-	protected void addStompConnector() throws Exception {
+    protected void addStompConnector() throws Exception {
         TransportConnector connector = brokerService.addConnector("stomp://0.0.0.0:"+port);
         port = connector.getConnectUri().getPort();
     }
@@ -125,6 +125,7 @@ public class Stomp12Test extends StompTe
 
         String subscribe = "SUBSCRIBE\n" +
                            "id:1\n" +
+                           "activemq.prefetchSize=1\n" +
                            "ack:client\n" +
                            "destination:/queue/" + getQueueName() + "\n" +
                            "receipt:1\n" +
@@ -146,6 +147,9 @@ public class Stomp12Test extends StompTe
         assertTrue(received.getHeaders().containsKey(Stomp.Headers.Message.ACK_ID));
         assertEquals("1", received.getBody());
 
+        message = "SEND\n" + "destination:/queue/" + getQueueName() + "\n\n" + "2" + Stomp.NULL;
+        stompConnection.sendFrame(message);
+
         String frame = "ACK\n" + "message-id:" +
                 received.getHeaders().get(Stomp.Headers.Message.ACK_ID) + "\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);



Mime
View raw message