Search in sources :

Example 11 with Role

use of org.apache.qpid.server.protocol.v1_0.type.transport.Role in project qpid-broker-j by apache.

the class Session_1_0Test method assertAttachSent.

private void assertAttachSent(final AMQPConnection_1_0 connection, final Session_1_0 session, final Attach receivedAttach, final int invocationOffset) {
    Attach sentAttach = captureAttach(connection, session, invocationOffset);
    assertEquals("Unexpected name", receivedAttach.getName(), sentAttach.getName());
    assertEquals("Unexpected role", Role.SENDER, sentAttach.getRole());
}
Also used : Attach(org.apache.qpid.server.protocol.v1_0.type.transport.Attach)

Example 12 with Role

use of org.apache.qpid.server.protocol.v1_0.type.transport.Role in project qpid-broker-j by apache.

the class Session_1_0Test method testReceiveAttachTopicNonDurableNoContainerWithValidSelector.

@Test
public void testReceiveAttachTopicNonDurableNoContainerWithValidSelector() throws Exception {
    final String linkName = "testLink";
    final String address = "amq.direct/" + TOPIC_NAME;
    final String selectorExpression = "test='test'";
    Attach attach = createTopicAttach(false, linkName, address, true);
    setSelector(attach, selectorExpression);
    _session.receiveAttach(attach);
    Attach sentAttach = captureAttach(_connection, _session, 0);
    assertEquals("Unexpected name", attach.getName(), sentAttach.getName());
    assertEquals("Unexpected role", Role.SENDER, sentAttach.getRole());
    assertFilter(sentAttach, selectorExpression);
    assertQueues(TOPIC_NAME, LifetimePolicy.DELETE_ON_NO_OUTBOUND_LINKS);
    Binding binding = findBinding("amq.direct", TOPIC_NAME);
    assertNotNull("Binding is not found", binding);
    Map<String, Object> arguments = binding.getArguments();
    assertNotNull("Unexpected arguments", arguments);
    assertEquals("Unexpected filter on binding", selectorExpression, arguments.get(AMQPFilterTypes.JMS_SELECTOR.toString()));
}
Also used : Binding(org.apache.qpid.server.model.Binding) Attach(org.apache.qpid.server.protocol.v1_0.type.transport.Attach) Test(org.junit.Test)

Aggregations

Attach (org.apache.qpid.server.protocol.v1_0.type.transport.Attach)5 DeliveryRegistry (org.apache.qpid.server.protocol.v1_0.delivery.DeliveryRegistry)4 UnsignedInteger (org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger)4 Role (org.apache.qpid.server.protocol.v1_0.type.transport.Role)4 FrameBody (org.apache.qpid.server.protocol.v1_0.type.FrameBody)3 Source (org.apache.qpid.server.protocol.v1_0.type.messaging.Source)3 Queue (org.apache.qpid.server.model.Queue)2 Target (org.apache.qpid.server.protocol.v1_0.type.messaging.Target)2 StoreException (org.apache.qpid.server.store.StoreException)2 Test (org.junit.Test)2 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 Statement (java.sql.Statement)1 ArrayList (java.util.ArrayList)1 Binding (org.apache.qpid.server.model.Binding)1 LinkDefinition (org.apache.qpid.server.protocol.v1_0.LinkDefinition)1 LinkKey (org.apache.qpid.server.protocol.v1_0.LinkKey)1 UnsettledDelivery (org.apache.qpid.server.protocol.v1_0.delivery.UnsettledDelivery)1 BaseSource (org.apache.qpid.server.protocol.v1_0.type.BaseSource)1