QueueConnection connection = factory.createQueueConnection();
try
{
QueueSession s = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = s.createTemporaryQueue();
QueueConnection connection2 = factory.createQueueConnection();
try
{
connection2.createConnectionConsumer(queue, "", MockServerSessionPool.getServerSessionPool(), 1);
fail("Expected an error listening to a temporary destination from a different connection");
}