[hornetq-commits] JBoss hornetq SVN: r9848 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 4 22:18:58 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-11-04 22:18:58 -0400 (Thu, 04 Nov 2010)
New Revision: 9848

Modified:
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
   branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
fixing tests

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2010-11-04 22:51:35 UTC (rev 9847)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2010-11-05 02:18:58 UTC (rev 9848)
@@ -346,12 +346,12 @@
    {
       if (lastPosition == null)
       {
-         // it will start at the first available page
-         long firstPage = pageStore.getFirstPage();
-         lastPosition = new PagePositionImpl(firstPage, -1);
+         return new PagePositionImpl(pageStore.getFirstPage(), -1);
       }
-
-      return lastPosition;
+      else
+      {
+         return lastPosition;
+      }
    }
 
    /* (non-Javadoc)

Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java	2010-11-04 22:51:35 UTC (rev 9847)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java	2010-11-05 02:18:58 UTC (rev 9848)
@@ -15,6 +15,7 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 
 import junit.framework.Assert;
@@ -113,12 +114,14 @@
 
       final int NUM_MESSAGES = 100;
 
+      PageSubscription cursor = lookupPageStore(ADDRESS).getCursorProvier().getSubscription(queue.getID());
+      
+      Iterator<PagedReference> iterEmpty = cursor.iterator();
+
       int numberOfPages = addMessages(NUM_MESSAGES, 1024 * 1024);
 
       System.out.println("NumberOfPages = " + numberOfPages);
 
-      PageSubscription cursor = lookupPageStore(ADDRESS).getCursorProvier().getSubscription(queue.getID());
-
       PagedReference msg;
 
       LinkedListIterator<PagedReference> iterator = cursor.iterator();



More information about the hornetq-commits mailing list