activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1405817 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/region/TopicSubscription.java test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java
Date Mon, 05 Nov 2012 14:54:44 GMT
Author: gtully
Date: Mon Nov  5 14:54:43 2012
New Revision: 1405817

URL: http://svn.apache.org/viewvc?rev=1405817&view=rev
Log:
fix up regression from: https://issues.apache.org/jira/browse/AMQ-3746 - ensure broker is
always non null for topicSubscription

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java?rev=1405817&r1=1405816&r2=1405817&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
Mon Nov  5 14:54:43 2012
@@ -77,7 +77,7 @@ public class TopicSubscription extends A
         super(broker, context, info);
         this.usageManager = usageManager;
         String matchedName = "TopicSubscription:" + CURSOR_NAME_COUNTER.getAndIncrement()
+ "[" + info.getConsumerId().toString() + "]";
-        if (info.getDestination().isTemporary() || broker == null || broker.getTempDataStore()==null
) {
+        if (info.getDestination().isTemporary() || broker.getTempDataStore()==null ) {
             this.matched = new VMPendingMessageCursor(false);
         } else {
             this.matched = new FilePendingMessageCursor(broker,matchedName,false);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java?rev=1405817&r1=1405816&r2=1405817&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java
Mon Nov  5 14:54:43 2012
@@ -18,6 +18,7 @@ package org.apache.activemq.broker.polic
 
 import java.util.ArrayList;
 import java.util.List;
+import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.Subscription;
 import org.apache.activemq.broker.region.TopicSubscription;
@@ -27,6 +28,8 @@ import org.apache.activemq.command.Activ
 import org.apache.activemq.command.ConsumerId;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.usage.SystemUsage;
+import org.apache.derby.iapi.jdbc.BrokeredStatement;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -41,6 +44,7 @@ public class PriorityNetworkDispatchPoli
     ActiveMQMessage node = new ActiveMQMessage();
     ConsumerId id = new ConsumerId();
     ConnectionContext context = new ConnectionContext();
+    BrokerService brokerService = new BrokerService();
 
     @Before
     public void init() throws Exception {
@@ -50,14 +54,20 @@ public class PriorityNetworkDispatchPoli
         info.setNetworkConsumerPath(new ConsumerId[]{id});
     }
 
+    @After
+    public void stopBroker() throws Exception {
+        brokerService.stop();
+    }
+
     @Test
     public void testRemoveLowerPriorityDup() throws Exception {
+
         List<Subscription> consumers = new ArrayList<Subscription>();
 
         for (int i=0; i<3; i++) {
             ConsumerInfo instance = info.copy();
             instance.setPriority((byte)i);
-            consumers.add(new TopicSubscription(null, context, instance, usageManager));
+            consumers.add(new TopicSubscription(brokerService.getBroker(), context, instance,
usageManager));
         }
         underTest.dispatch(node, null, consumers);
 



Mime
View raw message