Author: gtully
Date: Fri Sep 12 04:04:30 2008
New Revision: 694679
URL: http://svn.apache.org/viewvc?rev=694679&view=rev
Log:
revert change to PrefetchSubscripton.isFull from fix to
https://issues.apache.org/activemq/browse/AMQ-1925, updated test case to
demonstrate failure
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/MasterSlaveTempQueueMemoryTest.java
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?rev=694679&r1=694678&r2=694679&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Fri Sep 12 04:04:30 2008
@@ -468,7 +468,7 @@
* @return
*/
public boolean isFull() {
- return isSlave() || dispatched.size() - prefetchExtension >=
info.getPrefetchSize();
+ return dispatched.size() - prefetchExtension >= info.getPrefetchSize();
}
/**
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/MasterSlaveTempQueueMemoryTest.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/MasterSlaveTempQueueMemoryTest.java?rev=694679&r1=694678&r2=694679&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/MasterSlaveTempQueueMemoryTest.java
(original)
+++
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/MasterSlaveTempQueueMemoryTest.java
Fri Sep 12 04:04:30 2008
@@ -49,6 +49,13 @@
}
@Override
+ protected void tearDown() throws Exception {
+ slave.stop();
+ super.tearDown();
+
+ }
+
+ @Override
public void testLoadRequestReply() throws Exception {
super.testLoadRequestReply();
@@ -62,7 +69,25 @@
RegionBroker.class);
//serverDestination +
- assertEquals(6, rb.getDestinationMap().size());
+ assertEquals(6, rb.getDestinationMap().size());
+
+ RegionBroker masterRb = (RegionBroker) broker.getBroker().getAdaptor(
+ RegionBroker.class);
+
+ // REVISIT the following two are not dependable at the moment, off by
a small number
+ // for some reason? The work for a COUNT < ~500
+ //
+ //assertEquals("inflight match",
rb.getDestinationStatistics().getInflight().getCount(),
masterRb.getDestinationStatistics().getInflight().getCount());
+ //assertEquals("enqueues match",
rb.getDestinationStatistics().getEnqueues().getCount(),
masterRb.getDestinationStatistics().getEnqueues().getCount());
+
+ assertEquals("dequeues match",
+ rb.getDestinationStatistics().getDequeues().getCount(),
+ masterRb.getDestinationStatistics().getDequeues().getCount());
+
+ // slave does not actually dispatch any messages, so no
request/reply(2) pair per iteration(COUNT)
+ assertEquals("dispatched match",
+ rb.getDestinationStatistics().getDispatched().getCount() +
2*COUNT,
+
masterRb.getDestinationStatistics().getDispatched().getCount());
}
}
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java?rev=694679&r1=694678&r2=694679&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
(original)
+++
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
Fri Sep 12 04:04:30 2008
@@ -37,7 +37,7 @@
private Connection clientConnection;
private Session clientSession;
private Destination serverDestination;
- private static final int COUNT = 1000;
+ protected static final int COUNT = 2000;
public void testLoadRequestReply() throws Exception {
MessageConsumer serverConsumer =
serverSession.createConsumer(serverDestination);