activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r512259 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker: BrokerTestSupport.java MessageExpirationTest.java
Date Tue, 27 Feb 2007 14:05:17 GMT
Author: rajdavies
Date: Tue Feb 27 06:05:16 2007
New Revision: 512259

URL: http://svn.apache.org/viewvc?view=rev&rev=512259
Log:
tidy up the setting of the default policy

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.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=512259&r1=512258&r2=512259
==============================================================================
--- 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
Tue Feb 27 06:05:16 2007
@@ -83,20 +83,20 @@
     protected void setUp() throws Exception {
         super.setUp();
         broker = createBroker();
-        setDefaultPolicy(broker);
+        PolicyMap policyMap = new PolicyMap();
+        policyMap.setDefaultEntry(getDefaultPolicy());
+        broker.setDestinationPolicy(policyMap);
         broker.start();
     }
     
-    protected void setDefaultPolicy(BrokerService brokerService) {
-    	PolicyEntry policy = new PolicyEntry();
+    protected PolicyEntry getDefaultPolicy() {
+        PolicyEntry policy = new PolicyEntry();
         policy.setDispatchPolicy(new RoundRobinDispatchPolicy());
         policy.setSubscriptionRecoveryPolicy(new FixedCountSubscriptionRecoveryPolicy());
-        PolicyMap pMap = new PolicyMap();
-        pMap.setDefaultEntry(policy);
-
-        broker.setDestinationPolicy(pMap);
+        return policy;
     }
-
+    
+  
     protected BrokerService createBroker() throws Exception {
         BrokerService broker =  BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false"));
         return  broker;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java?view=diff&rev=512259&r1=512258&r2=512259
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java
Tue Feb 27 06:05:16 2007
@@ -29,6 +29,7 @@
 import org.apache.activemq.command.MessageAck;
 import org.apache.activemq.command.ProducerInfo;
 import org.apache.activemq.command.SessionInfo;
+import org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy;
 import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy;
@@ -67,16 +68,14 @@
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = new BrokerService();
         broker.setPersistent(false);
-
-        // lets disable spooling
-        PolicyEntry policy = new PolicyEntry();
-        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
-
-        PolicyMap map = new PolicyMap();
-        map.setDefaultEntry(policy);
-        broker.setDestinationPolicy(map);
-        
         return broker;
+    }
+    
+    protected PolicyEntry getDefaultPolicy() {
+        PolicyEntry policy = super.getDefaultPolicy();
+        //disable spooling
+        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
+        return policy;
     }
 
     public void testMessagesWaitingForUssageDecreaseExpire() throws Exception {



Mime
View raw message