mirror of https://github.com/apache/activemq.git
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.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1485383 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
649876b931
commit
48b404869f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue