diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-05-07 15:10:08 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-05-07 15:10:08 +0000 |
| commit | c88bf1a09b9d38675a30518053de049b3bebe9aa (patch) | |
| tree | 86cdc1676c3e4c047cc182c46fc7c2dce33d7f75 /qpid/java/systests | |
| parent | f143411bc8475b8c2288b7c271247ad77e6b3a82 (diff) | |
| download | qpid-python-c88bf1a09b9d38675a30518053de049b3bebe9aa.tar.gz | |
QPID-2575 : Add getClientID to SessionModel and standardise use accross 0-8/0-10, 0-10 does not appear to provide a client ID so maintaining use of Principal Name. This means migration between 0-8 and 0-10 will not behave as expected.
Correct erroneous usages of session.getPrincipal when comparing with queue.getOwner is requried. Queue owners are the client id not the authenticated user.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@942102 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java index a1f8295c9b..48c30d6409 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java @@ -85,6 +85,26 @@ public class ModelTest extends QpidTestCase } /** + * Test that an exclusive transient queue can be created via AMQP. + * + * @throws Exception On unexpected error + */ + public void testExclusiveQueueCreationTransientViaAMQP() throws Exception + { + Connection connection = getConnection(); + + String queueName = getTestQueueName(); + boolean durable = false; + boolean autoDelete = false; + boolean exclusive = true; + + createViaAMQPandValidateViaJMX(connection, queueName, durable, + autoDelete, exclusive); + } + + + + /** * Test that a transient queue can be created via AMQP. * * @throws Exception On unexpected error @@ -96,10 +116,34 @@ public class ModelTest extends QpidTestCase String queueName = getTestQueueName(); boolean durable = false; boolean autoDelete = false; - boolean exclusive = false; + boolean exclusive = true; + + createViaAMQPandValidateViaJMX(connection, queueName, durable, + autoDelete, exclusive); + } + + /** + * Test that a durable exclusive queue can be created via AMQP. + * + * @throws Exception On unexpected error + */ + + public void testExclusiveQueueCreationDurableViaAMQP() throws Exception + { + Connection connection = getConnection(); + + String queueName = getTestQueueName(); + boolean durable = true; + boolean autoDelete = false; + boolean exclusive = true; createViaAMQPandValidateViaJMX(connection, queueName, durable, autoDelete, exclusive); + + // Clean up + ManagedBroker managedBroker = + _jmxUtils.getManagedBroker(VIRTUALHOST_NAME); + managedBroker.deleteQueue(queueName); } /** @@ -126,6 +170,7 @@ public class ModelTest extends QpidTestCase managedBroker.deleteQueue(queueName); } + /** * Test that a transient queue can be created via JMX. * @@ -246,7 +291,7 @@ public class ModelTest extends QpidTestCase session.createQueue(new AMQShortString(queueName), autoDelete, durable, exclusive); - validateQueueViaJMX(queueName, ((AMQConnection) connection).getUsername(), durable, autoDelete); + validateQueueViaJMX(queueName, exclusive ? connection.getClientID() : null, durable, autoDelete); } /** |
