diff options
7 files changed, 52 insertions, 24 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java index 81f1d3e5e7..1eaccf53fc 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java @@ -709,6 +709,20 @@ public class AMQSession_0_10 extends AMQSession<BasicMessageConsumer_0_10, Basic } /** + * deletes an exchange + */ + public void sendExchangeDelete(final String name, final boolean nowait) + throws AMQException, FailoverException + { + getQpidSession().exchangeDelete(name); + // We need to sync so that we get notify of an error. + if (!nowait) + { + sync(); + } + } + + /** * Declare a queue with the given queueName */ public void sendQueueDeclare(final AMQDestination amqd, final AMQProtocolHandler protocolHandler, 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 diff --git a/qpid/java/test-profiles/Java010Excludes b/qpid/java/test-profiles/Java010Excludes index 8500e6b3aa..3486d5c70c 100755 --- a/qpid/java/test-profiles/Java010Excludes +++ b/qpid/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 |