Author: clebert.suconic(a)jboss.com
Date: 2010-11-05 12:00:14 -0400 (Fri, 05 Nov 2010)
New Revision: 9850
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 PagecursorTest
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-05
03:46:12 UTC (rev 9849)
+++
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05
16:00:14 UTC (rev 9850)
@@ -360,12 +360,15 @@
for (PagePosition pos : entry.getValue().acks)
{
- if (retValue == null || retValue.getMessageNr() <
pos.getMessageNr())
+ System.out.println("Analizing " + pos);
+ if (retValue == null || retValue.getMessageNr() >
pos.getMessageNr())
{
retValue = pos;
}
}
+ System.out.println("Returning initial position " + retValue);
+
return retValue;
}
}
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-05
03:46:12 UTC (rev 9849)
+++
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05
16:00:14 UTC (rev 9850)
@@ -730,11 +730,14 @@
PagedReference msg;
LinkedListIterator<PagedReference> iterator = cursor.iterator();
- LinkedListIterator<PagedReference> iterator2 = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator2 = cursor2.iterator();
+
+ cursor2.bookmark(new PagePositionImpl(1, -1));
int key = 0;
while ((msg = iterator.next()) != null)
{
+ System.out.println("key = " + key);
assertEquals(key++,
msg.getMessage().getIntProperty("key").intValue());
cursor.ack(msg);
}
@@ -744,6 +747,7 @@
for (int i = 0; i < 10; i++)
{
+ assertTrue(iterator2.hasNext());
msg = iterator2.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
}
Show replies by date