You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2008/08/15 05:41:24 UTC

svn commit: r686136 [17/17] - in /incubator/qpid/branches/qpid.0-10/java: ./ broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/ broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/ broker/bin/ broker/etc/ broker...

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Thu Aug 14 20:40:49 2008
@@ -28,16 +28,15 @@
 import org.apache.qpid.codec.AMQCodecFactory;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.IApplicationRegistry;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
 
 import javax.management.JMException;
 
-
 /**
  * Test class to test MBean operations for AMQMinaProtocolSession.
  */
@@ -56,13 +55,12 @@
         // check the channel count is correct
         int channelCount = _mbean.channels().size();
         assertTrue(channelCount == 1);
-        AMQQueue queue = new org.apache.qpid.server.queue.AMQQueue(new AMQShortString("testQueue_" + System.currentTimeMillis()),
+        AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue_" + System.currentTimeMillis()),
                                                                    false,
                                                                    new AMQShortString("test"),
                                                                    true,
-                                                                   _protocolSession.getVirtualHost());
-        AMQChannel channel = new AMQChannel(_protocolSession, 2, _messageStore);
-	
+                                                                   _protocolSession.getVirtualHost(), null);
+        AMQChannel channel = new AMQChannel(_protocolSession,2, _messageStore);
         channel.setDefaultQueue(queue);
         _protocolSession.addChannel(channel);
         channelCount = _mbean.channels().size();

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java Thu Aug 14 20:40:49 2008
@@ -23,24 +23,28 @@
 import junit.framework.TestCase;
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.BasicContentHeaderProperties;
 import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.ack.UnacknowledgedMessage;
+import org.apache.qpid.server.subscription.Subscription;
+import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
+import org.apache.qpid.server.flow.LimitlessCreditManager;
+import org.apache.qpid.server.flow.Pre0_10CreditManager;
 import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
 import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
 import org.apache.qpid.server.txn.NonTransactionalContext;
 import org.apache.qpid.server.txn.TransactionalContext;
 import org.apache.qpid.server.util.NullApplicationRegistry;
 
-import java.util.HashSet;
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.Set;
+import java.util.Collections;
 
 /**
  * Tests that acknowledgements are handled correctly.
@@ -49,37 +53,38 @@
 {
     private static final Logger _log = Logger.getLogger(AckTest.class);
 
-    private SubscriptionImpl _subscription;
+    private Subscription _subscription;
 
     private MockProtocolSession _protocolSession;
 
-    private TestableMemoryMessageStore _messageStore;
+    private TestMemoryMessageStore _messageStore;
 
     private StoreContext _storeContext = new StoreContext();
 
     private AMQChannel _channel;
 
-    private SubscriptionSet _subscriptionManager;
-
     private AMQQueue _queue;
 
     private static final AMQShortString DEFAULT_CONSUMER_TAG = new AMQShortString("conTag");
 
-    public AckTest() throws Exception
-    {
-        ApplicationRegistry.initialise(new NullApplicationRegistry());
-    }
-
     protected void setUp() throws Exception
     {
         super.setUp();
-        _messageStore = new TestableMemoryMessageStore();
+        ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
+
+        _messageStore = new TestMemoryMessageStore();
         _protocolSession = new MockProtocolSession(_messageStore);
-        _channel = new AMQChannel(_protocolSession, 5, _messageStore);
+        _channel = new AMQChannel(_protocolSession,5, _messageStore /*dont need exchange registry*/);
 
         _protocolSession.addChannel(_channel);
-        _subscriptionManager = new SubscriptionSet();
-        _queue = new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), _subscriptionManager);
+
+        _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"),
+                                                    null);
+    }
+
+    protected void tearDown()
+    {
+        ApplicationRegistry.remove(1);
     }
 
     private void publishMessages(int count) throws AMQException
@@ -92,6 +97,7 @@
         TransactionalContext txnContext = new NonTransactionalContext(_messageStore, _storeContext, null,
                                                                       new LinkedList<RequiredDeliveryException>()
         );
+        _queue.registerSubscription(_subscription,false);
         MessageHandleFactory factory = new MessageHandleFactory();
         for (int i = 1; i <= count; i++)
         {
@@ -125,7 +131,8 @@
                     return new AMQShortString("rk");
                 }
             };
-            AMQMessage msg = new AMQMessage(_messageStore.getNewMessageId(), publishBody, txnContext);
+            IncomingMessage msg = new IncomingMessage(_messageStore.getNewMessageId(), publishBody, txnContext,_protocolSession);
+            //IncomingMessage msg2 = null;
             if (persistent)
             {
                 BasicContentHeaderProperties b = new BasicContentHeaderProperties();
@@ -142,10 +149,16 @@
             // we increment the reference here since we are not delivering the messaging to any queues, which is where
             // the reference is normally incremented. The test is easier to construct if we have direct access to the
             // subscription
-            msg.incrementReference();
-            msg.routingComplete(_messageStore, _storeContext, factory);
+            ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
+            qs.add(_queue);
+            msg.enqueue(qs);
+            msg.routingComplete(_messageStore, factory);
+            if(msg.allContentReceived())
+            {
+                msg.deliverToQueues();
+            }
             // we manually send the message to the subscription
-            _subscription.send(new QueueEntry(_queue,msg), _queue);
+            //_subscription.send(new QueueEntry(_queue,msg), _queue);
         }
     }
 
@@ -155,16 +168,13 @@
      */
     public void testAckChannelAssociationTest() throws AMQException
     {
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true, null, false, new LimitlessCreditManager());
         final int msgCount = 10;
         publishMessages(msgCount, true);
 
         UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
         assertTrue(map.size() == msgCount);
         assertTrue(_messageStore.getMessageMetaDataMap().size() == msgCount);
-        
-        //DTX
-        //       assertTrue(_messageStore.getNumberStoredMessages() == msgCount);
 
         Set<Long> deliveryTagSet = map.getDeliveryTags();
         int i = 1;
@@ -172,15 +182,12 @@
         {
             assertTrue(deliveryTag == i);
             i++;
-            UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
+            QueueEntry unackedMsg = map.get(deliveryTag);
             assertTrue(unackedMsg.getQueue() == _queue);
         }
 
         assertTrue(map.size() == msgCount);
         assertTrue(_messageStore.getMessageMetaDataMap().size() == msgCount);
