use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.
the class SessionCreateAndDeleteQueueTest method testTemporaryTrue.
@Test
public void testTemporaryTrue() throws Exception {
ClientSession session = createSessionFactory(locator).createSession(false, true, true);
session.createTemporaryQueue(address, queueName);
Binding binding = server.getPostOffice().getBinding(queueName);
Queue q = (Queue) binding.getBindable();
Assert.assertTrue(q.isTemporary());
session.close();
}
use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.
the class SessionCreateAndDeleteQueueTest method testcreateWithFilter.
@Test
public void testcreateWithFilter() throws Exception {
ClientSession session = createSessionFactory(locator).createSession(false, true, true);
SimpleString filterString = new SimpleString("x=y");
session.createQueue(address, queueName, filterString, false);
Binding binding = server.getPostOffice().getBinding(queueName);
Queue q = (Queue) binding.getBindable();
Assert.assertEquals(q.getFilter().getFilterString(), filterString);
session.close();
}
use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.
the class SessionCreateAndDeleteQueueTest method testDurableFalse.
@Test
public void testDurableFalse() throws Exception {
ClientSession session = createSessionFactory(locator).createSession(false, true, true);
session.createQueue(address, queueName, false);
Binding binding = server.getPostOffice().getBinding(queueName);
Queue q = (Queue) binding.getBindable();
Assert.assertFalse(q.isDurable());
session.close();
}
use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.
the class SessionCreateAndDeleteQueueTest method testAddressSettingUSed.
@Test
public void testAddressSettingUSed() throws Exception {
server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings().setDefaultLastValueQueue(true));
ClientSession session = createSessionFactory(locator).createSession(false, true, true);
SimpleString filterString = new SimpleString("x=y");
session.createQueue(address, queueName, filterString, false);
Binding binding = server.getPostOffice().getBinding(queueName);
Assert.assertTrue(binding.getBindable() instanceof LastValueQueue);
session.close();
}
use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.
the class ActiveMQTestBase method printBindings.
public void printBindings(ActiveMQServer server, String address) throws Exception {
PostOffice po = server.getPostOffice();
Bindings bindings = po.getBindingsForAddress(new SimpleString(address));
System.err.println("=======================================================================");
System.err.println("Binding information for address = " + address + " for server " + server);
for (Binding binding : bindings.getBindings()) {
QueueBinding qBinding = (QueueBinding) binding;
System.err.println("Binding = " + qBinding + ", queue=" + qBinding.getQueue());
}
}
Aggregations