use of org.apache.qpid.proton.engine.Session in project vertx-proton by vert-x3.
the class ProtonDeliveryImplTest method testAttachments.
@Test
public void testAttachments() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Sender s = sess.sender("name");
Delivery d = s.delivery("myTag".getBytes(StandardCharsets.UTF_8));
ProtonDeliveryImpl delivery = new ProtonDeliveryImpl(d);
Record attachments = delivery.attachments();
assertNotNull("Expected attachments but got null", attachments);
assertSame("Got different attachments on subsequent call", attachments, delivery.attachments());
String key = "My-Connection-Key";
assertNull("Expected attachment to be null", attachments.get(key, Connection.class));
attachments.set(key, Connection.class, conn);
assertNotNull("Expected attachment to be returned", attachments.get(key, Connection.class));
assertSame("Expected attachment to be given object", conn, attachments.get(key, Connection.class));
}
use of org.apache.qpid.proton.engine.Session in project vertx-proton by vert-x3.
the class ProtonSenderImplTest method testAttachments.
@Test
public void testAttachments() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Sender s = sess.sender("name");
ProtonSenderImpl sender = new ProtonSenderImpl(s);
Record attachments = sender.attachments();
assertNotNull("Expected attachments but got null", attachments);
assertSame("Got different attachments on subsequent call", attachments, sender.attachments());
String key = "My-Connection-Key";
assertNull("Expected attachment to be null", attachments.get(key, Connection.class));
attachments.set(key, Connection.class, conn);
assertNotNull("Expected attachment to be returned", attachments.get(key, Connection.class));
assertSame("Expected attachment to be given object", conn, attachments.get(key, Connection.class));
}
use of org.apache.qpid.proton.engine.Session in project vertx-proton by vert-x3.
the class ProtonSenderImplTest method testAutoSettleIsEnabledByDefault.
@Test
public void testAutoSettleIsEnabledByDefault() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Sender s = sess.sender("name");
ProtonSenderImpl sender = new ProtonSenderImpl(s);
assertTrue(sender.isAutoSettle());
}
use of org.apache.qpid.proton.engine.Session in project vertx-proton by vert-x3.
the class ProtonSessionImplTest method testAttachments.
@Test
public void testAttachments() {
Connection conn = Connection.Factory.create();
Session s = conn.session();
ProtonSessionImpl session = new ProtonSessionImpl(s);
Record attachments = session.attachments();
assertNotNull("Expected attachments but got null", attachments);
assertSame("Got different attachments on subsequent call", attachments, session.attachments());
String key = "My-Connection-Key";
assertNull("Expected attachment to be null", attachments.get(key, Connection.class));
attachments.set(key, Connection.class, conn);
assertNotNull("Expected attachment to be returned", attachments.get(key, Connection.class));
assertSame("Expected attachment to be given object", conn, attachments.get(key, Connection.class));
}
use of org.apache.qpid.proton.engine.Session in project vertx-proton by vert-x3.
the class ProtonReceiverImplTest method testAttachments.
@Test
public void testAttachments() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Receiver r = sess.receiver("name");
ProtonReceiverImpl receiver = new ProtonReceiverImpl(r);
Record attachments = receiver.attachments();
assertNotNull("Expected attachments but got null", attachments);
assertSame("Got different attachments on subsequent call", attachments, receiver.attachments());
String key = "My-Connection-Key";
assertNull("Expected attachment to be null", attachments.get(key, Connection.class));
attachments.set(key, Connection.class, conn);
assertNotNull("Expected attachment to be returned", attachments.get(key, Connection.class));
assertSame("Expected attachment to be given object", conn, attachments.get(key, Connection.class));
}
Aggregations