-        
-        //DTX
-//        assertTrue(_messageStore.getNumberStoredMessages() == msgCount);
     }
 
     /**
@@ -189,15 +196,32 @@
     public void testNoAckMode() throws AMQException
     {
         // false arg means no acks expected
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, false);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, false, null, false, new LimitlessCreditManager());
         final int msgCount = 10;
         publishMessages(msgCount);
 
         UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
         assertTrue(map.size() == 0);
         assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
-        //DTX MessageStore
-//        assertTrue(_messageStore.getNumberStoredMessages() == 0);
+        assertTrue(_messageStore.getContentBodyMap().size() == 0);
+
+    }
+
+    /**
+     * Tests that in no-ack mode no messages are retained
+     */
+    public void testPersistentNoAckMode() throws AMQException
+    {
+        // false arg means no acks expected
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, false,null,false, new LimitlessCreditManager());
+        final int msgCount = 10;
+        publishMessages(msgCount, true);
+
+        UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
+        assertTrue(map.size() == 0);
+        assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
+        assertTrue(_messageStore.getContentBodyMap().size() == 0);
+
     }
 
     /**
@@ -206,7 +230,7 @@
      */
     public void testSingleAckReceivedTest() throws AMQException
     {
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
         final int msgCount = 10;
         publishMessages(msgCount);
 
@@ -219,7 +243,7 @@
         for (long deliveryTag : deliveryTagSet)
         {
             assertTrue(deliveryTag == i);
-            UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
+            QueueEntry unackedMsg = map.get(deliveryTag);
             assertTrue(unackedMsg.getQueue() == _queue);
             // 5 is the delivery tag of the message that *should* be removed
             if (++i == 5)
@@ -235,7 +259,7 @@
      */
     public void testMultiAckReceivedTest() throws AMQException
     {
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
         final int msgCount = 10;
         publishMessages(msgCount);
 
@@ -248,7 +272,7 @@
         for (long deliveryTag : deliveryTagSet)
         {
             assertTrue(deliveryTag == i + 5);
-            UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
+            QueueEntry unackedMsg = map.get(deliveryTag);
             assertTrue(unackedMsg.getQueue() == _queue);
             ++i;
         }
@@ -259,7 +283,7 @@
      */
     public void testMultiAckAllReceivedTest() throws AMQException
     {
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
         final int msgCount = 10;
         publishMessages(msgCount);
 
@@ -272,18 +296,44 @@
         for (long deliveryTag : deliveryTagSet)
         {
             assertTrue(deliveryTag == i + 5);
-            UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
+            QueueEntry unackedMsg = map.get(deliveryTag);
             assertTrue(unackedMsg.getQueue() == _queue);
             ++i;
         }
     }
 
+            /**
+     * A regression fixing QPID-1136 showed this up
+     *
+     * @throws Exception
+     */
+    public void testMessageDequeueRestoresCreditTest() throws Exception
+    {
+        // Send 10 messages
+        Pre0_10CreditManager creditManager = new Pre0_10CreditManager(0l, 1);
+
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession,
+                                                                            DEFAULT_CONSUMER_TAG, true, null, false, creditManager);
+        final int msgCount = 1;
+        publishMessages(msgCount);
+
+        _queue.deliverAsync(_subscription);
+
+        _channel.acknowledgeMessage(1, false);
+
+        // Check credit available
+        assertTrue("No credit available", creditManager.hasCredit());
+
+    }
+
+
+/*
     public void testPrefetchHighLow() throws AMQException
     {
         int lowMark = 5;
         int highMark = 10;
 
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
         _channel.setPrefetchLowMarkCount(lowMark);
         _channel.setPrefetchHighMarkCount(highMark);
 
@@ -332,10 +382,12 @@
         assertTrue(map.size() == 0);
     }
 
+*/
+/*
     public void testPrefetch() throws AMQException
     {
-        _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
-        _channel.setPrefetchCount(5);
+        _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
+        _channel.setMessageCredit(5);
 
         assertTrue(_channel.getPrefetchCount() == 5);
 
@@ -360,6 +412,7 @@
         assertTrue(map.size() == 0);
     }
 
+*/
     public static junit.framework.Test suite()
     {
         return new junit.framework.TestSuite(AckTest.class);

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java Thu Aug 14 20:40:49 2008
@@ -24,7 +24,7 @@
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.MemoryMessageStore;
+import org.apache.qpid.server.store.SkeletonMessageStore;
 import org.apache.qpid.server.store.StoreContext;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.util.NullApplicationRegistry;
@@ -39,7 +39,7 @@
 
 class MessageTestHelper extends TestCase
 {
-    private final MessageStore _messageStore = new MemoryMessageStore();
+    private final MessageStore _messageStore = new SkeletonMessageStore();
 
     private final StoreContext _storeContext = new StoreContext();
 
@@ -52,12 +52,12 @@
         ApplicationRegistry.initialise(new NullApplicationRegistry());
     }
 
-    QueueEntry message() throws AMQException
+    QueueEntryImpl message() throws AMQException
     {
         return message(false);
     }
 
-    QueueEntry message(final boolean immediate) throws AMQException
+    QueueEntryImpl message(final boolean immediate) throws AMQException
     {
         MessagePublishInfo publish = new MessagePublishInfo()
         {
@@ -87,9 +87,16 @@
                 return null;
             }
         };
-                              
-        return new QueueEntry(null,new AMQMessage(_messageStore.getNewMessageId(), publish, _txnContext,
-                              new ContentHeaderBody()));
+
+        //public AMQMessage(Long messageId, AMQMessageHandle messageHandle , TransactionalContext txnConext, MessagePublishInfo info)
+        long messageId = _messageStore.getNewMessageId();
+        final AMQMessageHandle messageHandle =
+                (new MessageHandleFactory()).createMessageHandle(messageId, _messageStore, false);
+        messageHandle.setPublishAndContentHeaderBody(new StoreContext(),publish,new ContentHeaderBody());
+        AMQMessage msg = new AMQMessage(messageHandle, _txnContext.getStoreContext(), publish);
+        
+
+        return new QueueEntryImpl(null,msg, Long.MIN_VALUE);
     }
 
 }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java Thu Aug 14 20:40:49 2008
@@ -21,6 +21,7 @@
 package org.apache.qpid.server.queue;
 
 import org.apache.qpid.AMQException;
+import org.apache.qpid.AMQConnectionException;
 import org.apache.qpid.framing.*;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.output.ProtocolOutputConverter;
@@ -28,6 +29,7 @@
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
 import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.transport.Sender;
 
 import javax.security.sasl.SaslServer;
 import java.util.HashMap;
@@ -117,6 +119,10 @@
     {
     }
 
+    public void closeConnection(int channelId, AMQConnectionException e, boolean closeIoSession) throws AMQException
+    {        
+    }
+
     public Object getKey()
     {
         return null;
@@ -215,6 +221,11 @@
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
+    public ProtocolSessionIdentifier getSessionIdentifier()
+    {
+        return null;
+    }
+
     public byte getProtocolMajorVersion()
     {
         return getProtocolVersion().getMajorVersion();
@@ -236,4 +247,16 @@
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
+
+    public void setSender(Sender<java.nio.ByteBuffer> sender)
+    {
+        // FIXME AS TODO
+        
+    }
+
+    public void init()
+    {
+        // TODO Auto-generated method stub
+        
+    }
 }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java Thu Aug 14 20:40:49 2008
@@ -81,14 +81,6 @@
         System.err.println("_logger.isDebug:" + _logger.isDebugEnabled() + ":" + _logger.isEnabledFor(Level.DEBUG));
         System.err.println("_logger.isTrace:" + _logger.isTraceEnabled() + ":" + _logger.isEnabledFor(Level.TRACE));
 
-        Logger csdm = Logger.getLogger(ConcurrentSelectorDeliveryManager.class);
-        System.err.println("csdm.isE-Error:" + csdm.isEnabledFor(Level.ERROR));
-        System.err.println("csdm.isE-Warn:" + csdm.isEnabledFor(Level.WARN));
-        System.err.println("csdm.isInfo:" + csdm.isInfoEnabled() + ":" + csdm.isEnabledFor(Level.INFO));
-        System.err.println("csdm.isDebug:" + csdm.isDebugEnabled() + ":" + csdm.isEnabledFor(Level.DEBUG));
-        System.err.println("csdm.isTrace:" + csdm.isTraceEnabled() + ":" + csdm.isEnabledFor(Level.TRACE));
-
-
         System.err.println(Logger.getRootLogger().getLoggerRepository());
 
         if (BROKER.startsWith("vm://"))
@@ -184,9 +176,14 @@
 
         try
         {
+            Thread.sleep(2000);
             long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _context.lookup("queue"));
             assertEquals("Session reports Queue depth not as expected", 0, queueDepth);
         }
+        catch (InterruptedException e)
+        {
+            fail(e.getMessage());
+        }
         catch (NamingException e)
         {
             fail(e.getMessage());
@@ -209,7 +206,7 @@
 
     }
 
-    private void verifyAllMessagesRecevied() throws JMSException
+    private void verifyAllMessagesRecevied() throws Exception
     {
 
         boolean[] msgIdRecevied = new boolean[MSG_COUNT];
@@ -219,6 +216,8 @@
             _messages[i] = _consumer.receive(1000);
             assertNotNull("should have received a message but didn't", _messages[i]);
         }
+        long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _context.lookup("queue"));
+        assertEquals("Session reports Queue depth not as expected", 0, queueDepth);
 
         //Check received messages
         int msgId = 0;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java Thu Aug 14 20:40:49 2008
