use of org.apache.qpid.proton.engine.Connection in project vertx-proton by vert-x3.
the class ProtonReceiverImplTest method testDrainWithoutHandlerThrowsIAE.
@Test
public void testDrainWithoutHandlerThrowsIAE() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Receiver r = sess.receiver("name");
ProtonReceiverImpl receiver = new ProtonReceiverImpl(r);
receiver.setPrefetch(0);
try {
receiver.drain(0, null);
fail("should have thrown due to lack of handler");
} catch (IllegalArgumentException iae) {
// Expected
}
}
use of org.apache.qpid.proton.engine.Connection in project vertx-proton by vert-x3.
the class ProtonReceiverImplTest method testDrainWithoutDisablingPrefetchThrowsISE.
@Test
public void testDrainWithoutDisablingPrefetchThrowsISE() {
Connection conn = Connection.Factory.create();
Session sess = conn.session();
Receiver r = sess.receiver("name");
ProtonReceiverImpl receiver = new ProtonReceiverImpl(r);
try {
receiver.drain(0, h -> {
});
fail("should have thrown due to prefetch still being enabled");
} catch (IllegalStateException ise) {
// Expected
}
}
Aggregations