qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1588468 [3/3] - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/configuration/startup/ broker-core/src/main/java/org/apache/qpid/server/configuration/store/ broker-core/src/main/java/org/apache/qpid/server/model/...
Date Fri, 18 Apr 2014 13:37:34 GMT
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ConsumerTarget_0_10.java
Fri Apr 18 13:37:32 2014
@@ -20,28 +20,37 @@
  */
 package org.apache.qpid.server.protocol.v0_10;
 
+import java.util.Collections;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.qpid.server.consumer.AbstractConsumerTarget;
 import org.apache.qpid.server.consumer.ConsumerImpl;
-import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.flow.FlowCreditManager;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.messages.ChannelMessages;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.ServerMessage;
+import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.plugin.MessageConverter;
 import org.apache.qpid.server.protocol.MessageConverterRegistry;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.store.TransactionLogResource;
-import org.apache.qpid.server.consumer.AbstractConsumerTarget;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.util.Action;
 import org.apache.qpid.server.util.ConnectionScopedRuntimeException;
-import org.apache.qpid.transport.*;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
+import org.apache.qpid.transport.DeliveryProperties;
+import org.apache.qpid.transport.Header;
+import org.apache.qpid.transport.MessageAcceptMode;
+import org.apache.qpid.transport.MessageAcquireMode;
+import org.apache.qpid.transport.MessageCreditUnit;
+import org.apache.qpid.transport.MessageFlowMode;
+import org.apache.qpid.transport.MessageProperties;
+import org.apache.qpid.transport.MessageTransfer;
+import org.apache.qpid.transport.Method;
+import org.apache.qpid.transport.Option;
 
 public class ConsumerTarget_0_10 extends AbstractConsumerTarget implements FlowCreditManager.FlowCreditManagerListener
 {
@@ -405,7 +414,7 @@ public class ConsumerTarget_0_10 extends
             if(owningResource instanceof AMQQueue)
             {
                 final AMQQueue queue = (AMQQueue)owningResource;
-                final ExchangeImpl alternateExchange = queue.getAlternateExchange();
+                final Exchange alternateExchange = queue.getAlternateExchange();
 
                 if(alternateExchange != null)
                 {

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
Fri Apr 18 13:37:32 2014
@@ -63,7 +63,6 @@ import org.apache.qpid.server.Transactio
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.connection.SessionPrincipal;
 import org.apache.qpid.server.consumer.ConsumerImpl;
-import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.filter.AMQInvalidArgumentException;
 import org.apache.qpid.server.filter.FilterManager;
 import org.apache.qpid.server.filter.FilterManagerFactory;
@@ -86,6 +85,7 @@ import org.apache.qpid.server.message.Se
 import org.apache.qpid.server.model.ConfigurationChangeListener;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Consumer;
+import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.model.Session;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.protocol.AMQSessionModel;
@@ -1616,7 +1616,7 @@ public class AMQChannel<T extends AMQPro
                 {
                     final AMQQueue queue = (AMQQueue) owningResource;
 
-                    final ExchangeImpl altExchange = queue.getAlternateExchange();
+                    final Exchange altExchange = queue.getAlternateExchange();
 
                     if (altExchange == null)
                     {

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java
Fri Apr 18 13:37:32 2014
@@ -24,6 +24,7 @@ package org.apache.qpid.server.jmx.mbean
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
 import javax.management.JMException;
@@ -294,14 +295,19 @@ public class QueueMBean extends AMQManag
     {
         if (exchangeName == null || "".equals(exchangeName))
         {
-            _queue.setAttribute(Queue.ALTERNATE_EXCHANGE, getAlternateExchange(), null);
+            _queue.setAttributes(Collections.singletonMap(Queue.ALTERNATE_EXCHANGE, null));
         }
         else
         {
-            VirtualHost<?,?,?> virtualHost = _queue.getParent(VirtualHost.class);
-            Exchange exchange = MBeanUtils.findExchangeFromExchangeName(virtualHost, exchangeName);
+            try
+            {
 
-            _queue.setAttribute(Queue.ALTERNATE_EXCHANGE, getAlternateExchange(), exchange);
+                _queue.setAttributes(Collections.<String,Object>singletonMap(Queue.ALTERNATE_EXCHANGE,
exchangeName));
+            }
+            catch (IllegalArgumentException e)
+            {
+                throw new OperationsException("No such exchange \""+exchangeName+"\"");
+            }
         }
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java
Fri Apr 18 13:37:32 2014
@@ -19,8 +19,10 @@
 package org.apache.qpid.server.jmx.mbeans;
 
 import static org.mockito.Matchers.argThat;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isNull;
 import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -320,7 +322,7 @@ public class QueueMBeanTest extends Qpid
         when(_mockQueue.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);
 
         _queueMBean.setAlternateExchange("exchange2");
-        verify(_mockQueue).setAttribute(Queue.ALTERNATE_EXCHANGE, null, mockExchange2);
+        verify(_mockQueue).setAttributes(Collections.<String,Object>singletonMap(Queue.ALTERNATE_EXCHANGE,
"exchange2"));
     }
 
     public void testSetAlternateExchangeWithUnknownExchangeName() throws Exception
@@ -331,7 +333,8 @@ public class QueueMBeanTest extends Qpid
         VirtualHost mockVirtualHost = mock(VirtualHost.class);
         when(mockVirtualHost.getExchanges()).thenReturn(Collections.singletonList(mockExchange));
         when(_mockQueue.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);
-
+        doThrow(new IllegalArgumentException()).when(_mockQueue).setAttributes(
+                eq(Collections.<String, Object>singletonMap(Queue.ALTERNATE_EXCHANGE,
"notknown")));
         try
         {
             _queueMBean.setAlternateExchange("notknown");
@@ -346,7 +349,7 @@ public class QueueMBeanTest extends Qpid
     public void testRemoveAlternateExchange() throws Exception
     {
         _queueMBean.setAlternateExchange("");
-        verify(_mockQueue).setAttribute(Queue.ALTERNATE_EXCHANGE, null, null);
+        verify(_mockQueue).setAttributes(Collections.singletonMap(Queue.ALTERNATE_EXCHANGE,
null));
     }
 
     /**********  Operations **********/

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
Fri Apr 18 13:37:32 2014
@@ -21,8 +21,8 @@
 
 package org.apache.qpid.server.store;
 
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -30,8 +30,9 @@ import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-import java.util.ArrayList;
-import java.util.List;
+
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 public class PersistentStoreTest extends QpidBrokerTestCase
 {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
Fri Apr 18 13:37:32 2014
@@ -562,7 +562,7 @@ public class VirtualHostMessageStoreTest
         else if (lastValueQueue)
         {
             assertEquals("Queue is no longer a LastValue Queue", LastValueQueueImpl.class,
queue.getClass());
-            assertEquals("LastValue Queue Key has changed", LVQ_KEY, ((LastValueQueueImpl)
queue).getConflationKey());
+            assertEquals("LastValue Queue Key has changed", LVQ_KEY, ((LastValueQueueImpl)
queue).getLvqKey());
         }
         else
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
Fri Apr 18 13:37:32 2014
@@ -18,20 +18,19 @@
  */
 package org.apache.qpid.systest.management.jmx;
 
-import org.apache.commons.lang.time.FastDateFormat;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.management.common.mbeans.ManagedBroker;
-import org.apache.qpid.management.common.mbeans.ManagedQueue;
-import org.apache.qpid.server.queue.NotificationCheckTest;
-import org.apache.qpid.server.queue.QueueArgumentsConverter;
-import org.apache.qpid.server.queue.StandardQueueImpl;
-import org.apache.qpid.test.client.destination.AddressBasedDestinationTest;
-import org.apache.qpid.test.utils.JMXTestUtils;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -48,19 +47,20 @@ import javax.management.openmbean.Compos
 import javax.management.openmbean.TabularData;
 import javax.naming.NamingException;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
+import org.apache.commons.lang.time.FastDateFormat;
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.configuration.ClientProperties;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.management.common.mbeans.ManagedBroker;
+import org.apache.qpid.management.common.mbeans.ManagedQueue;
+import org.apache.qpid.server.queue.NotificationCheckTest;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
+import org.apache.qpid.server.queue.StandardQueueImpl;
+import org.apache.qpid.test.client.destination.AddressBasedDestinationTest;
+import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 /**
  * Tests the JMX API for the Managed Queue.

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
Fri Apr 18 13:37:32 2014
@@ -35,7 +35,6 @@ import org.apache.qpid.server.model.Grou
 import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.State;
-import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.model.adapter.FileBasedGroupProvider;
 import org.apache.qpid.server.model.adapter.FileBasedGroupProviderImpl;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -354,7 +353,6 @@ public class GroupProviderRestTest exten
             assertNotNull("Attribute " + Group.NAME, groupName);
 
             assertNotNull("Attribute " + Group.ID, group.get(Group.ID));
-            assertEquals("Attribute " + Group.ID, UUIDGenerator.generateGroupUUID(name, groupName).toString(),
group.get(Group.ID));
         }
     }
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java?rev=1588468&r1=1588467&r2=1588468&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
Fri Apr 18 13:37:32 2014
@@ -38,10 +38,10 @@ import org.apache.qpid.server.model.Exch
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.queue.LastValueQueue;
-import org.apache.qpid.server.queue.LastValueQueueImpl;
 import org.apache.qpid.server.queue.PriorityQueue;
 import org.apache.qpid.server.queue.SortedQueue;
 import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.virtualhost.AbstractVirtualHost;
 import org.apache.qpid.server.virtualhost.StandardVirtualHost;
 import org.apache.qpid.util.FileUtils;
 
@@ -274,7 +274,7 @@ public class VirtualHostRestTest extends
 
         Asserts.assertQueue(queueName , "lvq", lvqQueue);
         assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, Boolean.TRUE,
lvqQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected lvq key attribute", LastValueQueueImpl.DEFAULT_LVQ_KEY,
lvqQueue.get(LastValueQueue.LVQ_KEY));
+        assertEquals("Unexpected lvq key attribute", LastValueQueue.DEFAULT_LVQ_KEY, lvqQueue.get(LastValueQueue.LVQ_KEY));
     }
 
     public void testPutCreateSortedQueueWithoutKey() throws Exception
@@ -443,15 +443,15 @@ public class VirtualHostRestTest extends
         String queueName = getTestQueueName();
 
         Map<String, Object> attributes = new HashMap<String, Object>();
-        attributes.put(Queue.CREATE_DLQ_ON_CREATION, true);
+        attributes.put(AbstractVirtualHost.CREATE_DLQ_ON_CREATION, true);
 
         //verify the starting state
         Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/test");
         List<Map<String, Object>> queues = (List<Map<String, Object>>)
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
         List<Map<String, Object>> exchanges = (List<Map<String, Object>>)
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_EXCHANGES_ATTRIBUTE);
 
-        assertNull("queue should not have already been present", getRestTestHelper().find(Queue.NAME,
queueName , queues));
-        assertNull("queue should not have already been present", getRestTestHelper().find(Queue.NAME,
queueName + "_DLQ" , queues));
+        assertNull("queue "+ queueName + " should not have already been present", getRestTestHelper().find(Queue.NAME,
queueName , queues));
+        assertNull("queue "+ queueName + "_DLQ should not have already been present", getRestTestHelper().find(Queue.NAME,
queueName + "_DLQ" , queues));
         assertNull("exchange should not have already been present", getRestTestHelper().find(Exchange.NAME,
queueName + "_DLE" , exchanges));
 
         //create the queue
@@ -465,9 +465,9 @@ public class VirtualHostRestTest extends
         Map<String, Object> queue = getRestTestHelper().find(Queue.NAME, queueName
, queues);
         Map<String, Object> dlqQueue = getRestTestHelper().find(Queue.NAME, queueName
+ "_DLQ" , queues);
         Map<String, Object> dlExchange = getRestTestHelper().find(Exchange.NAME, queueName
+ "_DLE" , exchanges);
-        assertNotNull("queue should not have been present", queue);
-        assertNotNull("queue should not have been present", dlqQueue);
-        assertNotNull("exchange should not have been present", dlExchange);
+        assertNotNull("queue should have been present", queue);
+        assertNotNull("queue should have been present", dlqQueue);
+        assertNotNull("exchange should have been present", dlExchange);
 
         //verify that the alternate exchange is set as expected on the new queue
         Map<String, Object> queueAttributes = new HashMap<String, Object>();



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


Mime
View raw message