From 0149d6c1e8adeab6bbd6d2ff88edd39d96987e35 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Thu, 27 Jan 2011 11:19:19 +0000 Subject: 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/qpid@1064086 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/client/AMQSession_0_10.java | 14 ++++++++++++++ .../org/apache/qpid/server/logging/AlertingTest.java | 1 + .../qpid/server/logging/BindingLoggingTest.java | 10 ++++++++++ .../qpid/server/logging/ExchangeLoggingTest.java | 20 +++++++++++++++----- .../apache/qpid/server/logging/QueueLoggingTest.java | 6 ++++++ .../qpid/server/logging/SubscriptionLoggingTest.java | 5 ++++- java/test-profiles/Java010Excludes | 20 ++------------------ 7 files changed, 52 insertions(+), 24 deletions(-) (limited to 'java') diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java index 81f1d3e5e7..1eaccf53fc 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java @@ -708,6 +708,20 @@ public class AMQSession_0_10 extends AMQSession results = waitAndFindMatches(BND_PREFIX); // We will have two binds as we bind all queues to the default exchange diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java index 67ff8a4328..1e48f34f99 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java +++ b/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/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java index 14e0904b78..b8a42c0ab3 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/QueueLoggingTest.java +++ b/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/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java index a0b81a7658..6e156f091e 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java +++ b/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 diff --git a/java/test-profiles/Java010Excludes b/java/test-profiles/Java010Excludes index 8500e6b3aa..3486d5c70c 100755 --- a/java/test-profiles/Java010Excludes +++ b/java/test-profiles/Java010Excludes @@ -40,26 +40,10 @@ org.apache.qpid.server.exchange.ReturnUnroutableMandatoryMessageTest#* // QPID-1727 , QPID-1726 :c++ broker does not support flow to disk on transient queues. Also it requries a persistent store impl. for Apache org.apache.qpid.test.client.QueueBrowsingFlowToDiskTest#* -// 0-10 Broker does not follow the same Logging convention as the Java broker -org.apache.qpid.server.logging.AccessControlLoggingTest#* -org.apache.qpid.server.logging.AlertingTest#* -org.apache.qpid.server.logging.BindingLoggingTest#* -org.apache.qpid.server.logging.BrokerLoggingTest#* +// 0-10 and 0-9 connections dont generate the exact same logging due to protocol differences org.apache.qpid.server.logging.ChannelLoggingTest#testChannelStartsFlowStopped org.apache.qpid.server.logging.ChannelLoggingTest#testChannelStartConsumerFlowStarted -org.apache.qpid.server.logging.ChannelLoggingTest#testChannelStartConsumerFlowStarted -org.apache.qpid.server.logging.DerbyMessageStoreLoggingTest#* -org.apache.qpid.server.logging.DurableQueueLoggingTest#* -org.apache.qpid.server.logging.ExchangeLoggingTest#* -org.apache.qpid.server.logging.ManagementLoggingTest#* -org.apache.qpid.server.logging.MemoryMessageStoreLoggingTest#* -org.apache.qpid.server.logging.QueueLoggingTest#* -org.apache.qpid.server.logging.SubscriptionLoggingTest#* -org.apache.qpid.server.logging.TransientQueueLoggingTest#* -org.apache.qpid.server.logging.VirtualHostLoggingTest#* -org.apache.qpid.server.logging.messages.* -org.apache.qpid.server.logging.subjects.* -org.apache.qpid.server.logging.actors.* +org.apache.qpid.server.logging.SubscriptionLoggingTest#testSubscriptionSuspend // 0-10 Broker does not have a JMX connection MBean org.apache.qpid.management.jmx.ManagementActorLoggingTest#testConnectionCloseViaManagement -- cgit v1.2.1