Author: clebert.suconic(a)jboss.com
Date: 2010-11-22 15:21:51 -0500 (Mon, 22 Nov 2010)
New Revision: 9920
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/PagingTest.java
Log:
fixing tests
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-22
13:11:45 UTC (rev 9919)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
@@ -1093,7 +1093,7 @@
}
// 2nd ... if TX, is it committed?
- if (valid && message.getPagedMessage().getTransactionID() != 0)
+ if (valid && message.getPagedMessage().getTransactionID() >=
0)
{
PageTransactionInfo tx =
pageStore.getPagingManager().getTransaction(message.getPagedMessage()
.getTransactionID());
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2010-11-22
13:11:45 UTC (rev 9919)
+++
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2010-11-22
20:21:51 UTC (rev 9920)
@@ -940,7 +940,7 @@
{
if (tx == null)
{
- return 0l;
+ return -1;
}
else
{
Modified:
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
---
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-22
13:11:45 UTC (rev 9919)
+++
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-22
20:21:51 UTC (rev 9920)
@@ -698,6 +698,8 @@
{
message = session.createMessage(IS_DURABLE_MESSAGE);
message.getBodyBuffer().writeBytes(body);
+ message.putIntProperty("id", numberOfMessages);
+ message.putBooleanProperty("new", false);
// Stop sending message as soon as we start paging
if
(server.getPostOffice().getPagingManager().getPageStore(PagingTest.ADDRESS).isPaging())
@@ -727,10 +729,19 @@
{
ClientMessage msg = consumer.receive(PagingTest.RECEIVE_TIMEOUT);
msg.acknowledge();
+ assertEquals(j, msg.getIntProperty("id").intValue());
+ assertFalse(msg.getBooleanProperty("new"));
Assert.assertNotNull(msg);
}
+
+ ClientMessage msgReceived = consumer.receiveImmediate();
+
+ if (msgReceived != null)
+ {
+ System.out.println("new = " +
msgReceived.getBooleanProperty("new") + " id = " +
msgReceived.getIntProperty("id"));
+ }
- Assert.assertNull(consumer.receiveImmediate());
+ Assert.assertNull(msgReceived);
consumer.close();
}
@@ -1275,16 +1286,6 @@
locator.setBlockOnAcknowledge(true);
final ClientSessionFactory sf = locator.createSessionFactory();
- ClientSession session = sf.createSession(null, null, false, true, true, false,
0);
-
- session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true);
-
- session.close();
-
- session = null;
-
- ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
-
final CountDownLatch ready = new CountDownLatch(1);
final byte[] body = new byte[messageSize];
@@ -1345,7 +1346,7 @@
}
};
- session = sf.createSession(true, true, 0);
+ ClientSession session = sf.createSession(true, true, 0);
session.start();
session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true);
Show replies by date