[jboss-cvs] JBoss Messaging SVN: r7928 - in branches/Branch_1_4: tests/src/org/jboss/test/messaging/core/paging and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 28 03:38:32 EST 2009
Author: gaohoward
Date: 2009-12-28 03:38:32 -0500 (Mon, 28 Dec 2009)
New Revision: 7928
Modified:
branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java
branches/Branch_1_4/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
Log:
JBMESSAGING-1778
Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java 2009-12-22 01:29:00 UTC (rev 7927)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java 2009-12-28 08:38:32 UTC (rev 7928)
@@ -333,6 +333,11 @@
addToDownCache(refCancel, true);
}
}
+ else if (messageRefs.size() == fullSize)
+ {
+ //https://jira.jboss.org/jira/browse/JBMESSAGING-1778
+ paging = true;
+ }
if (trace) { log.trace(this + " added " + ref + " back into state"); }
}
Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java 2009-12-22 01:29:00 UTC (rev 7927)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java 2009-12-28 08:38:32 UTC (rev 7928)
@@ -965,6 +965,47 @@
assertEquals(0, queue.getMessageCount());
}
+
+ //https://jira.jboss.org/jira/browse/JBMESSAGING-1778
+ public void testPagingEdgeCase() throws Throwable
+ {
+ int fullSize = 200;
+
+ MessagingQueue queue = new MessagingQueue(2, "testQ", 2, ms, pm, true, -1, null, fullSize, 100, 100, false, 300000);
+ queue.activate();
+
+ Message[] msgs = new Message[fullSize + 20];
+ MessageReference[] refs = new MessageReference[fullSize + 20];
+
+ //Send fullSize
+ for (int i = 0; i < 200; i++)
+ {
+ msgs[i] = CoreMessageFactory.createCoreMessage(i, true, null);
+ refs[i] = msgs[i].createReference();
+ queue.handle(null, refs[i], null);
+ }
+
+ //Verify paging
+ assertTrue(queue.isPaging());
+
+ //Consume and cancel.
+ this.cancelDeliveries(queue, 4);
+
+ //send more
+ for (int i = 0; i < 20; i++)
+ {
+ msgs[fullSize + i] = CoreMessageFactory.createCoreMessage(fullSize + i, true, null);
+ refs[fullSize + i] = msgs[fullSize + i].createReference();
+ queue.handle(null, refs[fullSize + i], null);
+ }
+ //Verify paging
+ assertTrue(queue.getMessageCount() > fullSize);
+
+ assertTrue(queue.isPaging());
+
+ this.consume(queue, 0, refs, refs.length);
+ }
+
}
More information about the jboss-cvs-commits
mailing list