summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src/main/java/org
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-01-27 11:19:19 +0000
committerRobert Gemmell <robbie@apache.org>2011-01-27 11:19:19 +0000
commit13f37429f7870d2a85306a0a34aae4cd9ccb1f55 (patch)
tree9c2aad740fffa58ff901c1ea572d5902181868fd /qpid/java/systests/src/main/java/org
parent3edf381aae19bd212ef4d33f33abdd944da00bcf (diff)
downloadqpid-python-13f37429f7870d2a85306a0a34aae4cd9ccb1f55.tar.gz
QPID-3022: enable the logging tests and fix issues causing failures due to minor differences between 0-10 and 0-9 behaviour
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1064086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src/main/java/org')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java1
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java10
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java20
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java6
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java5
5 files changed, 36 insertions, 6 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
index 495a8c33c6..05aaf16af1 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
@@ -132,6 +132,7 @@ public class AlertingTest extends AbstractTestLogging
{
sendMessage(_session, _destination, _numMessages + 1);
_session.commit();
+ _connection.close();
stopBroker();
// Rest the monitoring clearing the current output file.
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java
index 51815e2adc..97914f84a5 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BindingLoggingTest.java
@@ -191,6 +191,16 @@ public class BindingLoggingTest extends AbstractTestLogging
// and so unbind.
_session.createConsumer(_session.createTemporaryQueue()).close();
+ if(isBroker010())
+ {
+ //auto-delete is at session close for 0-10
+ _session.close();
+ }
+
+ //wait for the deletion messages to be logged
+ waitForMessage("BND-1002");
+
+ //gather all the BND messages
List<String> results = waitAndFindMatches(BND_PREFIX);
// We will have two binds as we bind all queues to the default exchange
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java
index 67ff8a4328..1e48f34f99 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java
@@ -21,6 +21,7 @@
package org.apache.qpid.server.logging;
import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQSession_0_10;
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.ExchangeDeleteBody;
@@ -65,7 +66,7 @@ public class ExchangeLoggingTest extends AbstractTestLogging
_session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
_type = "direct";
- _name = "testName";
+ _name = getTestQueueName()+ "-exchange";
_queue = _session.createQueue(_type + "://" + _name + "/queue/queue");
@@ -177,15 +178,24 @@ public class ExchangeLoggingTest extends AbstractTestLogging
//Ignore broker startup messages
_monitor.reset();
+ //create the exchange by creating a consumer
_session.createConsumer(_queue);
- MethodRegistry_8_0 registry = new MethodRegistry_8_0();
+ //now delete the exchange
+ if(isBroker010())
+ {
+ ((AMQSession_0_10) _session).sendExchangeDelete(_name, false);
+ }
+ else
+ {
+ MethodRegistry_8_0 registry = new MethodRegistry_8_0();
- ExchangeDeleteBody body = registry.createExchangeDeleteBody(0, new AMQShortString(_name), false, true);
+ ExchangeDeleteBody body = registry.createExchangeDeleteBody(0, new AMQShortString(_name), false, true);
- AMQFrame exchangeDeclare = body.generateFrame(0);
+ AMQFrame exchangeDeclare = body.generateFrame(0);
- ((AMQConnection) _connection).getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeleteOkBody.class);
+ ((AMQConnection) _connection).getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeleteOkBody.class);
+ }
//Wait and ensure we get our last EXH-1002 msg
waitForMessage("EXH-1002");
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java
index 14e0904b78..b8a42c0ab3 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java
@@ -147,6 +147,12 @@ public class QueueLoggingTest extends AbstractTestLogging
// then close the consumer it will be autoDeleted.
_session.createConsumer(_session.createTemporaryQueue()).close();
+ if(isBroker010())
+ {
+ //auto-delete is at session close for 0-10
+ _session.close();
+ }
+
// Validation
//Ensure that we wait for the QUE log message
waitAndFindMatches("QUE-1002");
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
index a0b81a7658..6e156f091e 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
@@ -181,7 +181,10 @@ public class SubscriptionLoggingTest extends AbstractTestLogging
String message = getMessageString(fromMessage(log));
assertTrue("Browser not on log message:" + message, message.contains("Browser"));
- assertTrue("AutoClose not on log message:" + message, message.contains("AutoClose"));
+ if(!isBroker010())
+ {
+ assertTrue("AutoClose not on log message:" + message, message.contains("AutoClose"));
+ }
// Beacause it is an auto close and we have no messages on the queue we
// will get a close message