@@ -21,6 +21,8 @@
 package org.apache.qpid.server.queue;
 
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.subscription.Subscription;
+import org.apache.qpid.framing.AMQShortString;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -54,7 +56,12 @@
         return messages;
     }
 
-    public void send(QueueEntry msg, AMQQueue queue)
+    public void setQueue(AMQQueue queue)
+    {
+        
+    }
+
+    public void send(QueueEntry msg)
     {
         messages.add(msg);
     }
@@ -79,9 +86,39 @@
         //no-op
     }
 
-    public Object getSendLock()
+    public void getSendLock()
+    {
+        return;
+    }
+
+    public void releaseSendLock()
+    {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void resend(final QueueEntry entry)
+    {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void restoreCredit(final QueueEntry queueEntry)
+    {
+
+    }
+
+    public void setStateListener(final StateListener listener)
+    {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public QueueEntry getLastSeenEntry()
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean setLastSeenEntry(QueueEntry expected, QueueEntry newValue)
     {
-        return new Object();
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
     public AMQChannel getChannel()
@@ -94,6 +131,26 @@
         //no-op
     }
 
+    public AMQShortString getConsumerTag()
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isActive()
+    {
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public AMQQueue getQueue()
+    {
+        return null;
+    }
+
+    public QueueEntry.SubscriptionAcquiredState getOwningState()
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
     public void queueDeleted(AMQQueue queue)
     {
     }
@@ -108,6 +165,11 @@
         return true;
     }
 
+    public boolean isAutoClose()
+    {
+        return false;
+    }
+
     public Queue<QueueEntry> getPreDeliveryQueue()
     {
         return null;
@@ -157,5 +219,4 @@
     {
         return key.toString();
     }
-    
 }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java Thu Aug 14 20:40:49 2008
@@ -30,6 +30,7 @@
 import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
 import org.apache.qpid.url.URLSyntaxException;
 import org.apache.qpid.AMQException;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.log4j.Logger;
 
 import javax.jms.JMSException;
@@ -82,7 +83,8 @@
     {
         if (usingInVMBroker())
         {
-            TransportConnection.killAllVMBrokers();
+            TransportConnection.killVMBroker(1);
+            ApplicationRegistry.remove(1);
         }
         super.tearDown();
     }
@@ -95,7 +97,7 @@
 
         env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
         env.put("queue.queue", QUEUE);
-
+                                           
         Context context = factory.getInitialContext(env);
 
         Queue queue = (Queue) context.lookup("queue");

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Thu Aug 14 20:40:49 2008
@@ -35,7 +35,6 @@
 import javax.jms.IllegalStateException;
 import java.io.File;
 
-
 public class SimpleACLTest extends TestCase implements ConnectionListener
 {
     private String BROKER = "vm://:1";//"tcp://localhost:5672";
@@ -52,7 +51,7 @@
             fail("Configuration file not found:" + defaultaclConfigFile);
         }
 
-        if (System.getProperty("QPID_HOME") == null)
+        if (System.getProperty("QPID_HOME") == null)                                                                                            
         {
             fail("QPID_HOME not set");
         }
@@ -73,7 +72,7 @@
     public String createConnectionString(String username, String password, String broker)
     {
 
-        return "amqp://" + username + ":" + password + "@clientid/test?brokerlist='" + broker + "'";
+        return "amqp://" + username + ":" + password + "@clientid/test?brokerlist='" + broker + "?retries='0''";
     }
 
     public void testAccessAuthorized() throws AMQException, URLSyntaxException
@@ -113,15 +112,9 @@
         }
         catch (AMQException amqe)
         {
-            if (amqe.getCause().getClass() == Exception.class)
-            {
-                System.err.println("QPID-594 : WARNING RACE CONDITION. Unable to determine cause of Connection Failure.");
-                return;
-            }
-            assertEquals("Linked Exception Incorrect", JMSException.class, amqe.getCause().getClass());
-            Exception linked = ((JMSException) amqe.getCause()).getLinkedException();
-            assertEquals("Exception was wrong type", AMQAuthenticationException.class, linked.getClass());
-            assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) linked).getErrorCode().getCode());
+            Throwable cause = amqe.getCause();
+            assertEquals("Exception was wrong type", AMQAuthenticationException.class, cause.getClass());
+            assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
         }
     }
 
