Author: clebert.suconic(a)jboss.com
Date: 2010-11-03 17:17:32 -0400 (Wed, 03 Nov 2010)
New Revision: 9840
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:
repeat on paging
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-03
16:55:38 UTC (rev 9839)
+++
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-03
21:17:32 UTC (rev 9840)
@@ -215,6 +215,7 @@
PagedReferenceImpl nextPos = moveNext(position);
if (nextPos != null)
{
+ lastOperation = position;
position = nextPos.getPosition();
}
return nextPos;
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-03
16:55:38 UTC (rev 9839)
+++
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-03
21:17:32 UTC (rev 9840)
@@ -902,9 +902,9 @@
PageSubscription cursor = cursorProvider.getSubscription(queue.getID());
- Iterator<PagedReferenceImpl> iter = cursor.iterator();
+ LinkedListIterator<PagedReferenceImpl> iter = cursor.iterator();
- Iterator<PagedReferenceImpl> iter2 = cursor.iterator();
+ LinkedListIterator<PagedReferenceImpl> iter2 = cursor.iterator();
assertTrue(iter.hasNext());
@@ -926,6 +926,26 @@
assertEquals(2, tstProperty(msg2.getMessage()));
+ iter2.repeat();
+
+ msg2 = iter2.next();
+
+ assertEquals(2, tstProperty(msg2.getMessage()));
+
+ iter2.repeat();
+
+ assertEquals(2, tstProperty(msg2.getMessage()));
+
+ msg1 = iter.next();
+
+ assertEquals(2, tstProperty(msg1.getMessage()));
+
+ iter.repeat();
+
+ msg1 = iter.next();
+
+ assertEquals(2, tstProperty(msg1.getMessage()));
+
assertTrue(iter2.hasNext());
Show replies by date