| 508 | } |
| 509 | |
| 510 | void test_message_timeout_fail() { |
| 511 | // Verify a message arrives intact |
| 512 | record_handler ha, hb; |
| 513 | timed_driver_pair d(duration(2000), ha, hb); |
| 514 | |
| 515 | proton::sender s = d.a.connection().open_sender("x"); |
| 516 | d.process_timed_fail(); |
| 517 | proton::message m("barefoot_timed_fail"); |
| 518 | m.properties().put("x", "y"); |
| 519 | m.message_annotations().put("a", "b"); |
| 520 | s.send(m); |
| 521 | |
| 522 | d.process_timed_fail(); |
| 523 | |
| 524 | ASSERT_THROWS(test::error, |
| 525 | while (hb.messages.size() == 0) { |
| 526 | d.process_timed_fail(); |
| 527 | } |
| 528 | ); |
| 529 | |
| 530 | ASSERT_EQUAL(1u, hb.transport_errors.size()); |
| 531 | ASSERT_EQUAL("amqp:resource-limit-exceeded: local-idle-timeout expired", d.b.transport().error().what()); |
| 532 | ASSERT_EQUAL(1u, ha.connection_errors.size()); |
| 533 | ASSERT_EQUAL("amqp:resource-limit-exceeded: local-idle-timeout expired", d.a.connection().error().what()); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | int main(int argc, char** argv) { |
no test coverage detected