@@ -304,11 +297,6 @@
 
             fail("Close is not expected to succeed.");
         }
-        catch (IllegalStateException ise)
-        {
-            System.err.println("QPID-826 : WARNING : Unable to determine cause of failure due to closure as we don't " +
-                               "record it for reporting after connection closed asynchronously");
-        }
         catch (JMSException e)
         {
             Throwable cause = e.getLinkedException();
@@ -567,15 +555,10 @@
 
             fail("Close is not expected to succeed.");
         }
-        catch (IllegalStateException ise)
-        {
-            System.err.println("QPID-826 : WARNING : Unable to determine cause of failure due to closure as we don't " +
-                               "record it for reporting after connection closed asynchronously");
-        }
         catch (JMSException e)
         {
             Throwable cause = e.getLinkedException();
-            cause.printStackTrace();
+
             assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
             assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
         }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java Thu Aug 14 20:40:49 2008
@@ -22,12 +22,11 @@
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentBody;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.MessageMetaData;
+import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.exchange.Exchange;
 
@@ -81,6 +80,10 @@
 
     public void createQueue(AMQQueue queue) throws AMQException
     {
+    }
+
+    public void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException
+    {
     }        
 
     public void beginTran(StoreContext s) throws AMQException
@@ -130,17 +133,22 @@
         return null;
     }
 
-    public void removeQueue(AMQShortString name) throws AMQException
+    public boolean isPersistent()
+    {
+        return false;
+    }
+
+    public void removeQueue(final AMQQueue queue) throws AMQException
     {
 
     }
 
-    public void enqueueMessage(StoreContext context, AMQShortString name, Long messageId) throws AMQException
+    public void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
     {
 
     }
 
-    public void dequeueMessage(StoreContext context, AMQShortString name, Long messageId) throws AMQException
+    public void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
     {
 
     }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java Thu Aug 14 20:40:49 2008
@@ -28,21 +28,22 @@
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.queue.AMQMessage;
 import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.txn.NonTransactionalContext;
+import org.apache.qpid.server.queue.AMQMessageHandle;
 
 /**
  * Tests that reference counting works correctly with AMQMessage and the message store
  */
 public class TestReferenceCounting extends TestCase
 {
-    private TestableMemoryMessageStore _store;
+    private TestMemoryMessageStore _store;
 
     private StoreContext _storeContext = new StoreContext();
 
+
     protected void setUp() throws Exception
     {
         super.setUp();
-        _store = new TestableMemoryMessageStore();
+        _store = new TestMemoryMessageStore();
     }
 
     /**
@@ -50,7 +51,7 @@
      */
     public void testMessageGetsRemoved() throws AMQException
     {
-        createPersistentContentHeader();
+        ContentHeaderBody chb = createPersistentContentHeader();
 
         MessagePublishInfo info = new MessagePublishInfo()
         {
@@ -81,16 +82,22 @@
             }
         };
 
-        AMQMessage message = new AMQMessage(_store.getNewMessageId(), info,
-                                            new NonTransactionalContext(_store, _storeContext, null, null),
-                                            createPersistentContentHeader());
+
+        final long messageId = _store.getNewMessageId();
+        AMQMessageHandle messageHandle = (new MessageHandleFactory()).createMessageHandle(messageId, _store, true);
+        messageHandle.setPublishAndContentHeaderBody(_storeContext,info, chb);
+        AMQMessage message = new AMQMessage(messageHandle,
+                                             _storeContext,info);
+
         message = message.takeReference();
 
         // we call routing complete to set up the handle
-        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
-        assertTrue(_store.getMessageMetaDataMap().size() == 1);
+ //       message.routingComplete(_store, _storeContext, new MessageHandleFactory());
+
+
+        assertEquals(1, _store.getMessageMetaDataMap().size());
         message.decrementReference(_storeContext);
-        assertTrue(_store.getMessageMetaDataMap().size() == 0);
+        assertEquals(1, _store.getMessageMetaDataMap().size());
     }
 
     private ContentHeaderBody createPersistentContentHeader()
@@ -134,18 +141,25 @@
             }
         };
 
-        AMQMessage message = new AMQMessage(_store.getNewMessageId(),
-                                            info,
-                                            new NonTransactionalContext(_store, _storeContext, null, null),
-                                            createPersistentContentHeader());
+        final Long messageId = _store.getNewMessageId();
+        final ContentHeaderBody chb = createPersistentContentHeader();
+        AMQMessageHandle messageHandle = (new MessageHandleFactory()).createMessageHandle(messageId, _store, true);
+        messageHandle.setPublishAndContentHeaderBody(_storeContext,info,chb);
+        AMQMessage message = new AMQMessage(messageHandle,
+                                             _storeContext,
+                                            info);
+        
         
         message = message.takeReference();
         // we call routing complete to set up the handle
-        message.routingComplete(_store, _storeContext, new MessageHandleFactory());
-        assertTrue(_store.getMessageMetaDataMap().size() == 1);
+     //   message.routingComplete(_store, _storeContext, new MessageHandleFactory());
+
+
+
+        assertEquals(1, _store.getMessageMetaDataMap().size());
         message = message.takeReference();
         message.decrementReference(_storeContext);
-        assertTrue(_store.getMessageMetaDataMap().size() == 1);
+        assertEquals(1, _store.getMessageMetaDataMap().size());
     }
 
     public static junit.framework.Test suite()

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java Thu Aug 14 20:40:49 2008
@@ -23,7 +23,7 @@
 import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.store.StoreContext;
 
 import java.util.LinkedList;
@@ -194,7 +194,7 @@
         }
     }
 
