activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r790957 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker: BrokerTestSupport.java MessageExpirationTest.java
Date Fri, 03 Jul 2009 16:07:05 GMT
Author: gtully
Date: Fri Jul  3 16:07:04 2009
New Revision: 790957

URL: http://svn.apache.org/viewvc?rev=790957&view=rev
Log:
enable a few more expiry tests - https://issues.apache.org/activemq/browse/AMQ-1112

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?rev=790957&r1=790956&r2=790957&view=diff
==============================================================================
--- 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 Jul  3 16:07:04 2009
@@ -53,8 +53,6 @@
 import org.apache.activemq.command.XATransactionId;
 import org.apache.activemq.store.PersistenceAdapter;
 import org.apache.activemq.usage.SystemUsage;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 public class BrokerTestSupport extends CombinationTestSupport {
 

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?rev=790957&r1=790956&r2=790957&view=diff
==============================================================================
--- 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
Fri Jul  3 16:07:04 2009
@@ -20,6 +20,7 @@
 
 import junit.framework.Test;
 import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConnectionInfo;
@@ -33,9 +34,9 @@
 public class MessageExpirationTest extends BrokerTestSupport {
 
     public ActiveMQDestination destination;
-    public int deliveryMode;
+    public int deliveryMode = DeliveryMode.NON_PERSISTENT;
     public int prefetch;
-    public byte destinationType;
+    public byte destinationType = ActiveMQDestination.QUEUE_TYPE;
     public boolean durableConsumer;
 
     protected Message createMessage(ProducerInfo producerInfo, ActiveMQDestination destination,
int deliveryMode, int timeToLive) {
@@ -63,10 +64,13 @@
         PolicyEntry policy = super.getDefaultPolicy();
         // disable spooling
         policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
+        // have aggressive expiry period to ensure no deadlock or clash
+        policy.setExpireMessagesPeriod(100);
+        
         return policy;
     }
 
-    public void XtestMessagesWaitingForUssageDecreaseExpire() throws Exception {
+    public void testMessagesWaitingForUsageDecreaseExpire() throws Exception {
 
         // Start a producer
         final StubConnection connection = createConnection();
@@ -211,12 +215,6 @@
         connection.send(closeConnectionInfo(connectionInfo));
     }
 
-    public void xinitCombosForTestMessagesInSubscriptionPendingListExpire() {
-        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT),
Integer.valueOf(DeliveryMode.PERSISTENT)});
-        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),
Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),
-                                                              Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE),
Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)});
-    }
-
     public void initCombosForTestMessagesInSubscriptionPendingListExpire() {
         addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT),
Integer.valueOf(DeliveryMode.PERSISTENT)});
         addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),
Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),



Mime
View raw message