Author: clebert.suconic(a)jboss.com
Date: 2009-11-07 23:14:55 -0500 (Sat, 07 Nov 2009)
New Revision: 8250
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-207 - fixing test
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java 2009-11-07
00:49:27 UTC (rev 8249)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java 2009-11-08
04:14:55 UTC (rev 8250)
@@ -58,22 +58,28 @@
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
-
+
public void testPage() throws Exception
{
- internalTestPage(false);
+ internalTestPage(false, false);
}
-
- public void testPageFailBeforeconsume() throws Exception
+
+ public void testPageTransactioned() throws Exception
{
- internalTestPage(true);
+ internalTestPage(true, false);
}
-
- public void internalTestPage(final boolean failBeforeConsume) throws Exception
+
+ public void testPageTransactionedFailBeforeconsume() throws Exception
{
+ internalTestPage(true, true);
+ }
+
+ public void internalTestPage(final boolean transacted, final boolean
failBeforeConsume) throws Exception
+ {
ClientSessionFactoryInternal factory = getSessionFactory();
factory.setBlockOnPersistentSend(true);
- ClientSession session = factory.createSession(true, true, 0);
+ factory.setBlockOnAcknowledge(true);
+ ClientSession session = factory.createSession(!transacted, !transacted, 0);
try
{
@@ -88,11 +94,11 @@
{
latch.countDown();
}
-
+
public void beforeReconnect(HornetQException exception)
- {
+ {
}
-
+
}
session.addFailureListener(new MyListener());
@@ -103,7 +109,7 @@
for (int i = 0; i < TOTAL_MESSAGES; i++)
{
- if (i % 10 == 0)
+ if (transacted && i % 10 == 0)
{
session.commit();
}
@@ -114,7 +120,7 @@
}
session.commit();
-
+
if (failBeforeConsume)
{
failSession(session, latch);
@@ -131,7 +137,7 @@
ClientMessage msg = cons.receive(20000);
assertNotNull(msg);
msg.acknowledge();
- if (i % 10 == 0)
+ if (transacted && i % 10 == 0)
{
session.commit();
}
@@ -175,7 +181,6 @@
}
}
-
/**
* @param session
* @param latch
@@ -245,4 +250,5 @@
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
+
}