-    class MockStore extends TestableMemoryMessageStore
+    class MockStore extends TestMemoryMessageStore
     {
         final Object BEGIN = "BEGIN";
         final Object ABORT = "ABORT";

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java Thu Aug 14 20:40:49 2008
@@ -22,7 +22,7 @@
 package org.apache.qpid.test.client;
 
 import org.apache.log4j.Logger;
-import org.apache.qpid.testutil.QpidTestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
 
 import javax.jms.Connection;
 import javax.jms.MessageConsumer;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java Thu Aug 14 20:40:49 2008
@@ -1,7 +1,6 @@
 package org.apache.qpid.test.client;
 
-import org.apache.qpid.AMQException;
-import org.apache.qpid.testutil.QpidTestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
 
@@ -53,6 +52,10 @@
         _queue = (Queue)  getInitialContext().lookup("queue");
 
 
+        //Declare the queue
+        Connection consumerConnection = getConnection();
+        consumerConnection.createSession(false,Session.AUTO_ACKNOWLEDGE).createConsumer(_queue).close();
+
         //Create Producer put some messages on the queue
         Connection producerConnection = getConnection();
 
@@ -84,12 +87,14 @@
         //Create Client
         Connection clientConnection = getConnection();
 
-        clientConnection.start();
-
         final Session clientSession = clientConnection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
 
         MessageConsumer consumer = clientSession.createConsumer(_queue);
 
+        assertEquals("The queue should have msgs at start", MSG_COUNT, ((AMQSession) clientSession).getQueueDepth((AMQDestination) _queue));
+
+        clientConnection.start();        
+
         consumer.setMessageListener(new MessageListener()
         {
             int _msgCount = 0;
@@ -110,13 +115,10 @@
                         {
                             try
                             {
-                                long remainingMessages = ((AMQSession) clientSession).getQueueDepth((AMQDestination) _queue);
-                                fail("The queue should have 0 msgs left, seen " + _msgCount + " messages, left: "
-                                        + remainingMessages);
-                            }
-                            catch (AMQException e)
-                            {
-                                fail("Got AMQException" + e.getMessage());
+                                if(_msgCount != MSG_COUNT)
+                                {
+                                    assertEquals("Wrong number of messages seen.", MSG_COUNT, _msgCount);
+                                }
                             }
                             finally
                             {
@@ -124,7 +126,6 @@
                                 _awaitCompletion.countDown();
                             }
                         }
-
                     }
                     catch (JMSException e)
                     {
@@ -140,14 +141,24 @@
 
         try
         {
-            _awaitCompletion.await(60, TimeUnit.SECONDS);
+            if (!_awaitCompletion.await(120, TimeUnit.SECONDS))
+            {
+                fail("Test did not complete in 120 seconds");
+            }
         }
         catch (InterruptedException e)
         {
             fail("Unable to wait for test completion");
             throw e;
         }
+
+        //Close consumer to give broker time to process in bound Acks. As The main thread will be released while
+        // before the dispatcher has sent the ack back to the broker.
+        consumer.close();
+
         assertEquals("The queue should have 0 msgs left", 0, ((AMQSession) clientSession).getQueueDepth((AMQDestination) _queue));
+
+        clientConnection.close();
     }
 
 }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java Thu Aug 14 20:40:49 2008
@@ -24,10 +24,9 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.FailoverBaseCase;
+import org.apache.qpid.test.utils.FailoverBaseCase;
 
 import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -112,7 +111,7 @@
     }
 
 
-    protected void sendMessages(Connection producerConnection, int num) throws JMSException
+    protected void sendMessages(Connection producerConnection, int messageSendCount) throws JMSException
     {
         producerConnection.start();
 
@@ -123,7 +122,7 @@
 
         MessageProducer producer = producerSession.createProducer(_queue);
 
-        for (int messsageID = 0; messsageID < num; messsageID++)
+        for (int messsageID = 0; messsageID < messageSendCount; messsageID++)
         {
             TextMessage textMsg = producerSession.createTextMessage("Message " + messsageID);
             textMsg.setIntProperty(MESSAGE_ID_PROPERTY, messsageID);
@@ -133,7 +132,15 @@
         producerConnection.close();
     }
 
-    protected void checkQueueDepth(int depth) throws JMSException
+    /**
+     * Using the Protocol getQueueDepth method ensure that the correct number of messages are on the queue.
+     *
+     * Also uses a QueueBrowser as a second method of validating the message count on the queue.
+     *
+     * @param expectedDepth The expected Queue depth
+     * @throws JMSException on error
+     */
+    protected void checkQueueDepth(int expectedDepth) throws JMSException
     {
 
         // create QueueBrowser
@@ -144,7 +151,7 @@
         // check for messages
         if (_logger.isDebugEnabled())
         {
-            _logger.debug("Checking for " + depth + " messages with QueueBrowser");
+            _logger.debug("Checking for " + expectedDepth + " messages with QueueBrowser");
         }
 
         //Check what the session believes the queue count to be.
@@ -158,7 +165,9 @@
         {
         }
 
-        assertEquals("Session reports Queue depth not as expected", depth, queueDepth);
+        assertEquals("Session reports Queue expectedDepth not as expected", expectedDepth, queueDepth);
+
+
 
         // Browse the queue to get a second opinion
         int msgCount = 0;
@@ -176,7 +185,7 @@
         }
 
         // check to see if all messages found
-        assertEquals("Browser did not find all messages", depth, msgCount);
+        assertEquals("Browser did not find all messages", expectedDepth, msgCount);
 
         //Close browser
         queueBrowser.close();
@@ -206,13 +215,20 @@
         }
     }
 
-
-    protected void checkMultipleGetEnum(int sentMessages, int browserCount) throws JMSException
+    /**
+     * This method checks that multiple calls to getEnumeration() on a queueBrowser provide the same behaviour.
+     *
+     * @param sentMessages The number of messages sent
+     * @param browserEnumerationCount The number of times to call getEnumeration()
+     * @throws JMSException
+     */
+    protected void checkMultipleGetEnum(int sentMessages, int browserEnumerationCount) throws JMSException
     {
         QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
 
-        for (int count = 0; count < browserCount; count++)
+        for (int count = 0; count < browserEnumerationCount; count++)
         {
+            _logger.info("Checking getEnumeration:" + count);
             Enumeration msgs = queueBrowser.getEnumeration();
 
             int msgCount = 0;
@@ -222,7 +238,9 @@
                 msgs.nextElement();
                 msgCount++;
             }
-            assertEquals(msgCount, sentMessages);
+
+            // Verify that the browser can see all the messages sent.
+            assertEquals(sentMessages, msgCount);
         }
 
         try
@@ -235,22 +253,22 @@
         }
     }
 
