qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1533142 - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/model/adapter/ broker-core/src/test/java/org/apache/qpid/server/configuration/ broker-core/src/test/java/org/apache/qpid/server/model/ broker-core/src/tes...
Date Thu, 17 Oct 2013 16:35:22 GMT
Author: orudyy
Date: Thu Oct 17 16:35:21 2013
New Revision: 1533142

URL: http://svn.apache.org/r1533142
Log:
QPID-5242: Remove obsolete conversion of queue message grouping attributes into old grouping
arguments on queue creation with Virtual Host adapter

Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java?rev=1533142&r1=1533141&r2=1533142&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
Thu Oct 17 16:35:21 2013
@@ -65,9 +65,7 @@ import org.apache.qpid.server.plugin.Exc
 import org.apache.qpid.server.protocol.AMQConnectionModel;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.QueueArgumentsConverter;
 import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.SimpleAMQQueue;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.access.Operation;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
@@ -408,22 +406,6 @@ public final class VirtualHostAdapter ex
             }
         }
 
-        if (attributes.containsKey(Queue.MESSAGE_GROUP_KEY))
-        {
-            String key = MapValueConverter.getStringAttribute(Queue.MESSAGE_GROUP_KEY, attributes);
-            attributes.remove(Queue.MESSAGE_GROUP_KEY);
-            attributes.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY, key);
-        }
-
-        if (attributes.containsKey(Queue.MESSAGE_GROUP_SHARED_GROUPS))
-        {
-            if(MapValueConverter.getBooleanAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS, attributes))
-            {
-                attributes.remove(Queue.MESSAGE_GROUP_SHARED_GROUPS);
-                attributes.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP, SimpleAMQQueue.SHARED_MSG_GROUP_ARG_VALUE);
-            }
-        }
-
         String         name     = MapValueConverter.getStringAttribute(Queue.NAME, attributes,
null);
         State          state    = MapValueConverter.getEnumAttribute(State.class, Queue.STATE,
attributes, State.ACTIVE);
         boolean        durable  = MapValueConverter.getBooleanAttribute(Queue.DURABLE, attributes,
false);

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java?rev=1533142&r1=1533141&r2=1533142&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
Thu Oct 17 16:35:21 2013
@@ -29,6 +29,7 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.PropertiesConfiguration;
 
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
 import org.apache.qpid.server.util.BrokerTestHelper;
 
 public class QueueConfigurationTest extends TestCase
@@ -247,9 +248,9 @@ public class QueueConfigurationTest exte
         assertTrue(qConf.getArguments().isEmpty());
 
         // Check explicit value
-        final VirtualHostConfiguration vhostConfig = overrideConfiguration("argument", "qpid.group_header_key=mykey");
+        final VirtualHostConfiguration vhostConfig = overrideConfiguration("argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY
+ "=mykey");
         qConf = new QueueConfiguration("test", vhostConfig);
-        assertEquals(Collections.singletonMap("qpid.group_header_key","mykey"), qConf.getArguments());
+        assertEquals(Collections.singletonMap(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"mykey"),
qConf.getArguments());
     }
 
 
@@ -261,8 +262,8 @@ public class QueueConfigurationTest exte
 
 
         PropertiesConfiguration queueConfig = new PropertiesConfiguration();
-        queueConfig.addProperty("queues.queue.test.argument", "qpid.group_header_key=mykey");
-        queueConfig.addProperty("queues.queue.test.argument", "qpid.shared_msg_group=1");
+        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY
+ "=mykey");
+        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_SHARED_MSG_GROUP
+ "=1");
 
         CompositeConfiguration config = new CompositeConfiguration();
         config.addConfiguration(_fullHostConf.getConfig());
@@ -271,8 +272,8 @@ public class QueueConfigurationTest exte
         final VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration("test",
config, _broker);;
         qConf = new QueueConfiguration("test", vhostConfig);
         assertEquals(2, qConf.getArguments().size());
-        assertEquals("mykey", qConf.getArguments().get("qpid.group_header_key"));
-        assertEquals("1", qConf.getArguments().get("qpid.shared_msg_group"));
+        assertEquals("mykey", qConf.getArguments().get(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY));
+        assertEquals("1", qConf.getArguments().get(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP));
     }
 
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java?rev=1533142&r1=1533141&r2=1533142&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
Thu Oct 17 16:35:21 2013
@@ -41,8 +41,9 @@ import org.apache.qpid.server.stats.Stat
 import org.apache.qpid.server.store.TestMemoryMessageStore;
 import org.apache.qpid.server.util.BrokerTestHelper;
 import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
