use of org.apache.activemq.artemis.core.server.cluster.impl.RemoteQueueBindingImpl in project activemq-artemis by apache.
the class RemoteQueueBindImplTest method testAddRemoveConsumer.
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@Test
public void testAddRemoveConsumer() throws Exception {
final long id = RandomUtil.randomLong();
final SimpleString address = RandomUtil.randomSimpleString();
final SimpleString uniqueName = RandomUtil.randomSimpleString();
final SimpleString routingName = RandomUtil.randomSimpleString();
final Long remoteQueueID = RandomUtil.randomLong();
final SimpleString filterString = new SimpleString("A>B");
final Queue storeAndForwardQueue = new FakeQueue(null);
final SimpleString bridgeName = RandomUtil.randomSimpleString();
final int distance = 0;
RemoteQueueBindingImpl binding = new RemoteQueueBindingImpl(id, address, uniqueName, routingName, remoteQueueID, filterString, storeAndForwardQueue, bridgeName, distance);
for (int i = 0; i < 100; i++) {
binding.addConsumer(new SimpleString("B" + i + "<A"));
}
assertEquals(100, binding.getFilters().size());
for (int i = 0; i < 100; i++) {
binding.removeConsumer(new SimpleString("B" + i + "<A"));
}
assertEquals(0, binding.getFilters().size());
}
Aggregations