-    protected void checkOverlappingMultipleGetEnum(int browserCount, int expectedMessages) throws JMSException
+    protected void checkOverlappingMultipleGetEnum(int expectedMessages, int browserEnumerationCount) throws JMSException
     {
-        checkOverlappingMultipleGetEnum(browserCount, expectedMessages, null);
+        checkOverlappingMultipleGetEnum(expectedMessages, browserEnumerationCount, null);
     }
 
-    protected void checkOverlappingMultipleGetEnum(int browserCount, int expectedMessages, String selector) throws JMSException
+    protected void checkOverlappingMultipleGetEnum(int expectedMessages, int browserEnumerationCount, String selector) throws JMSException
     {
         QueueBrowser queueBrowser = selector == null ?
                                     _clientSession.createBrowser(_queue, selector) :
                                     _clientSession.createBrowser(_queue);
 
-        Enumeration[] msgs = new Enumeration[browserCount];
-        int[] msgCount = new int[browserCount];
+        Enumeration[] msgs = new Enumeration[browserEnumerationCount];
+        int[] msgCount = new int[browserEnumerationCount];
 
         //create Enums
-        for (int count = 0; count < browserCount; count++)
+        for (int count = 0; count < browserEnumerationCount; count++)
         {
             msgs[count] = queueBrowser.getEnumeration();
         }
@@ -258,7 +276,7 @@
         //interleave reads
         for (int cnt = 0; cnt < expectedMessages; cnt++)
         {
-            for (int count = 0; count < browserCount; count++)
+            for (int count = 0; count < browserEnumerationCount; count++)
             {
                 if (msgs[count].hasMoreElements())
                 {
@@ -269,7 +287,7 @@
         }
 
         //validate all browsers get right message count.
-        for (int count = 0; count < browserCount; count++)
+        for (int count = 0; count < browserEnumerationCount; count++)
         {
             assertEquals(msgCount[count], expectedMessages);
         }
@@ -326,12 +344,12 @@
         checkQueueDepth(0);
     }
 
-    protected void checkQueueDepthWithSelectors(int clients, int totalMessages) throws JMSException
+    protected void checkQueueDepthWithSelectors(int totalMessages, int clients) throws JMSException
     {
 
         String selector = MESSAGE_ID_PROPERTY + " % " + clients;
 
-        checkOverlappingMultipleGetEnum(clients, totalMessages / clients, selector);
+        checkOverlappingMultipleGetEnum(totalMessages / clients, clients, selector);
     }
 
 
@@ -376,9 +394,14 @@
 
     }
 
+    /**
+     * This tests that multiple getEnumerations on a QueueBrowser return the required number of messages.
+     * @throws NamingException
+     * @throws JMSException
+     */
     public void testMultipleGetEnum() throws NamingException, JMSException
     {
-        int messages = 100;
+        int messages = 10;
 
         sendMessages(messages);
 
@@ -397,7 +420,7 @@
 
         checkQueueDepth(messages);
 
-        checkOverlappingMultipleGetEnum(5, messages);
+        checkOverlappingMultipleGetEnum(messages, 5);
 
         validate(messages);
     }
@@ -413,16 +436,21 @@
 
         for (int clients = 2; clients <= 10; clients++)
         {
-            checkQueueDepthWithSelectors(clients, messages);
+            checkQueueDepthWithSelectors(messages, clients);
         }
 
         validate(messages);
     }
 
+    /**
+     * Testing that a QueueBrowser doesn't actually consume messages from a broker when it fails over.
+     * @throws JMSException
+     */
     public void testFailoverWithQueueBrowser() throws JMSException
     {
         int messages = 5;
 
+
         sendMessages("connection1", messages);
         sendMessages("connection2", messages);
 
@@ -476,7 +504,9 @@
         //Close browser
         queueBrowser.close();
 
-        //Validate all messages still on Broker 1
+        _logger.info("Closed Queue Browser, validating messages on broker.");
+
+        //Validate all messages still on Broker
         validate(messages);
     }
 
@@ -497,20 +527,4 @@
         validate(messages);
     }
 
-    public void loop() throws JMSException
-    {
-        int run = 0;
-        try
-        {
-            while (true)
-            {
-                System.err.println(run++ + ":************************************************************************");
-                testQueueBrowserMsgsRemainOnQueue();
-            }
-        }
-        catch (Exception e)
-        {
-            _logger.error(e, e);
-        }
-    }
 }

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java Thu Aug 14 20:40:49 2008
@@ -21,14 +21,15 @@
 
 package org.apache.qpid.test.client.failover;
 
-import junit.framework.TestCase;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQQueue;
+import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.jms.ConnectionURL;
+import org.apache.qpid.jms.BrokerDetails;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.url.URLSyntaxException;
+import org.apache.qpid.test.utils.FailoverBaseCase;
 import org.apache.log4j.Logger;
 
 import javax.jms.Connection;
@@ -38,82 +39,66 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import javax.jms.Queue;
+import javax.naming.NamingException;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
-public class FailoverTest extends TestCase implements ConnectionListener
+public class FailoverTest extends FailoverBaseCase implements ConnectionListener
 {
     private static final Logger _logger = Logger.getLogger(FailoverTest.class);
 
-    private static final int NUM_BROKERS = 2;
-    private static final String BROKER = "amqp://guest:guest@/test?brokerlist='vm://:%d;vm://:%d'";
     private static final String QUEUE = "queue";
     private static final int NUM_MESSAGES = 10;
-    private Connection con;
-    private AMQConnectionFactory conFactory;
-    private Session prodSess;
-    private AMQQueue q;
-    private MessageProducer prod;
-    private Session conSess;
+    private Connection connnection;
+    private Session producerSession;
+    private Queue queue;
+    private MessageProducer producer;
+    private Session consumerSession;
     private MessageConsumer consumer;
 
     private static int usedBrokers = 0;
     private CountDownLatch failoverComplete;
+    private static final long DEFAULT_FAILOVER_TIME = 10000L;
 
     @Override
     protected void setUp() throws Exception
     {
         super.setUp();
-        // Create two VM brokers
 
-        for (int i = 0; i < NUM_BROKERS; i++)
-        {
-            usedBrokers++;
-
-            TransportConnection.createVMBroker(usedBrokers);
-        }
-
-        conFactory = new AMQConnectionFactory(String.format(BROKER, usedBrokers - 1, usedBrokers));
-        _logger.info("Connecting on:" + conFactory.getConnectionURL());
-        con = conFactory.createConnection();
-        ((AMQConnection) con).setConnectionListener(this);
-        con.start();
+        connnection = getConnection();
+        ((AMQConnection) connnection).setConnectionListener(this);
+        connnection.start();
         failoverComplete = new CountDownLatch(1);
     }
 
-    private void init(boolean transacted, int mode) throws JMSException
+    private void init(boolean transacted, int mode) throws JMSException, NamingException
     {
-        prodSess = con.createSession(transacted, mode);
-        q = new AMQQueue("amq.direct", QUEUE);
-        prod = prodSess.createProducer(q);
-        conSess = con.createSession(transacted, mode);
-        consumer = conSess.createConsumer(q);
+        queue = (Queue) getInitialContext().lookup(QUEUE);
+
+        consumerSession = connnection.createSession(transacted, mode);
+        consumer = consumerSession.createConsumer(queue);
+
+        producerSession = connnection.createSession(transacted, mode);
+        producer = producerSession.createProducer(queue);
     }
 
     @Override
-    protected void tearDown() throws Exception
+    public void tearDown() throws Exception
     {
         try
         {
-            con.close();
+            connnection.close();
         }
         catch (Exception e)
         {
 
         }
 
-        try
-        {
-            TransportConnection.killAllVMBrokers();
-            ApplicationRegistry.removeAll();
-        }
-        catch (Exception e)
-        {
-            fail("Unable to clean up");
-        }
         super.tearDown();
     }
 
-    private void consumeMessages(int toConsume) throws JMSException
+    private void consumeMessages(int toConsume, boolean transacted) throws JMSException
     {
         Message msg;
         for (int i = 0; i < toConsume; i++)
@@ -122,40 +107,43 @@
             assertNotNull("Message " + i + " was null!", msg);
             assertEquals("message " + i, ((TextMessage) msg).getText());
         }
+        if (transacted) {
+            consumerSession.commit();
+        }
     }
 