+import org.apache.qpid.test.utils.QpidTestCase;
 
-public class VirtualHostTest extends TestCase
+public class VirtualHostTest extends QpidTestCase
 {
 
     private Broker _broker;
@@ -125,6 +126,28 @@ public class VirtualHostTest extends Tes
         assertEquals("Unexpected state", State.DELETED, host.getAttribute(VirtualHost.STATE));
     }
 
+    public void testCreateQueueChildHavingMessageGrouppingAttributes()
+    {
+        VirtualHost host = createHost();
+        host.setDesiredState(State.INITIALISING, State.ACTIVE);
+
+        String queueName = getTestName();
+        Map<String, Object> arguments = new HashMap<String, Object>();
+        arguments.put(Queue.MESSAGE_GROUP_KEY, "mykey");
+        arguments.put(Queue.MESSAGE_GROUP_SHARED_GROUPS, true);
+        arguments.put(Queue.NAME, queueName);
+
+        host.createChild(Queue.class, arguments);
+
+        Queue queue = ConfiguredObjectFinder.findConfiguredObjectByName(host.getQueues(),
queueName);
+        Object messageGroupKey = queue.getAttribute(Queue.MESSAGE_GROUP_KEY);
+        assertEquals("Unexpected message group key attribute", "mykey", messageGroupKey);
+
+        Object sharedGroups = queue.getAttribute(Queue.MESSAGE_GROUP_SHARED_GROUPS);
+        assertEquals("Unexpected shared groups attribute", true, sharedGroups);
+
+    }
+
     private VirtualHost createHost()
     {
         Map<String, Object> attributes = new HashMap<String, Object>();

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=1533142&r1=1533141&r2=1533142&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
Thu Oct 17 16:35:21 2013
@@ -534,8 +534,8 @@ public class AMQQueueFactoryTest extends
     {
 
         Map<String,String> arguments = new HashMap<String, String>();
-        arguments.put("qpid.group_header_key","mykey");
-        arguments.put("qpid.shared_msg_group","1");
+        arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"mykey");
+        arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
 
         QueueConfiguration qConf = mock(QueueConfiguration.class);
         when(qConf.getArguments()).thenReturn(arguments);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java?rev=1533142&r1=1533141&r2=1533142&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MessageGroupQueueTest.java
Thu Oct 17 16:35:21 2013
@@ -110,10 +110,10 @@ public class MessageGroupQueueTest exten
     private void simpleGroupAssignment(boolean sharedGroups) throws AMQException, JMSException
     {
         final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("qpid.group_header_key","group");
+        arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
         if(sharedGroups)
         {
-            arguments.put("qpid.shared_msg_group","1");
+            arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
         }
         ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false,
false, arguments);
         queue = (Queue) producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
@@ -200,10 +200,10 @@ public class MessageGroupQueueTest exten
     private void consumerCloseGroupAssignment(boolean sharedGroups) throws AMQException,
JMSException
     {
         final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("qpid.group_header_key","group");
+        arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
         if(sharedGroups)
         {
-            arguments.put("qpid.shared_msg_group","1");
+            arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
         }
         ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false,
false, arguments);
         queue = (Queue) producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
@@ -299,10 +299,10 @@ public class MessageGroupQueueTest exten
     private void consumerCloseWithRelease(boolean sharedGroups) throws AMQException, JMSException
     {
         final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("qpid.group_header_key","group");
+        arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
         if(sharedGroups)
         {
-            arguments.put("qpid.shared_msg_group","1");
+            arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
         }
 
         ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false,
false, arguments);
@@ -391,10 +391,10 @@ public class MessageGroupQueueTest exten
     private void groupAssignmentOnEmpty(boolean sharedGroups) throws AMQException, JMSException
     {
         final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("qpid.group_header_key","group");
+        arguments.put(QueueArgumentsConverter.QPID_GROUP_HEADER_KEY,"group");
         if(sharedGroups)
         {
-            arguments.put("qpid.shared_msg_group","1");
+            arguments.put(QueueArgumentsConverter.QPID_SHARED_MSG_GROUP,"1");
         }
 
         ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false,
false, arguments);



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


Mime
View raw message