From f3841781412f5cc77ea26c6b4ac609a48db9f14f Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Thu, 2 Jul 2009 08:19:34 +0000 Subject: QPID-1965: use transacted send since we *really need* the messages to be there by the time was start looking for the log messages. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@790493 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/server/AlertingTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java b/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java index 242efc2f5d..205a741b2f 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java @@ -97,7 +97,7 @@ public class AlertingTest extends QpidTestCase super.setUp(); _connection = getConnection(); - _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + _session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE); _destination = _session.createQueue("testQueue"); // Consumer is only used to actually create the destination @@ -146,12 +146,14 @@ public class AlertingTest extends QpidTestCase { // Send 5 messages, make sure that the alert was fired properly. sendMessage(_session, _destination, _numMessages + 1); + _session.commit(); wasAlertFired(); } public void testAlertingReallyWorksWithRestart() throws Exception { sendMessage(_session, _destination, _numMessages + 1); + _session.commit(); stopBroker(); (new FileOutputStream(_logfile)).getChannel().truncate(0); startBroker(); @@ -162,6 +164,7 @@ public class AlertingTest extends QpidTestCase { // send some messages and nuke the logs sendMessage(_session, _destination, 2); + _session.commit(); stopBroker(); (new FileOutputStream(_logfile)).getChannel().truncate(0); @@ -169,10 +172,11 @@ public class AlertingTest extends QpidTestCase _configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", 5); startBroker(); _connection = getConnection(); - _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + _session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE); // Trigger the new value sendMessage(_session, _destination, 3); + _session.commit(); wasAlertFired(); } } -- cgit v1.2.1