mirror of https://github.com/apache/activemq.git
AMQ-8509: Update TempStore Usage test to verify cleanup
Add a unit test to the previous tests added in AMQ-7085 to verify TempUsage is cleaned up and stopped on Queue.stop()
This commit is contained in:
parent
fb7ae908ef
commit
df354fa023
|
@ -16,6 +16,15 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.bugs;
|
package org.apache.activemq.bugs;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
|
||||||
|
import javax.jms.Connection;
|
||||||
|
import javax.jms.Destination;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.MessageProducer;
|
||||||
|
import javax.jms.Session;
|
||||||
|
import javax.management.ObjectName;
|
||||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||||
import org.apache.activemq.broker.BrokerService;
|
import org.apache.activemq.broker.BrokerService;
|
||||||
import org.apache.activemq.broker.jmx.BrokerView;
|
import org.apache.activemq.broker.jmx.BrokerView;
|
||||||
|
@ -25,11 +34,6 @@ import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import javax.jms.*;
|
|
||||||
import javax.management.ObjectName;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests to ensure when the temp usage limit is updated on the broker the queues also have their
|
* Tests to ensure when the temp usage limit is updated on the broker the queues also have their
|
||||||
* temp usage limits automatically updated.
|
* temp usage limits automatically updated.
|
||||||
|
@ -94,6 +98,10 @@ public class AMQ7085Test
|
||||||
brokerView.setTempLimit(newBrokerTempLimit);
|
brokerView.setTempLimit(newBrokerTempLimit);
|
||||||
assertEquals(brokerView.getTempLimit(), newBrokerTempLimit);
|
assertEquals(brokerView.getTempLimit(), newBrokerTempLimit);
|
||||||
assertEquals(queueViewMBean.getTempUsageLimit(), queueTempLimit);
|
assertEquals(queueViewMBean.getTempUsageLimit(), queueTempLimit);
|
||||||
|
|
||||||
|
//Verify that TempUsage is cleaned up on Queue stop
|
||||||
|
brokerService.getDestination(queue).stop();
|
||||||
|
assertFalse(brokerService.getDestination(queue).getTempUsage().isStarted());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -112,5 +120,9 @@ public class AMQ7085Test
|
||||||
brokerView.setTempLimit(newBrokerTempLimit);
|
brokerView.setTempLimit(newBrokerTempLimit);
|
||||||
assertEquals(brokerView.getTempLimit(), newBrokerTempLimit);
|
assertEquals(brokerView.getTempLimit(), newBrokerTempLimit);
|
||||||
assertEquals(queueViewMBean.getTempUsageLimit(), newBrokerTempLimit);
|
assertEquals(queueViewMBean.getTempUsageLimit(), newBrokerTempLimit);
|
||||||
|
|
||||||
|
//Verify that TempUsage is cleaned up on Queue stop
|
||||||
|
brokerService.getDestination(queue).stop();
|
||||||
|
assertFalse(brokerService.getDestination(queue).getTempUsage().isStarted());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue