*/
@Ignore
@Test
public void testPerformanceOfRemovals() throws Exception {
// setup
AdvisoryBroker testObj = (AdvisoryBroker) brokerService.getBroker().getAdaptor(AdvisoryBroker.class);
ActiveMQDestination destination = new ActiveMQQueue("foo");
ConnectionInfo connectionInfo = createConnectionInfo();
ConnectionContext connectionContext = new ConnectionContext(connectionInfo);
connectionContext.setBroker(brokerService.getBroker());
SessionInfo sessionInfo = createSessionInfo(connectionInfo);
long start = System.currentTimeMillis();
for (int i = 0; i < 200; ++i) {
for (int j = 1; j <= 500; j++) {
ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
testObj.addConsumer(connectionContext, consumerInfo);
}
for (int j = 500; j > 0; j--) {
ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
testObj.removeConsumer(connectionContext, consumerInfo);
}
for (int j = 1; j <= 500; j++) {
ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
testObj.addConsumer(connectionContext, consumerInfo);
}
for (int j = 1; j <= 500; j++) {
ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, j, destination);
testObj.removeConsumer(connectionContext, consumerInfo);
}
}
long finish = System.currentTimeMillis();
long totalTime = finish - start;
LOG.info("Total test time: {} seconds", TimeUnit.MILLISECONDS.toSeconds(totalTime));
assertEquals(0, testObj.getAdvisoryConsumers().size());
}