[hornetq-commits] JBoss hornetq SVN: r10122 - in trunk: tests/src/org/hornetq/tests/integration/stomp and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jan 13 11:47:41 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-01-13 11:47:41 -0500 (Thu, 13 Jan 2011)
New Revision: 10122

Modified:
   trunk/src/main/org/hornetq/core/protocol/stomp/StompUtils.java
   trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
HORNETQ-560 - committing fix contributed by Roger Strom

Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompUtils.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompUtils.java	2011-01-13 16:43:12 UTC (rev 10121)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompUtils.java	2011-01-13 16:47:41 UTC (rev 10122)
@@ -35,6 +35,7 @@
 class StompUtils
 {
    // Constants -----------------------------------------------------
+   private static final String DEFAULT_MESSAGE_PRIORITY= "4";
    
    private static final Logger log = Logger.getLogger(StompUtils.class);
 
@@ -51,6 +52,8 @@
       if (priority != null)
       {
          msg.setPriority(Byte.parseByte(priority));
+      } else {
+         msg.setPriority(Byte.parseByte(DEFAULT_MESSAGE_PRIORITY));
       }
       String persistent = (String)headers.remove(Stomp.Headers.Send.PERSISTENT);
       if (persistent != null)

Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java	2011-01-13 16:43:12 UTC (rev 10121)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java	2011-01-13 16:47:41 UTC (rev 10122)
@@ -143,6 +143,8 @@
       TextMessage message = (TextMessage)consumer.receive(1000);
       Assert.assertNotNull(message);
       Assert.assertEquals("Hello World", message.getText());
+      // Assert default priority 4 is used when priority header is not set
+      Assert.assertEquals("getJMSPriority", 4, message.getJMSPriority());
 
       // Make sure that the timestamp is valid - should
       // be very close to the current time.



More information about the hornetq-commits mailing list