activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1485383 - /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java
Date Wed, 22 May 2013 20:00:46 GMT
Author: tabish
Date: Wed May 22 20:00:46 2013
New Revision: 1485383

URL: http://svn.apache.org/r1485383
Log:
since https://issues.apache.org/jira/browse/AMQ-4495 always pulls in maxPageSize messages
and allows for exceeding the MemoryLimit we must adjust the test case to account for that.
 

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java?rev=1485383&r1=1485382&r2=1485383&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/QueueBrowsingTest.java
Wed May 22 20:00:46 2013
@@ -16,9 +16,25 @@
  */
 package org.apache.activemq.usecases;
 
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Enumeration;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.junit.After;
 import org.junit.Before;
@@ -26,13 +42,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jms.*;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Enumeration;
-
-import static org.junit.Assert.assertEquals;
-
 public class QueueBrowsingTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(QueueBrowsingTest.class);
@@ -40,7 +49,7 @@ public class QueueBrowsingTest {
     private BrokerService broker;
     private URI connectUri;
     private ActiveMQConnectionFactory factory;
-
+    private final int maxPageSize = 100;
 
     @Before
     public void startBroker() throws Exception {
@@ -49,6 +58,12 @@ public class QueueBrowsingTest {
         broker.deleteAllMessages();
         broker.start();
         broker.waitUntilStarted();
+
+        PolicyEntry policy = new PolicyEntry();
+        policy.setMaxPageSize(maxPageSize);
+        broker.setDestinationPolicy(new PolicyMap());
+        broker.getDestinationPolicy().setDefaultEntry(policy);
+
         connectUri = connector.getConnectUri();
         factory = new ActiveMQConnectionFactory(connectUri);
     }
@@ -194,6 +209,6 @@ public class QueueBrowsingTest {
         }
 
         browser.close();
-        assertEquals(3, received);
+        assertEquals(maxPageSize + 2, received);
     }
 }



Mime
View raw message