qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1333027 [11/13] - in /qpid/branches/qpid-3767/qpid: ./ cpp/ cpp/bindings/ cpp/bindings/qmf/ruby/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/bindings/qpid/ruby/features/step_definitions/ cpp/bindings/qpid/ruby/lib/qpid/ cpp/docs/...
Date Wed, 02 May 2012 13:10:03 GMT
Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java Wed May  2 13:09:18 2012
@@ -27,6 +27,7 @@ import org.apache.qpid.server.queue.AMQP
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStoreFactory;
 import org.apache.qpid.server.util.InternalBrokerBaseCase;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
@@ -161,7 +162,7 @@ public class VirtualHostConfigurationTes
         getConfigXml().addProperty("virtualhosts.virtualhost." + getName() + "Extra.queues(-1).queue(-1).name", "r2d2");
         getConfigXml().addProperty("virtualhosts.virtualhost." + getName() + "Extra.queues.queue.r2d2.deadLetterQueues", "true");
         getConfigXml().addProperty("virtualhosts.virtualhost." + getName() + "Extra.queues(-1).queue(-1).name", "c3p0");
-        getConfigXml().addProperty("virtualhosts.virtualhost." + getName() + "Extra.store.class", TestableMemoryMessageStore.class.getName());
+        getConfigXml().addProperty("virtualhosts.virtualhost." + getName() + "Extra.store.factoryclass", TestableMemoryMessageStoreFactory.class.getName());
 
         // Start the broker now.
         super.createBroker();

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java Wed May  2 13:09:18 2012
@@ -20,8 +20,19 @@
  */
 package org.apache.qpid.server.exchange;
 
-import org.apache.log4j.Logger;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.BasicContentHeaderProperties;
@@ -31,11 +42,11 @@ import org.apache.qpid.framing.FieldTabl
 import org.apache.qpid.framing.FieldTableFactory;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.binding.Binding;
-import org.apache.qpid.server.binding.BindingFactory;
 import org.apache.qpid.server.message.AMQMessage;
 import org.apache.qpid.server.message.AMQMessageHeader;
 import org.apache.qpid.server.message.MessageMetaData;
 import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.BaseQueue;
@@ -44,23 +55,10 @@ import org.apache.qpid.server.queue.Mock
 import org.apache.qpid.server.queue.QueueEntry;
 import org.apache.qpid.server.queue.SimpleAMQQueue;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.DurableConfigurationStore;
-import org.apache.qpid.server.store.MemoryMessageStore;
 import org.apache.qpid.server.store.StoredMessage;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.util.InternalBrokerBaseCase;
 
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
-
 public class AbstractHeadersExchangeTestBase extends InternalBrokerBaseCase
 {
     private static final Logger _log = Logger.getLogger(AbstractHeadersExchangeTestBase.class);
@@ -68,24 +66,6 @@ public class AbstractHeadersExchangeTest
     private final HeadersExchange exchange = new HeadersExchange();
     protected final Set<TestQueue> queues = new HashSet<TestQueue>();
 
-
-
-    /**
-     * Not used in this test, just there to stub out the routing calls
-     */
-    private MemoryMessageStore _store = new MemoryMessageStore();
-
-
-    private BindingFactory bindingFactory = new BindingFactory(new DurableConfigurationStore.Source()
-                                                        {
-
-                                                            public DurableConfigurationStore getDurableConfigurationStore()
-                                                            {
-                                                                return _store;
-                                                            }
-                                                        },
-                                                        exchange);
-
     private int count;
 
     public void testDoNothing()
@@ -103,7 +83,6 @@ public class AbstractHeadersExchangeTest
     protected void unbind(TestQueue queue, String... bindings) throws AMQException
     {
         String queueName = queue.getName();
-        //TODO - check this
         exchange.onUnbind(new Binding(null,queueName, queue, exchange, getHeadersMap(bindings)));
     }
     
@@ -297,7 +276,7 @@ public class AbstractHeadersExchangeTest
 
         public TestQueue(AMQShortString name) throws AMQException
         {
-            super(name, false, new AMQShortString("test"), true, false,ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), Collections.EMPTY_MAP);
+            super(UUIDGenerator.generateUUID(), name, false, new AMQShortString("test"), true, false,ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), Collections.EMPTY_MAP);
             ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry().registerQueue(this);
         }
 
@@ -538,12 +517,6 @@ public class AbstractHeadersExchangeTest
             }
 
 