-    private void sendMessages(int totalMessages) throws JMSException
+    private void sendMessages(int totalMessages, boolean transacted) throws JMSException
     {
         for (int i = 0; i < totalMessages; i++)
         {
-            prod.send(prodSess.createTextMessage("message " + i));
+            producer.send(producerSession.createTextMessage("message " + i));
+        }
+        if (transacted)
+        {
+            producerSession.commit();
         }
-
-//        try
-//        {
-//            Thread.sleep(100 * totalMessages);
-//        }
-//        catch (InterruptedException e)
-//        {
-//            //evil ignoring of IE
-//        }
     }
 
     public void testP2PFailover() throws Exception
     {
-        testP2PFailover(NUM_MESSAGES, true);
+        testP2PFailover(NUM_MESSAGES, true, false);
     }
 
     public void testP2PFailoverWithMessagesLeft() throws Exception
     {
-        testP2PFailover(NUM_MESSAGES, false);
+        testP2PFailover(NUM_MESSAGES, false, false);
+    }
+
+    public void testP2PFailoverTransacted() throws Exception
+    {
+        testP2PFailover(NUM_MESSAGES, true, false);
     }
 
-    private void testP2PFailover(int totalMessages, boolean consumeAll) throws JMSException
+    private void testP2PFailover(int totalMessages, boolean consumeAll, boolean transacted) throws JMSException, NamingException
     {
         Message msg = null;
-        init(false, Session.AUTO_ACKNOWLEDGE);
-        sendMessages(totalMessages);
+        init(transacted, Session.AUTO_ACKNOWLEDGE);
+        sendMessages(totalMessages, transacted);
 
         // Consume some messages
         int toConsume = totalMessages;
@@ -164,31 +152,29 @@
             toConsume = totalMessages / 2;
         }
 
-        consumeMessages(toConsume);
+        consumeMessages(toConsume, transacted);
 
         _logger.info("Failing over");
 
-        causeFailure();
+        causeFailure(DEFAULT_FAILOVER_TIME);
 
         msg = consumer.receive(500);
-        //todo: reinstate
+
         assertNull("Should not have received message from new broker!", msg);
         // Check that messages still sent / received
-        sendMessages(totalMessages);
-        consumeMessages(totalMessages);
+        sendMessages(totalMessages, transacted);
+        consumeMessages(totalMessages, transacted);
     }
 
