[hornetq-commits] JBoss hornetq SVN: r11316 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/client and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Sep 9 22:13:51 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-09-09 22:13:50 -0400 (Fri, 09 Sep 2011)
New Revision: 11316

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
   branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java
Log:
HORNETQ-765 - fixing a failing test

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java	2011-09-09 21:41:06 UTC (rev 11315)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java	2011-09-10 02:13:50 UTC (rev 11316)
@@ -86,7 +86,15 @@
                              final PageSubscription subscription)
    {
       this.position = position;
-      this.messageEstimate = message.getMessage().getMemoryEstimate();
+
+      if (message == null)
+      {
+         this.messageEstimate = -1;
+      }
+      else
+      {
+         this.messageEstimate = message.getMessage().getMemoryEstimate();
+      }
       this.message = new WeakReference<PagedMessage>(message);
       this.subscription = subscription;
    }
@@ -112,6 +120,10 @@
     */
    public int getMessageMemoryEstimate()
    {
+      if (messageEstimate < 0)
+      {
+         messageEstimate = getMessage().getMemoryEstimate();
+      }
       return messageEstimate;
    }
 

Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java	2011-09-09 21:41:06 UTC (rev 11315)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/PagingTest.java	2011-09-10 02:13:50 UTC (rev 11316)
@@ -263,6 +263,8 @@
                                PagingTest.PAGE_MAX,
                                new HashMap<String, AddressSettings>());
          server.start();
+         
+         waitForServer(server);
 
          queue = server.locateQueue(ADDRESS);
 



More information about the hornetq-commits mailing list