| 632 | |
| 633 | template <typename ServerTraits, typename TemplateTraits> |
| 634 | void testSeparateConnections() { |
| 635 | typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State; |
| 636 | |
| 637 | // Start the server |
| 638 | std::shared_ptr<State> state(new State); |
| 639 | ServerThread serverThread(state, true); |
| 640 | |
| 641 | const std::shared_ptr<EventLog>& log = state->getLog(); |
| 642 | |
| 643 | // Create a client |
| 644 | std::shared_ptr<typename State::Client> client1 = state->createClient(); |
| 645 | |
| 646 | // Make sure the expected events were logged |
| 647 | uint32_t client1Id = checkNewConnEvents(log); |
| 648 | |
| 649 | // Create a second client |
| 650 | std::shared_ptr<typename State::Client> client2 = state->createClient(); |
| 651 | |
| 652 | // Make sure the expected events were logged |
| 653 | uint32_t client2Id = checkNewConnEvents(log); |
| 654 | |
| 655 | // The two connections should have different IDs |
| 656 | BOOST_CHECK_NE(client1Id, client2Id); |
| 657 | |
| 658 | // Make a call, and check for the proper events |
| 659 | int32_t value = 5; |
| 660 | client1->setValue(value); |
| 661 | uint32_t call1 |
| 662 | = checkCallEvents(log, client1Id, EventLog::ET_CALL_SET_VALUE, "ChildService.setValue"); |
| 663 | |
| 664 | // Make a call with client2 |
| 665 | int32_t v = client2->getValue(); |
| 666 | BOOST_CHECK_EQUAL(value, v); |
| 667 | checkCallEvents(log, client2Id, EventLog::ET_CALL_GET_VALUE, "ChildService.getValue"); |
| 668 | |
| 669 | // Make another call with client1 |
| 670 | v = client1->getValue(); |
| 671 | BOOST_CHECK_EQUAL(value, v); |
| 672 | uint32_t call2 |
| 673 | = checkCallEvents(log, client1Id, EventLog::ET_CALL_GET_VALUE, "ChildService.getValue"); |
| 674 | BOOST_CHECK_NE(call1, call2); |
| 675 | |
| 676 | // Close the second client, and check for the appropriate events |
| 677 | client2.reset(); |
| 678 | checkCloseEvents(log, client2Id); |
| 679 | } |
| 680 | |
| 681 | template <typename ServerTraits, typename TemplateTraits> |
| 682 | void testOnewayCall() { |
nothing calls this directly
no test coverage detected