activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r510899 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
Date Fri, 23 Feb 2007 10:46:46 GMT
Author: rajdavies
Date: Fri Feb 23 02:46:43 2007
New Revision: 510899

URL: http://svn.apache.org/viewvc?view=rev&rev=510899
Log:
Add a default policy entry, now that FixedSizeSubsctionRecoveryPolicy is no longer set by
default on a Topic.
It was a memory issue for large messages.

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java?view=diff&rev=510899&r1=510898&r2=510899
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
Fri Feb 23 02:46:43 2007
@@ -30,6 +30,10 @@
 
 import org.apache.activemq.CombinationTestSupport;
 import org.apache.activemq.broker.region.RegionBroker;
+import org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
+import org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQTextMessage;
 import org.apache.activemq.command.ConnectionId;
@@ -79,11 +83,23 @@
     protected void setUp() throws Exception {
         super.setUp();
         broker = createBroker();
+        setDefaultPolicy(broker);
         broker.start();
     }
+    
+    protected void setDefaultPolicy(BrokerService brokerService) {
+    	PolicyEntry policy = new PolicyEntry();
+        policy.setDispatchPolicy(new RoundRobinDispatchPolicy());
+        policy.setSubscriptionRecoveryPolicy(new FixedCountSubscriptionRecoveryPolicy());
+        PolicyMap pMap = new PolicyMap();
+        pMap.setDefaultEntry(policy);
+
+        broker.setDestinationPolicy(pMap);
+    }
 
     protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false"));
+        BrokerService broker =  BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false"));
+        return  broker;
     }
     
     protected void tearDown() throws Exception {



Mime
View raw message