-    private void causeFailure()
+    private void causeFailure(long delay)
     {
-        _logger.info("Failover");
 
-        TransportConnection.killVMBroker(usedBrokers - 1);
-        ApplicationRegistry.remove(usedBrokers - 1);
+        failBroker();
 
         _logger.info("Awaiting Failover completion");
         try
         {
-            failoverComplete.await();
+            failoverComplete.await(delay, TimeUnit.MILLISECONDS);
         }
         catch (InterruptedException e)
         {
@@ -199,12 +185,11 @@
     public void testClientAckFailover() throws Exception
     {
         init(false, Session.CLIENT_ACKNOWLEDGE);
-        sendMessages(1);
+        sendMessages(1, false);
         Message msg = consumer.receive();
         assertNotNull("Expected msgs not received", msg);
 
-
-        causeFailure();
+        causeFailure(DEFAULT_FAILOVER_TIME);
 
         Exception failure = null;
         try
@@ -218,18 +203,41 @@
         assertNotNull("Exception should be thrown", failure);
     }
 
-    // This test disabled so that it doesn't add 4 minnutes to the length of time it takes to run, which would be lame
-    public void txest4MinuteFailover() throws Exception
+    /**
+     * The client used to have a fixed timeout of 4 minutes after which failover would no longer work.
+     * Check that this code has not regressed
+     *
+     * @throws Exception if something unexpected occurs in the test.
+     */
+    public void test4MinuteFailover() throws Exception
     {
-        conFactory = new AMQConnectionFactory("amqp://guest:guest@/test?brokerlist='vm://:"+(usedBrokers-1)+"?connectdelay='60000'&retries='2''");
-        _logger.info("Connecting on:" + conFactory.getConnectionURL());
-        con = conFactory.createConnection();
-        ((AMQConnection) con).setConnectionListener(this);
-        con.start();
-
-        long failTime = System.currentTimeMillis() + 60000;
-        causeFailure();
-        assertTrue("Failover did not take long enough", System.currentTimeMillis() > failTime);
+        ConnectionURL connectionURL = getConnectionFactory().getConnectionURL();
+
+        int RETRIES = 4;
+        int DELAY = 60000;
+
+        //Set up a long delay on and large number of retries
+        BrokerDetails details = connectionURL.getBrokerDetails(1);
+        details.setProperty(BrokerDetails.OPTIONS_RETRY, String.valueOf(RETRIES));
+        details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, String.valueOf(DELAY));
+
+        connnection = new AMQConnection(connectionURL, null);
+
+        ((AMQConnection) connnection).setConnectionListener(this);
+
+        //Start the connection
+        connnection.start();
+
+        long FAILOVER_DELAY = (RETRIES * DELAY);
+
+        // Use Nano seconds as it is more accurate for comparision.
+        long failTime = System.nanoTime() + FAILOVER_DELAY * 1000000;
+
+        //Fail the first broker
+        causeFailure(FAILOVER_DELAY + DEFAULT_FAILOVER_TIME);
+
+        //Reconnection should occur
+        assertTrue("Failover did not take long enough", System.nanoTime() > failTime);
     }
 
     public void bytesSent(long count)

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java Thu Aug 14 20:40:49 2008
@@ -33,7 +33,7 @@
  * <tr><td> Provide a message consumer for receiving messages.
  * </table>
  *
- * @todo Update the {@link org.apache.qpid.util.ConversationFactory} so that it accepts these as the basic conversation
+ * @todo Update the {@link org.apache.qpid.test.utils.ConversationFactory} so that it accepts these as the basic conversation
  *       connection units.
  */
 public interface CircuitEnd

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java Thu Aug 14 20:40:49 2008
@@ -25,12 +25,12 @@
 
 import org.apache.qpid.test.framework.BrokerLifecycleAware;
 import org.apache.qpid.test.framework.sequencers.CircuitFactory;
+import org.apache.qpid.test.utils.QpidTestCase;
 
 import org.apache.qpid.junit.extensions.SetupTaskAware;
 import org.apache.qpid.junit.extensions.SetupTaskHandler;
 import org.apache.qpid.junit.extensions.util.ParsedProperties;
 import org.apache.qpid.junit.extensions.util.TestContextProperties;
-import org.apache.qpid.testutil.QpidTestCase;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java Thu Aug 14 20:40:49 2008
@@ -26,7 +26,7 @@
 import org.apache.qpid.test.framework.localcircuit.LocalPublisherImpl;
 import org.apache.qpid.test.framework.localcircuit.LocalReceiverImpl;
 import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.util.ParsedProperties;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java Thu Aug 14 20:40:49 2008
@@ -23,7 +23,7 @@
 import org.apache.log4j.Logger;
 
 import org.apache.qpid.test.framework.*;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.TimingController;
 import org.apache.qpid.junit.extensions.TimingControllerAware;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java Thu Aug 14 20:40:49 2008
@@ -37,7 +37,7 @@
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.TestUtils;
 import org.apache.qpid.test.framework.clocksynch.UDPClockReference;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.TKTestRunner;
 import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java Thu Aug 14 20:40:49 2008
@@ -27,7 +27,7 @@
 import org.apache.qpid.test.framework.FrameworkBaseCase;
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java Thu Aug 14 20:40:49 2008
@@ -30,7 +30,7 @@
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.sequencers.CircuitFactory;
 import org.apache.qpid.test.framework.sequencers.FanOutCircuitFactory;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java Thu Aug 14 20:40:49 2008
@@ -29,7 +29,7 @@
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.sequencers.CircuitFactory;
 import org.apache.qpid.test.framework.sequencers.InteropCircuitFactory;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
 
@@ -47,7 +47,7 @@
  *
  * <p><table id="crc"><caption>CRC Card</caption>
  * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Broadcast test invitations and collect enlists. <td> {@link org.apache.qpid.util.ConversationFactory}.
+ * <tr><td> Broadcast test invitations and collect enlists. <td> {@link org.apache.qpid.test.utils.ConversationFactory}.
  * <tr><td> Output test failures for clients unwilling to run the test case. <td> {@link Coordinator}
  * <tr><td> Execute distributed test cases. <td> {@link FrameworkBaseCase}
  * <tr><td> Fail non-participating pairings. <td> {@link OptOutTestCase}

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java Thu Aug 14 20:40:49 2008
@@ -27,8 +27,8 @@
 import org.apache.qpid.test.framework.TestUtils;
 import org.apache.qpid.test.framework.clocksynch.ClockSynchThread;
 import org.apache.qpid.test.framework.clocksynch.UDPClockSynchronizer;
-import org.apache.qpid.util.ReflectionUtils;
-import org.apache.qpid.util.ReflectionUtilsException;
+import org.apache.qpid.test.utils.ReflectionUtils;
+import org.apache.qpid.test.utils.ReflectionUtilsException;
 
 import org.apache.qpid.junit.extensions.SleepThrottle;
 import org.apache.qpid.junit.extensions.util.ParsedProperties;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java Thu Aug 14 20:40:49 2008
@@ -24,7 +24,7 @@
 
 import org.apache.qpid.test.framework.Circuit;
 import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import java.util.LinkedList;
 import java.util.List;

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java Thu Aug 14 20:40:49 2008
@@ -23,7 +23,7 @@
 import org.apache.qpid.test.framework.Assertion;
 import org.apache.qpid.test.framework.Circuit;
 import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.util.ParsedProperties;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java Thu Aug 14 20:40:49 2008
@@ -27,7 +27,7 @@
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.TestUtils;
 import org.apache.qpid.test.framework.distributedcircuit.DistributedCircuitImpl;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.util.ParsedProperties;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java Thu Aug 14 20:40:49 2008
@@ -27,7 +27,7 @@
 import org.apache.qpid.test.framework.TestClientDetails;
 import org.apache.qpid.test.framework.TestUtils;
 import org.apache.qpid.test.framework.distributedcircuit.DistributedCircuitImpl;
-import org.apache.qpid.util.ConversationFactory;
+import org.apache.qpid.test.utils.ConversationFactory;
 
 import org.apache.qpid.junit.extensions.util.ParsedProperties;
 

Modified: incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java?rev=686136&r1=686135&r2=686136&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java (original)
+++ incubator/qpid/branches/qpid.0-10/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java Thu Aug 14 20:40:49 2008
@@ -31,9 +31,7 @@
 
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.testutil.QpidTestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
 
 public class AcknowledgeTest extends QpidTestCase
 {
@@ -63,21 +61,6 @@
         _consumerA = _consumerSession.createConsumer(_queue);
 	}
 
-    @Override
-    protected void tearDown() throws Exception
-    {
-    	super.tearDown();
-    	try
-    	{
-    		TransportConnection.killAllVMBrokers();
-    		ApplicationRegistry.removeAll();
-    	}
-    	catch (Exception e)
-    	{
-    		fail("Unable to clean up");
-    	}
-
-    }
 
 
     private void sendMessages(int totalMessages) throws JMSException