-            public AMQMessage getUnderlyingMessage()
-            {
-                return Message.this;
-            }
-
-
             public ContentHeaderBody getContentHeader()
             {
                 try

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java Wed May  2 13:09:18 2012
@@ -26,6 +26,7 @@ import org.apache.qpid.exchange.Exchange
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.management.common.mbeans.ManagedExchange;
 import org.apache.qpid.server.management.ManagedObject;
+import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.queue.QueueRegistry;
@@ -52,7 +53,7 @@ public class ExchangeMBeanTest  extends 
     public void testGeneralProperties() throws Exception
     {
         DirectExchange exchange = new DirectExchange();
-        exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 
@@ -67,7 +68,7 @@ public class ExchangeMBeanTest  extends 
     public void testDirectExchangeMBean() throws Exception
     {
         DirectExchange exchange = new DirectExchange();
-        exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 
@@ -82,7 +83,7 @@ public class ExchangeMBeanTest  extends 
     public void testTopicExchangeMBean() throws Exception
     {
         TopicExchange exchange = new TopicExchange();
-        exchange.initialise(_virtualHost,ExchangeDefaults.TOPIC_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost,ExchangeDefaults.TOPIC_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 
@@ -97,7 +98,7 @@ public class ExchangeMBeanTest  extends 
     public void testHeadersExchangeMBean() throws Exception
     {
         HeadersExchange exchange = new HeadersExchange();
-        exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 
@@ -119,7 +120,7 @@ public class ExchangeMBeanTest  extends 
     public void testHeadersExchangeMBeanMatchPropertyNoValue() throws Exception
     {
         HeadersExchange exchange = new HeadersExchange();
-        exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 
@@ -137,7 +138,7 @@ public class ExchangeMBeanTest  extends 
     public void testInvalidHeaderBindingMalformed() throws Exception
     {
         HeadersExchange exchange = new HeadersExchange();
-        exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
+        exchange.initialise(UUIDGenerator.generateUUID(), _virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
         ManagedObject managedObj = exchange.getManagedObject();
         ManagedExchange mbean = (ManagedExchange)managedObj;
 

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java Wed May  2 13:09:18 2012
@@ -29,12 +29,10 @@ public class MessageStoreMessagesTest ex
 {
     public void testMessageStoreCreated()
     {
-        String name = "DerbyMessageStore";
-
-        _logMessage = MessageStoreMessages.CREATED(name);
+        _logMessage = MessageStoreMessages.CREATED();
         List<Object> log = performLog();
 
-        String[] expected = {"Created :", name};
+        String[] expected = {"Created"};
 
         validateLogMessage(log, "MST-1001", expected);
     }
@@ -70,56 +68,4 @@ public class MessageStoreMessagesTest ex
 
         validateLogMessage(log, "MST-1004", expected);
     }
-/*
-    public void testMessageStoreRecoveryStart_withQueue()
-    {
-        String queueName = "testQueue";
-
-        _logMessage = MessageStoreMessages.RECOVERY_START(queueName, true);
-        List<Object> log = performLog();
-
-        String[] expected = {"Recovery Start :", queueName};
-
-        validateLogMessage(log, "MST-1004", expected);
-    }
-
-    public void testMessageStoreRecovered()
-    {
-        String queueName = "testQueue";
-        Integer messasgeCount = 2000;
-
-        _logMessage = MessageStoreMessages.MST_RECOVERED(messasgeCount, queueName);
-        List<Object> log = performLog();
-
-        // Here we use MessageFormat to ensure the messasgeCount of 2000 is
-        // reformated for display as '2,000'
-        String[] expected = {"Recovered ",
-                             MessageFormat.format("{0,number}", messasgeCount),
-                             "messages for queue", queueName};
-
-        validateLogMessage(log, "MST-1005", expected);
-    }
-
-    public void testMessageStoreRecoveryComplete()
-    {
-        _logMessage = MessageStoreMessages.MST_RECOVERY_COMPLETE(null,false);
-        List<Object> log = performLog();
-
-        String[] expected = {"Recovery Complete"};
-
-        validateLogMessage(log, "MST-1006", expected);
-    }
-
-    public void testMessageStoreRecoveryComplete_withQueue()
-    {
-        String queueName = "testQueue";
-
-        _logMessage = MessageStoreMessages.MST_RECOVERY_COMPLETE(queueName, true);
-        List<Object> log = performLog();
-
-        String[] expected = {"Recovery Complete :", queueName};
-
-        validateLogMessage(log, "MST-1006", expected);
-    }
-    */
 }

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Wed May  2 13:09:18 2012
@@ -37,13 +37,13 @@ public class MessageStoreLogSubjectTest 
         _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                 getVirtualHost("test");
 
-        _subject = new MessageStoreLogSubject(_testVhost, _testVhost.getMessageStore());
+        _subject = new MessageStoreLogSubject(_testVhost, _testVhost.getMessageStore().getClass().getSimpleName());
     }
 
     /**
      * Validate that the logged Subject  message is as expected:
      * MESSAGE [Blank][vh(/test)/ms(MemoryMessageStore)] <Log Message>
-     * @param message the message whos format needs validation
+     * @param message the message who's format needs validation
      */
     @Override
     protected void validateLogStatement(String message)

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Wed May  2 13:09:18 2012
@@ -30,7 +30,7 @@ import org.apache.qpid.server.queue.AMQQ
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStore;
 import org.apache.qpid.server.util.InternalBrokerBaseCase;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
@@ -45,7 +45,7 @@ public class AMQProtocolSessionMBeanTest
     /** Used for debugging. */
     private static final Logger log = Logger.getLogger(AMQProtocolSessionMBeanTest.class);
 
-    private MessageStore _messageStore = new SkeletonMessageStore();
+    private MessageStore _messageStore = new TestableMemoryMessageStore();
     private AMQProtocolEngine _protocolSession;
     private AMQChannel _channel;
     private AMQProtocolSessionMBean _mbean;

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java Wed May  2 13:09:18 2012
@@ -34,6 +34,7 @@ import org.apache.qpid.server.registry.A
 import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
 import org.apache.qpid.server.subscription.ClientDeliveryMethod;
 import org.apache.qpid.server.subscription.Subscription;
+import org.apache.qpid.server.subscription.SubscriptionImpl;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.transport.TestNetworkConnection;
 
@@ -239,12 +240,12 @@ public class InternalTestProtocolSession
                     _channelDelivers.put(_channelId, consumers);
                 }
 
-                LinkedList<DeliveryPair> consumerDelivers = consumers.get(sub.getConsumerTag());
+                LinkedList<DeliveryPair> consumerDelivers = consumers.get(((SubscriptionImpl)sub).getConsumerTag());
 
                 if (consumerDelivers == null)
                 {
                     consumerDelivers = new LinkedList<DeliveryPair>();
-                    consumers.put(sub.getConsumerTag(), consumerDelivers);
+                    consumers.put(((SubscriptionImpl)sub).getConsumerTag(), consumerDelivers);
                 }
 
                 consumerDelivers.add(new DeliveryPair(deliveryTag, (AMQMessage)entry.getMessage()));

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java Wed May  2 13:09:18 2012
@@ -35,6 +35,7 @@ import java.util.Set;
 
 public class MultiVersionProtocolEngineFactoryTest extends QpidTestCase
 {
+
     protected void setUp() throws Exception
     {
         super.setUp();
@@ -93,7 +94,20 @@ public class MultiVersionProtocolEngineF
                      (byte) 0,
                      (byte) 10
         };
-    
+
+
+    private static final byte[] AMQP_1_0_0_HEADER =
+            new byte[] {
+                    (byte)'A',
+                    (byte)'M',
+                    (byte)'Q',
+                    (byte)'P',
+                    (byte) 0,
+                    (byte) 1,
+                    (byte) 0,
+                    (byte) 0
+            };
+
     private byte[] getAmqpHeader(final AmqpProtocolVersion version)
     {
         switch(version)
@@ -106,6 +120,8 @@ public class MultiVersionProtocolEngineF
                 return AMQP_0_9_1_HEADER;
             case v0_10:
                 return AMQP_0_10_HEADER;
+            case v1_0_0:
+                return AMQP_1_0_0_HEADER;
             default:
                 fail("unknown AMQP version, appropriate header must be added for new protocol version");
                 return null;

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java Wed May  2 13:09:18 2012
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.queue;
 
+import java.util.UUID;
+
 import org.apache.commons.configuration.XMLConfiguration;
 
 import org.apache.qpid.AMQException;
@@ -35,6 +37,7 @@ import org.apache.qpid.server.logging.ac
 import org.apache.qpid.server.logging.actors.TestLogActor;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStoreFactory;
 import org.apache.qpid.server.util.TestApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.test.utils.QpidTestCase;
@@ -53,7 +56,7 @@ public class AMQQueueFactoryTest extends
 
         XMLConfiguration configXml = new XMLConfiguration();
         configXml.addProperty("virtualhosts.virtualhost(-1).name", getName());
-        configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.class", TestableMemoryMessageStore.class.getName());
+        configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.factoryclass", TestableMemoryMessageStoreFactory.class.getName());
 
         ServerConfiguration configuration = new ServerConfiguration(configXml);
 

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java Wed May  2 13:09:18 2012
@@ -20,7 +20,6 @@
  */
 package org.apache.qpid.server.queue;
 
-import org.apache.log4j.Logger;
 
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
@@ -37,7 +36,7 @@ import org.apache.qpid.server.protocol.A
 import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.store.TestMemoryMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStore;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
@@ -53,13 +52,11 @@ import java.util.Set;
  */
 public class AckTest extends InternalBrokerBaseCase
 {
-    private static final Logger _log = Logger.getLogger(AckTest.class);
-
     private Subscription _subscription;
 
     private AMQProtocolSession _protocolSession;
 
-    private TestMemoryMessageStore _messageStore;
+    private TestableMemoryMessageStore _messageStore;
 
     private AMQChannel _channel;
 
@@ -73,7 +70,7 @@ public class AckTest extends InternalBro
     {
         super.setUp();
         _virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
-        _messageStore = new TestMemoryMessageStore();
+        _messageStore = new TestableMemoryMessageStore();
         _protocolSession = new InternalTestProtocolSession(_virtualHost);
         _channel = new AMQChannel(_protocolSession,5, _messageStore /*dont need exchange registry*/);
 
@@ -180,7 +177,7 @@ public class AckTest extends InternalBro
         }
         catch (InterruptedException e)
         {
-            e.printStackTrace();  //TODO.
+            Thread.currentThread().interrupt();
         }
 
     }

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockStoredMessage.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockStoredMessage.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockStoredMessage.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockStoredMessage.java Wed May  2 13:09:18 2012
@@ -25,7 +25,7 @@ import org.apache.qpid.framing.ContentHe
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.message.MessageMetaData;
-import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.StoredMessage;
 
 import java.nio.ByteBuffer;
@@ -105,9 +105,9 @@ public class MockStoredMessage implement
         return  buf;
     }
 
-    public MessageStore.StoreFuture flushToStore()
+    public StoreFuture flushToStore()
     {
-        return MessageStore.IMMEDIATE_FUTURE;
+        return StoreFuture.IMMEDIATE_FUTURE;
     }
 
     public void remove()

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java Wed May  2 13:09:18 2012
@@ -37,11 +37,13 @@ import org.apache.qpid.server.exchange.D
 import org.apache.qpid.server.message.AMQMessage;
 import org.apache.qpid.server.message.MessageMetaData;
 import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.queue.BaseQueue.PostEnqueueAction;
 import org.apache.qpid.server.queue.SimpleAMQQueue.QueueEntryFilter;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.StoredMessage;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStoreFactory;
 import org.apache.qpid.server.subscription.MockSubscription;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
@@ -61,7 +63,6 @@ public class SimpleAMQQueueTest extends 
 
     protected SimpleAMQQueue _queue;
     protected VirtualHost _virtualHost;
-    protected TestableMemoryMessageStore _store = new TestableMemoryMessageStore();
     protected AMQShortString _qname = new AMQShortString("qname");
     protected AMQShortString _owner = new AMQShortString("owner");
     protected AMQShortString _routingKey = new AMQShortString("routing key");
@@ -106,7 +107,9 @@ public class SimpleAMQQueueTest extends 
         ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance();
 
         PropertiesConfiguration env = new PropertiesConfiguration();
-        _virtualHost = new VirtualHostImpl(ApplicationRegistry.getInstance(), new VirtualHostConfiguration(getClass().getName(), env), _store);
+        final VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(getClass().getName(), env);
+        vhostConfig.setMessageStoreFactoryClass(TestableMemoryMessageStoreFactory.class.getName());
+        _virtualHost = new VirtualHostImpl(ApplicationRegistry.getInstance(), vhostConfig);
         applicationRegistry.getVirtualHostRegistry().registerVirtualHost(_virtualHost);
 
         _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(_qname, false, _owner, false, false, _virtualHost, _arguments);
@@ -135,7 +138,7 @@ public class SimpleAMQQueueTest extends 
         }
 
         try {
-            _queue = new SimpleAMQQueue(_qname, false, _owner, false, false,null, Collections.EMPTY_MAP);
+            _queue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), _qname, false, _owner, false,false, null, Collections.EMPTY_MAP);
             assertNull("Queue was created", _queue);
         }
         catch (IllegalArgumentException e)
@@ -477,7 +480,7 @@ public class SimpleAMQQueueTest extends 
     public void testAutoDeleteQueue() throws Exception
     {
        _queue.stop();
-       _queue = new SimpleAMQQueue(_qname, false, null, true, false, _virtualHost, Collections.EMPTY_MAP);
+       _queue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), _qname, false, null, true, false, _virtualHost, Collections.EMPTY_MAP);
        _queue.setDeleteOnNoConsumers(true);
        _queue.registerSubscription(_subscription, false);
        AMQMessage message = createMessage(new Long(25));
@@ -634,11 +637,12 @@ public class SimpleAMQQueueTest extends 
 
         qs.add(_queue);
         MessageMetaData metaData = msg.headersReceived(System.currentTimeMillis());
-        StoredMessage handle = _store.addMessage(metaData);
+        TestableMemoryMessageStore store = (TestableMemoryMessageStore) _virtualHost.getMessageStore();
+        StoredMessage handle = store.addMessage(metaData);
         msg.setStoredMessage(handle);
 
 
-        ServerTransaction txn = new AutoCommitTransaction(_store);
+        ServerTransaction txn = new AutoCommitTransaction(store);
 
         txn.enqueue(qs, msg, new ServerTransaction.Action()
                                     {
@@ -653,7 +657,7 @@ public class SimpleAMQQueueTest extends 
                                     }, 0L);
 
         // Check that it is enqueued
-        AMQQueue data = _store.getMessages().get(1L);
+        AMQQueue data = store.getMessages().get(1L);
         assertNull(data);
 
         // Dequeue message
@@ -664,7 +668,7 @@ public class SimpleAMQQueueTest extends 
         _queue.dequeue(entry,null);
 
         // Check that it is dequeued
-        data = _store.getMessages().get(1L);
+        data = store.getMessages().get(1L);
         assertNull(data);
     }
 
@@ -688,8 +692,8 @@ public class SimpleAMQQueueTest extends 
     public void testProcessQueueWithUniqueSelectors() throws Exception
     {
         TestSimpleQueueEntryListFactory factory = new TestSimpleQueueEntryListFactory();
-        SimpleAMQQueue testQueue = new SimpleAMQQueue("testQueue", false, "testOwner",false,
-                                                      false, _virtualHost, factory, null)
+        SimpleAMQQueue testQueue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), "testQueue", false,"testOwner",
+                                                      false, false, _virtualHost, factory, null)
         {
             @Override
             public void deliverAsync(Subscription sub)
@@ -1025,8 +1029,8 @@ public class SimpleAMQQueueTest extends 
         int dequeueMessageIndex = 1;
 
         // create queue with overridden method deliverAsync
-        SimpleAMQQueue testQueue = new SimpleAMQQueue(new AMQShortString("test"), false,
-                new AMQShortString("testOwner"), false, false, _virtualHost, null)
+        SimpleAMQQueue testQueue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), new AMQShortString("test"),
+                false, new AMQShortString("testOwner"), false, false, _virtualHost, null)
         {
             @Override
             public void deliverAsync(Subscription sub)
@@ -1096,8 +1100,8 @@ public class SimpleAMQQueueTest extends 
     public void testEqueueDequeuedEntry()
     {
         // create a queue where each even entry is considered a dequeued
-        SimpleAMQQueue queue = new SimpleAMQQueue(new AMQShortString("test"), false, new AMQShortString("testOwner"),
-                false, false, _virtualHost, new QueueEntryListFactory()
+        SimpleAMQQueue queue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), new AMQShortString("test"), false,
+                new AMQShortString("testOwner"), false, false, _virtualHost, new QueueEntryListFactory()
                 {
                     public QueueEntryList createQueueEntryList(AMQQueue queue)
                     {
@@ -1174,8 +1178,8 @@ public class SimpleAMQQueueTest extends 
 
     public void testActiveConsumerCount() throws Exception
     {
-        final SimpleAMQQueue queue = new SimpleAMQQueue(new AMQShortString("testActiveConsumerCount"), false, new AMQShortString("testOwner"),
-                false, false, _virtualHost, new SimpleQueueEntryList.Factory(), null);
+        final SimpleAMQQueue queue = new SimpleAMQQueue(UUIDGenerator.generateUUID(), new AMQShortString("testActiveConsumerCount"), false,
+                new AMQShortString("testOwner"), false, false, _virtualHost, new SimpleQueueEntryList.Factory(), null);
 
         //verify adding an active subscription increases the count
         final MockSubscription subscription1 = new MockSubscription();

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleQueueEntryImplTest.java Wed May  2 13:09:18 2012
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.server.queue;
 
 import org.apache.qpid.AMQException;

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java Wed May  2 13:09:18 2012
@@ -22,13 +22,19 @@ package org.apache.qpid.server.security.
 
 import junit.framework.TestCase;
 
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.configuration.plugins.ConfigurationPlugin;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.util.TestApplicationRegistry;
 
 import javax.management.remote.JMXPrincipal;
 import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 import java.util.Collections;
@@ -47,7 +53,7 @@ public class RMIPasswordAuthenticatorTes
     protected void setUp() throws Exception
     {
         _rmipa = new RMIPasswordAuthenticator();
-        
+
         _credentials = new String[] {USERNAME, PASSWORD};
     }
 
@@ -114,8 +120,19 @@ public class RMIPasswordAuthenticatorTes
     /**
      * Tests case where authentication manager is not set.
      */
-    public void testNullAuthenticationManager()
+    public void testNullAuthenticationManager() throws Exception
     {
+        ServerConfiguration serverConfig = new ServerConfiguration(new XMLConfiguration());
+        TestApplicationRegistry reg = new TestApplicationRegistry(serverConfig)
+        {
+            @Override
+            protected AuthenticationManager createAuthenticationManager() throws ConfigurationException
+            {
+                return null;
+            }
+        };
+        ApplicationRegistry.initialise(reg);
+
         try
         {
             _rmipa.authenticate(_credentials);
@@ -126,6 +143,10 @@ public class RMIPasswordAuthenticatorTes
             assertEquals("Unexpected exception message",
                     RMIPasswordAuthenticator.UNABLE_TO_LOOKUP, se.getMessage());
         }
+        finally
+        {
+            ApplicationRegistry.remove();
+        }
     }
 
     /**
@@ -254,6 +275,11 @@ public class RMIPasswordAuthenticatorTes
                     return new AuthenticationResult(AuthenticationStatus.CONTINUE);
                 }
             }
+
+            public CallbackHandler getHandler(String mechanism)
+            {
+                return null;
+            }
         };
     }
 }

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java Wed May  2 13:09:18 2012
@@ -39,6 +39,7 @@ import org.apache.qpid.server.exchange.E
 import org.apache.qpid.server.exchange.TopicExchange;
 import org.apache.qpid.server.message.AMQMessage;
 import org.apache.qpid.server.message.MessageMetaData;
+import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.queue.AMQPriorityQueue;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
@@ -58,6 +59,7 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * This tests the MessageStores by using the available interfaces.
@@ -101,7 +103,7 @@ public class MessageStoreTest extends In
         String storePath = System.getProperty("QPID_WORK") + "/" + getName();
         
         _config = new PropertiesConfiguration();
-        _config.addProperty("store.class", getTestProfileMessageStoreClassName());
+        _config.addProperty("store.factoryclass", getTestProfileMessageStoreFactoryClassName());
         _config.addProperty("store.environment-path", storePath);
 
         cleanup(new File(storePath));
@@ -298,7 +300,7 @@ public class MessageStoreTest extends In
                 1,  queueRegistry.getQueues().size());
         
         //test that removing the queue means it is not recovered next time
-        getVirtualHost().getDurableConfigurationStore().removeQueue(queueRegistry.getQueue(durableQueueName));
+        getVirtualHost().getMessageStore().removeQueue(queueRegistry.getQueue(durableQueueName));
 
         reloadVirtualHost();
         
@@ -351,7 +353,7 @@ public class MessageStoreTest extends In
                 origExchangeCount + 1,  exchangeRegistry.getExchangeNames().size());
         
         //test that removing the exchange means it is not recovered next time
-        getVirtualHost().getDurableConfigurationStore().removeExchange(exchangeRegistry.getExchange(directExchangeName));
+        getVirtualHost().getMessageStore().removeExchange(exchangeRegistry.getExchange(directExchangeName));
 
         reloadVirtualHost();
         
@@ -707,7 +709,7 @@ public class MessageStoreTest extends In
 
             if (queue.isDurable() && !queue.isAutoDelete())
             {
-                getVirtualHost().getDurableConfigurationStore().createQueue(queue, queueArguments);
+                getVirtualHost().getMessageStore().createQueue(queue, queueArguments);
             }
         }
         catch (AMQException e)
@@ -739,7 +741,7 @@ public class MessageStoreTest extends In
 
         try
         {
-            exchange = type.newInstance(getVirtualHost(), name, durable, 0, false);
+            exchange = type.newInstance(UUIDGenerator.generateUUID(), getVirtualHost(), name, durable, 0, false);
         }
         catch (AMQException e)
         {
@@ -751,7 +753,7 @@ public class MessageStoreTest extends In
             getVirtualHost().getExchangeRegistry().registerExchange(exchange);
             if (durable)
             {
-                getVirtualHost().getDurableConfigurationStore().createExchange(exchange);
+                getVirtualHost().getMessageStore().createExchange(exchange);
             }
         }
         catch (AMQException e)

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/ReferenceCountingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/ReferenceCountingTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/ReferenceCountingTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/ReferenceCountingTest.java Wed May  2 13:09:18 2012
@@ -34,12 +34,12 @@ import org.apache.qpid.test.utils.QpidTe
  */
 public class ReferenceCountingTest extends QpidTestCase
 {
-    private TestMemoryMessageStore _store;
+    private TestableMemoryMessageStore _store;
 
 
     protected void setUp() throws Exception
     {
-        _store = new TestMemoryMessageStore();
+        _store = new TestableMemoryMessageStore();
     }
 
     /**

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java Wed May  2 13:09:18 2012
@@ -26,6 +26,7 @@ import org.apache.qpid.server.queue.AMQQ
 
 import java.nio.ByteBuffer;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
@@ -33,26 +34,8 @@ import java.util.concurrent.atomic.Atomi
  */
 public class TestableMemoryMessageStore extends MemoryMessageStore
 {
-
-    private MemoryMessageStore _mms = null;
-    private HashMap<Long, AMQQueue> _messages = new HashMap<Long, AMQQueue>();
-    private AtomicInteger _messageCount = new AtomicInteger(0);
-
-    public TestableMemoryMessageStore(MemoryMessageStore mms)
-    {
-        _mms = mms;
-    }
-
-    public TestableMemoryMessageStore()
-    {
-
-    }
-
-    @Override
-    public void close() throws Exception
-    {
-        // Not required to do anything
-    }
+    private final Map<Long, AMQQueue> _messages = new HashMap<Long, AMQQueue>();
+    private final AtomicInteger _messageCount = new AtomicInteger(0);
 
     @Override
     public StoredMessage addMessage(StorableMessageMetaData metaData)
@@ -65,36 +48,34 @@ public class TestableMemoryMessageStore 
         return _messageCount.get();
     }
 
+    public Map<Long, AMQQueue> getMessages()
+    {
+        return _messages;
+    }
+
     private class TestableTransaction implements Transaction
     {
+        @Override
         public void enqueueMessage(TransactionLogResource queue, EnqueableMessage message) throws AMQStoreException
         {
             getMessages().put(message.getMessageNumber(), (AMQQueue)queue);
         }
 
+        @Override
         public void dequeueMessage(TransactionLogResource queue, EnqueableMessage message) throws AMQStoreException
         {
             getMessages().remove(message.getMessageNumber());
         }
 
+        @Override
         public void commitTran() throws AMQStoreException
         {
         }
 
+        @Override
         public StoreFuture commitTranAsync() throws AMQStoreException
         {
-            return new StoreFuture()
-                    {
-                        public boolean isComplete()
-                        {
-                            return true;
-                        }
-
-                        public void waitForCompletion()
-                        {
-
-                        }
-                    };
+            return StoreFuture.IMMEDIATE_FUTURE;
         }
 
         public void abortTran() throws AMQStoreException
@@ -117,10 +98,6 @@ public class TestableMemoryMessageStore 
         return new TestableTransaction();
     }
 
-    public HashMap<Long, AMQQueue> getMessages()
-    {
-        return _messages;
-    }
 
     private class TestableStoredMessage implements StoredMessage
     {

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java Wed May  2 13:09:18 2012
@@ -277,6 +277,10 @@ public class MockSubscription implements
         return false;
     }
 
+    public void queueEmpty() throws AMQException
+    {
+    }
+
     public void setActive(final boolean isActive)
     {
         _isActive = isActive;

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/txn/MockStoreTransaction.java Wed May  2 13:09:18 2012
@@ -20,19 +20,13 @@
  */
 package org.apache.qpid.server.txn;
 
-import org.apache.commons.configuration.Configuration;
 import org.apache.commons.lang.NotImplementedException;
-
 import org.apache.qpid.AMQStoreException;
-import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.message.EnqueableMessage;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.MessageStore.StoreFuture;
-import org.apache.qpid.server.store.MessageStore.Transaction;
-import org.apache.qpid.server.store.MessageStoreRecoveryHandler;
-import org.apache.qpid.server.store.StorableMessageMetaData;
-import org.apache.qpid.server.store.StoredMessage;
-import org.apache.qpid.server.store.TransactionLogRecoveryHandler;
+import org.apache.qpid.server.store.NullMessageStore;
+import org.apache.qpid.server.store.StoreFuture;
+import org.apache.qpid.server.store.Transaction;
 import org.apache.qpid.server.store.TransactionLogResource;
 
 /**
@@ -122,42 +116,14 @@ class MockStoreTransaction implements Tr
 
     public static MessageStore createTestTransactionLog(final MockStoreTransaction storeTransaction)
     {
-        return new MessageStore()
+        return new NullMessageStore()
         {
-            public void configureMessageStore(final String name,
-                                              final MessageStoreRecoveryHandler recoveryHandler,
-                                              final Configuration config,
-                                              final LogSubject logSubject) throws Exception
-            {
-                //TODO.
-            }
-
-            public void close() throws Exception
-            {
-                //TODO.
-            }
-
-            public <T extends StorableMessageMetaData> StoredMessage<T> addMessage(final T metaData)
-            {
-                return null;  //TODO.
-            }
-
-            public boolean isPersistent()
-            {
-                return false;  //TODO.
-            }
-
-            public void configureTransactionLog(String name, TransactionLogRecoveryHandler recoveryHandler,
-                    Configuration storeConfiguration, LogSubject logSubject) throws Exception
-            {
-            }
-
+            @Override
             public Transaction newTransaction()
             {
                 storeTransaction.setState(TransactionState.STARTED);
                 return storeTransaction;
             }
-            
-        };
+       };
     }
 }
\ No newline at end of file

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java Wed May  2 13:09:18 2012
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.util;
 
+import java.util.UUID;
+
 import org.apache.commons.configuration.XMLConfiguration;
 
 import org.apache.qpid.AMQException;
@@ -43,6 +45,7 @@ import org.apache.qpid.server.registry.A
 import org.apache.qpid.server.registry.IApplicationRegistry;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.TestableMemoryMessageStoreFactory;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.test.utils.QpidTestCase;
 
@@ -65,10 +68,10 @@ public class InternalBrokerBaseCase exte
         super.setUp();
 
         _configXml.addProperty("virtualhosts.virtualhost.name", "test");
-        _configXml.addProperty("virtualhosts.virtualhost.test.store.class", TestableMemoryMessageStore.class.getName());
+        _configXml.addProperty("virtualhosts.virtualhost.test.store.factoryclass", TestableMemoryMessageStoreFactory.class.getName());
 
         _configXml.addProperty("virtualhosts.virtualhost(-1).name", getName());
-        _configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.class", TestableMemoryMessageStore.class.getName());
+        _configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.factoryclass", TestableMemoryMessageStoreFactory.class.getName());
 
         createBroker();
     }

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java Wed May  2 13:09:18 2012
@@ -33,12 +33,12 @@ import org.apache.qpid.server.exchange.E
 import org.apache.qpid.server.exchange.ExchangeRegistry;
 import org.apache.qpid.server.federation.BrokerLink;
 import org.apache.qpid.server.management.ManagedObject;
+import org.apache.qpid.server.protocol.v1_0.LinkRegistry;
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.registry.IApplicationRegistry;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
 import org.apache.qpid.server.stats.StatisticsCounter;
-import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.txn.DtxRegistry;
 
@@ -111,11 +111,6 @@ public class MockVirtualHost implements 
         return null;
     }
 
-    public DurableConfigurationStore getDurableConfigurationStore()
-    {
-        return null;
-    }
-
     public ExchangeFactory getExchangeFactory()
     {
         return null;
@@ -177,6 +172,11 @@ public class MockVirtualHost implements 
 
     }
 
+    public LinkRegistry getLinkRegistry(String remoteContainerId)
+    {
+        return null;
+    }
+
     public ScheduledFuture<?> scheduleTask(long delay, Runnable timeoutTask)
     {
         return null;
@@ -281,4 +281,10 @@ public class MockVirtualHost implements 
     {
 
     }
+
+    @Override
+    public State getState()
+    {
+        return State.ACTIVE;
+    }
 }
\ No newline at end of file

Modified: qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostImplTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostImplTest.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostImplTest.java (original)
+++ qpid/branches/qpid-3767/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostImplTest.java Wed May  2 13:09:18 2012
@@ -27,7 +27,7 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
+import org.apache.qpid.server.store.MemoryMessageStoreFactory;
 import org.apache.qpid.server.util.TestApplicationRegistry;
 import org.apache.qpid.test.utils.QpidTestCase;
 
@@ -68,31 +68,6 @@ public class VirtualHostImplTest extends
         customBindingTestImpl(new String[0]);
     }
 
-    private void customBindingTestImpl(final String[] routingKeys) throws Exception
-    {
-        String exchangeName = getName() +".direct";
-        String vhostName = getName();
-        String queueName = getName();
-
-        File config = writeConfigFile(vhostName, queueName, exchangeName, false, routingKeys);
-        VirtualHost vhost = createVirtualHost(vhostName, config);
-        assertNotNull("virtualhost should exist", vhost);
-
-        AMQQueue queue = vhost.getQueueRegistry().getQueue(queueName);
-        assertNotNull("queue should exist", queue);
-
-        Exchange defaultExch = vhost.getExchangeRegistry().getDefaultExchange();
-        assertTrue("queue should have been bound to default exchange with its name", defaultExch.isBound(queueName, queue));
-
-        Exchange exch = vhost.getExchangeRegistry().getExchange(exchangeName);
-        assertTrue("queue should have been bound to " + exchangeName + " with its name", exch.isBound(queueName, queue));
-
-        for(String key: routingKeys)
-        {
-            assertTrue("queue should have been bound to " + exchangeName + " with key " + key, exch.isBound(key, queue));
-        }
-    }
-
     /**
      * Tests that specifying custom routing keys for a queue in the configuration file results in failure
      * to create the vhost (since this is illegal, only queue names are used with the default exchange)
@@ -106,12 +81,32 @@ public class VirtualHostImplTest extends
             createVirtualHost(getName(), config);
             fail("virtualhost creation should have failed due to illegal configuration");
         }
-        catch (ConfigurationException e)
+        catch (RuntimeException e)
         {
+            assertEquals(ConfigurationException.class, e.getCause().getClass());
             //expected
         }
     }
 
+    public void testVirtualHostBecomesActive() throws Exception
+    {
+        File config = writeConfigFile(getName(), getName(), getName() +".direct", false, new String[0]);
+        VirtualHost vhost = createVirtualHost(getName(), config);
+        assertNotNull(vhost);
+        assertEquals(State.ACTIVE, vhost.getState());
+    }
+
+    public void testVirtualHostBecomesStoppedOnClose() throws Exception
+    {
+        File config = writeConfigFile(getName(), getName(), getName() +".direct", false, new String[0]);
+        VirtualHost vhost = createVirtualHost(getName(), config);
+        assertNotNull(vhost);
+        assertEquals(State.ACTIVE, vhost.getState());
+        vhost.close();
+        assertEquals(State.STOPPED, vhost.getState());
+        assertEquals(0, vhost.getHouseKeepingActiveCount());
+    }
+
     /**
      * Tests that specifying an unknown exchange to bind the queue to results in failure to create the vhost
      */
@@ -124,12 +119,39 @@ public class VirtualHostImplTest extends
             createVirtualHost(getName(), config);
             fail("virtualhost creation should have failed due to illegal configuration");
         }
-        catch (ConfigurationException e)
+        catch (RuntimeException e)
         {
+            assertEquals(ConfigurationException.class, e.getCause().getClass());
             //expected
         }
     }
 
+    private void customBindingTestImpl(final String[] routingKeys) throws Exception
+    {
+        String exchangeName = getName() +".direct";
+        String vhostName = getName();
+        String queueName = getName();
+
+        File config = writeConfigFile(vhostName, queueName, exchangeName, false, routingKeys);
+        VirtualHost vhost = createVirtualHost(vhostName, config);
+        assertNotNull("virtualhost should exist", vhost);
+
+        AMQQueue queue = vhost.getQueueRegistry().getQueue(queueName);
+        assertNotNull("queue should exist", queue);
+
+        Exchange defaultExch = vhost.getExchangeRegistry().getDefaultExchange();
+        assertTrue("queue should have been bound to default exchange with its name", defaultExch.isBound(queueName, queue));
+
+        Exchange exch = vhost.getExchangeRegistry().getExchange(exchangeName);
+        assertTrue("queue should have been bound to " + exchangeName + " with its name", exch.isBound(queueName, queue));
+
+        for(String key: routingKeys)
+        {
+            assertTrue("queue should have been bound to " + exchangeName + " with key " + key, exch.isBound(key, queue));
+        }
+    }
+
+
     private VirtualHost createVirtualHost(String vhostName, File config) throws Exception
     {
         _configuration = new ServerConfiguration(new XMLConfiguration(config));
@@ -167,11 +189,11 @@ public class VirtualHostImplTest extends
             writer.write("<virtualhosts>");
             writer.write("  <default>" + vhostName + "</default>");
             writer.write("  <virtualhost>");
-            writer.write("      <store>");
-            writer.write("          <class>" + TestableMemoryMessageStore.class.getName() + "</class>");
-            writer.write("      </store>");
             writer.write("      <name>" + vhostName + "</name>");
             writer.write("      <" + vhostName + ">");
+            writer.write("              <store>");
+            writer.write("                <factoryclass>" + MemoryMessageStoreFactory.class.getName() + "</factoryclass>");
+            writer.write("              </store>");
             if(exchangeName != null && !dontDeclare)
             {
                 writer.write("          <exchanges>");

Modified: qpid/branches/qpid-3767/qpid/java/build.deps
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/build.deps?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/build.deps (original)
+++ qpid/branches/qpid-3767/qpid/java/build.deps Wed May  2 13:09:18 2012
@@ -37,6 +37,8 @@ geronimo-openejb=lib/geronimo-ejb_3.0_sp
 junit=lib/junit-3.8.1.jar
 mockito-all=lib/mockito-all-1.9.0.jar
 
+gson-all=lib/gson-2.0.jar
+
 log4j=lib/log4j-1.2.12.jar
 
 slf4j-api=lib/slf4j-api-1.6.1.jar
@@ -48,19 +50,27 @@ felix-main=lib/org.apache.felix.main-2.0
 
 felix.libs=${felix-main}
 
+jackson-core=lib/jackson-core-asl-1.9.0.jar
+jackson-mapper=lib/jackson-mapper-asl-1.9.0.jar
+
 commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \
   ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration}
 
 common.libs=${slf4j-api}
 client.libs=${geronimo-jms}
+amqp-1-0-common.libs=
+amqp-1-0-client.libs=${commons-cli}
+amqp-1-0-client-jms.libs=${geronimo-jms}
 tools.libs=${commons-configuration.libs} ${log4j}
 broker.libs=${commons-cli} ${commons-logging} ${log4j} ${slf4j-log4j} \
-    ${xalan} ${felix.libs} ${derby-db} ${commons-configuration.libs}
+    ${xalan} ${felix.libs} ${derby-db} ${commons-configuration.libs} \
+    ${jackson-core} ${jackson-mapper}
 
 broker-plugins.libs=${felix.libs} ${log4j} ${commons-configuration.libs}
 
-junit-toolkit.libs=${log4j} ${junit} ${slf4j-api} ${mockito-all}
-test.libs=${slf4j-log4j} ${junit-toolkit.libs}
+test.libs=${slf4j-log4j} ${log4j} ${junit} ${slf4j-api} ${mockito-all}
+
+perftests.libs=${geronimo-jms} ${slf4j-api} ${commons-collections} ${commons-beanutils-core} ${commons-lang} ${gson-all}
 
 ibm-icu=lib/com.ibm.icu_3.8.1.v20080530.jar
 ecl-core-jface=lib/org.eclipse.jface_3.4.1.M20080827-2000.jar
@@ -127,6 +137,7 @@ client-example.test.libs=${test.libs}
 tools.test.libs=
 testkit.test.libs=${test.libs}
 systests.libs=${test.libs}
+perftests.test.libs=${test.libs}
 
 broker-plugins.test.libs=${test.libs} 
 
@@ -146,3 +157,9 @@ bdb-je=lib/bdbstore/je-5.0.34.jar
 bdbstore.libs=${bdb-je}
 bdbstore.test.libs=${test.libs}
 
+# optional perftests-visualisation-jfc module deps
+jfreechart.jar=lib/jfree/jfreechart-1.0.13.jar
+jfreecommon.jar=lib/jfree/jfreecommon-1.0.16.jar
+csvjdbc.jar=lib/csvjdbc/csvjdbc-1.0.8.jar
+perftests-visualisation-jfc.libs=${jfreechart.jar} ${jfreecommon.jar} ${csvjdbc.jar}
+perftests-visualisation-jfc.test.libs=${test.libs}

Modified: qpid/branches/qpid-3767/qpid/java/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/build.xml?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/build.xml (original)
+++ qpid/branches/qpid-3767/qpid/java/build.xml Wed May  2 13:09:18 2012
@@ -26,9 +26,9 @@
   <findSubProjects name="client-plugins" dir="client-plugins"/>
   <findSubProjects name="management" dir="management" excludes="common,example"/>
 
-  <property name="modules.core"       value="junit-toolkit common management/common broker client tools"/>
+  <property name="modules.core"       value="common management/common amqp-1-0-common broker client amqp-1-0-client amqp-1-0-client-jms tools"/>
   <property name="modules.examples"   value="client/example management/example"/>
-  <property name="modules.tests"      value="systests perftests integrationtests"/>
+  <property name="modules.tests"      value="systests perftests"/>
   <property name="modules.management" value="${management}"/>
   <property name="modules.plugin"     value="${broker-plugins} ${client-plugins}"/>
   <property name="modules.opt"        value=""/>

Modified: qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Wed May  2 13:09:18 2012
@@ -3212,28 +3212,15 @@ public abstract class AMQSession<C exten
 
         public void rejectPending(C consumer)
         {
-            synchronized (_lock)
-            {
-                boolean stopped = connectionStopped();
+            // Reject messages on pre-receive queue
+            consumer.rollbackPendingMessages();
 
-                if (!stopped)
-                {
-                    setConnectionStopped(true);
-                }
+            // Reject messages on pre-dispatch queue
+            rejectMessagesForConsumerTag(consumer.getConsumerTag(), true, false);
 
-                // Reject messages on pre-receive queue
-                consumer.rollbackPendingMessages();
+            // closeConsumer
+            consumer.markClosed();
 
-                // Reject messages on pre-dispatch queue
-                rejectMessagesForConsumerTag(consumer.getConsumerTag(), true, false);
-                //Let the dispatcher deal with this when it gets to them.
-
-                // closeConsumer
-                consumer.markClosed();
-
-                setConnectionStopped(stopped);
-
-            }
         }
 
         public void rollback()
@@ -3425,7 +3412,7 @@ public abstract class AMQSession<C exten
         {
             final C consumer = _consumers.get(message.getConsumerTag());
 
-            if ((consumer == null) || consumer.isClosed())
+            if ((consumer == null) || consumer.isClosed() || consumer.isClosing())
             {
                 if (_dispatcherLogger.isInfoEnabled())
                 {

Modified: qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java (original)
+++ qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java Wed May  2 13:09:18 2012
@@ -593,7 +593,10 @@ public abstract class BasicMessageConsum
                         // no point otherwise as the connection will be gone
                         if (!_session.isClosed() || _session.isClosing())
                         {
-                            sendCancel();
+                            synchronized(_session.getMessageDeliveryLock())
+                            {
+                                sendCancel();
+                            }
                             cleanupQueue();
                         }
                     }

Modified: qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java (original)
+++ qpid/branches/qpid-3767/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java Wed May  2 13:09:18 2012
@@ -6,7 +6,7 @@
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE 2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an

Modified: qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/codec/MarkableDataInput.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/codec/MarkableDataInput.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/codec/MarkableDataInput.java (original)
+++ qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/codec/MarkableDataInput.java Wed May  2 13:09:18 2012
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.codec;
 
 import org.apache.qpid.framing.AMQShortString;

Modified: qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java (original)
+++ qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java Wed May  2 13:09:18 2012
@@ -858,4 +858,9 @@ public final class AMQShortString implem
         }
     }
 
+    public static String toString(AMQShortString amqShortString)
+    {
+        return amqShortString == null ? null : amqShortString.asString();
+    }
+
 }

Modified: qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java (original)
+++ qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ByteArrayDataInput.java Wed May  2 13:09:18 2012
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.framing;
 
 import org.apache.qpid.codec.MarkableDataInput;

Modified: qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ExtendedDataInput.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ExtendedDataInput.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ExtendedDataInput.java (original)
+++ qpid/branches/qpid-3767/qpid/java/common/src/main/java/org/apache/qpid/framing/ExtendedDataInput.java Wed May  2 13:09:18 2012
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.framing;
 
 import java.io.DataInput;

Modified: qpid/branches/qpid-3767/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/branches/qpid-3767/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java Wed May  2 13:09:18 2012
@@ -42,6 +42,7 @@ public class QpidTestCase extends TestCa
 {
     public static final String QPID_HOME = System.getProperty("QPID_HOME");
     public static final String TEST_RESOURCES_DIR = QPID_HOME + "/../test-profiles/test_resources/";
+    public static final String TMP_FOLDER = System.getProperty("java.io.tmpdir");
 
     private static final Logger _logger = Logger.getLogger(QpidTestCase.class);
 
@@ -108,10 +109,10 @@ public class QpidTestCase extends TestCa
             _exclusionList = exclusionList;
         }
     }
-    
-    protected static final String MS_CLASS_NAME_KEY = "messagestore.class.name";
-    protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
-    
+
+    protected static final String MS_FACTORY_CLASS_NAME_KEY = "messagestorefactory.class.name";
+    protected static final String MEMORY_STORE_FACTORY_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStoreFactory";
+
     private static List<String> _exclusionList;
     
     public QpidTestCase()
@@ -139,11 +140,12 @@ public class QpidTestCase extends TestCa
         }
     }
 
-    public String getTestProfileMessageStoreClassName()
+    public String getTestProfileMessageStoreFactoryClassName()
     {
-        String storeClass = System.getProperty(MS_CLASS_NAME_KEY);
+        final String storeFactoryClass = System.getProperty(MS_FACTORY_CLASS_NAME_KEY);
+        _logger.debug("MS_FACTORY_CLASS_NAME_KEY " + storeFactoryClass);
         
-        return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
+        return storeFactoryClass != null ? storeFactoryClass : MEMORY_STORE_FACTORY_CLASS_NAME ;
     }
 
 
@@ -157,7 +159,7 @@ public class QpidTestCase extends TestCa
      * @param fromPort the port to scan for availability
      * @throws NoSuchElementException if there are no ports available
      */
-    protected int getNextAvailable(int fromPort)
+    public int getNextAvailable(int fromPort)
     {
         if ((fromPort < MIN_PORT_NUMBER) || (fromPort > MAX_PORT_NUMBER))
         {

Modified: qpid/branches/qpid-3767/qpid/java/jca/README.txt
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/jca/README.txt?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/jca/README.txt (original)
+++ qpid/branches/qpid-3767/qpid/java/jca/README.txt Wed May  2 13:09:18 2012
@@ -5,7 +5,7 @@ Overview
 The Qpid Resource Adapter is a JCA 1.5 compliant resource adapter that allows
 for JEE integration between EE applications and AMQP 0.10  message brokers.
 
-The adapter provides both outbound and inbound connectivity and
+The Qpid JCA adapter provides both outbound and inbound connectivity and
 exposes a variety of options to fine tune your messaging applications. Currently
 the adapter only supports C++ based brokers and has only been tested with Apache Qpid C++ broker.
 
@@ -31,10 +31,9 @@ When a ManagedConnectionFactory JavaBean
 the configuration properties from the ResourceAdapter or provide specific properties which in turn will override
 the defaults.
 
-While some of the properties from the three componets are specific to the JCA adapter, a majority of the
-properties directly correspond the the Qpid JMS client. As such, it is strongly encouraged your familiarize
-yourself with the correct syntax, configuration options for the JMS client as well as the JCA adapter. Similarly,
-familiarity with the 1.5 JCA specification is encouraged though not strictly required.
+While some of the properties from the three components are specific to the JCA adapter, a majority of the
+properties directly correspond the the Qpid JMS client. As such, familiarity with the Qpid JMS Client is strongly
+encouraged. Similarly, familiarity with the JCA 1.5 specification is encouraged though not strictly required.
 
 The ResourceAdapter JavaBean
 ============================
@@ -65,14 +64,6 @@ UseLocalTx
     Whether or not to use local transactions instead of XA.
 Default: false
 
-DefaultUserName
-    The default user name to use.
-Default: guest
-
-DefaultPassword
-    The default password to use.
-Default: guest
-
 Host
     The hostname/ip address of the broker.
 Default: localhost
@@ -87,23 +78,23 @@ Default: test
 
 ConnectionURL
    The full connection URL to the broker.
-Default:amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'
+Default: amqp://anonymous:passwd@client/test?brokerlist='tcp://localhost?sasl_mechs='PLAIN''
 
 TransactionManagerLocatorClass
-    The class responsible for locating the transaction manager within a specific application server. This is a ResourceAdapter
-    Java Bean specific property and is application server specific. As such, it is currently commented out. Two examples have
-    been provided.
+    The class responsible for locating the transaction manager within a specific application server.
+    This is a ResourceAdapter Java Bean specific property and is application server specific, as such,
+    no default is provided.
 Default: none
 
 TransactionManagerLocatorMethod
-    The specific method on the class above used to acquire a reference to the platform specific transaction manager.
-    This is a ResourceAdapter Java Bean specific property and is application server specific.
-    As such, it is currently commented out. Two examples have been provided.
+    The specific method on the TransactionManagerLocatorClass used to acquire a reference to the platform
+    specific transaction manager. This is a ResourceAdapter Java Bean specific property and is application
+    server specific as such, no default is provided.
 Default:none
 
-Note, if you require XA support, both the TransactionManagerLocatorClass and the TransactionManagerLocatorMethod
-properties MUST be set. While application servers typically provide a mechanism to do this in the form of a specific
-deployment descriptor, or GUI console, the ra.xml file can also be modified directly.
+Note, both the TransactionManagerLocatorClass and the TransactionManagerLocatorMethod
+properties must be set. While application servers typically provide a mechanism to do this in the form of
+a specific deployment descriptor, or GUI console, the ra.xml file can also be modified directly.
 
 The ManagedConnectionFactory JavaBean
 =====================================
@@ -112,28 +103,16 @@ The ManagedConnectionFactory JavaBean pr
 inherited from the ResourceAdapter JavaBean, the ManagedConnectionFactory JavaBean provides specific properties only applicable
 to outbound connectivity.
 
-sessionDefaulType
+SessionDefaulType
     The default type of Session. Currently unused.
 Default: java.jms.Queue
 
-useTryLock
+UseTryLock
     Multi-purpose property used to specify both that a lock on the underlying managed connection should be used, as well as the
     wait duration to aquire the lock. Primarily used for transaction management. A null or zero value will atttempt to acquire
     the lock without a duration. Anything greater than zero will wait n number of seconds before failing to acquire the lock.
 Default:0
 
-KeyStorePassword
-    The KeyStore password for SSL
-Default:none
-
-KeyStorePath
-    The path to the KeyStore.
-Default:none
-
-CertType
-    The type of certificate.
-Default:SunX509
-
 The ActivationSpec JavaBean
 ===========================
 The ActivationSpec JavaBean provides inbound connectivity for the Qpid JCA adapter. In addition to most of the properties
@@ -149,7 +128,7 @@ UseJNDI
 Default: true
 
 Destination
-    The name of the destination on which to listen for messages.
+    The JNDI name of the destination on which to listen for messages.
 Default:none
 
 DestinationType
@@ -187,49 +166,49 @@ PrefetchLow
 PrefetchHigh
     Qpid specific -- TODO more explanation
 
-
+SetupA
 Administered Objects
 ======================
 The JCA specification provides for administered objects. Ass per the specification, administered objects are
-JavaBeans that specific to the messaging provider. The Qpid JCA Resource Adapter provides two administered
+JavaBeans that specific to the messaging provider. The Qpid JCA Resource Adapter provides three administered
 objects that can be used to configure JMS destinations and a specialized JMS Connection Factory respectively.
 Both these administered objects have properities to support configuration and deployment.
 
-QpidDestinationProxy
+QpidQueue/QpidTopic
 ====================
-    The QpidDestinationProxy allows a developer, deployer or adminstrator to create destinations (queues or topic) and
-    bind these destinations into JNDI. The following lists the properties applicable to the QpidDestinationProxy
-
-destinationType
-    The type of destination to create. Valid values are QUEUE or TOPIC.
+    The QpidQueue/QpidTopic AdminObjects allow a developer, deployer or adminstrator to create destinations
+    (queues or topic) and bind these destinations into JNDI. Only one property is required:
 
-destinationAddress
+DestinationAddress
     The address string of the destination. Please see the Qpid Java JMS client documentation for valid values.
 
+Example:
+   DestinationAddress=hello.Queue;{create:always, node:{type:queue, x-declare:{auto-delete:true}}}
+   DestinationAddress=amq.topic/hello.Topic
+
 QpidConnectionFactoryProxy
+==========================
     The QpidConnectionFactoryProxy allows for a non-JCA ConnectionFactory to be bound into the JNDI tree. This
     ConnectionFactory can in turn be used outside of the application server. Typically a ConnectionFactory of
-    this sort is used by Swing or other two-tier clients not requiring JCA. The QpidConnectionFactoryProxy provides
-    one property
+    this sort is used by Java Swing or other non-managed clients not requiring JCA. One one property is
+    required:
 
-connectionURL
+ConnectionURL
     This is the url used to configure the connection factory. Please see the Qpid Java Client documentation for
     further details.
 
+Example:
+    amqp://anonymous:passwd@client/test?brokerlist='tcp://localhost:5672?sasl_mechs='PLAIN''
 
 Transaction Support
 ===================
 The Qpid JCA Resource Adapter provides three levels of transaction support: XA, LocalTransactions and NoTransaction.
 Typical usage of the Qpid JCA Resource adapter implies the use of XA transactions, though there are certain scenarios
 where this is not preferred. Transaction support configuration is application server specific and as such, is explained
-in the corresponding documentation for each supported application server. However, there are two limitations with
-the Qpid JCA adapter at this time:
-
-1) Currently, the Qpid C++ broker does not support he use of XA within the context of clustered brokers. As such, if
-you are running in a cluster, you will need to configure the adapter to use LocalTransactions.
+in the corresponding documentation for each supported application server. Current limitations with XA are listed
+below:
 
-2)XARecovery is currently not implemented. In the case of a system failure, in doubt transactions will have to be
-manually resolved by and administrator or otherwise qualified personnel.
+1)XARecovery is currently only supported for JBoss EAP 5.x and is not supported for clustered broker configurations.
 
 Conclusion
 ==========



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message