本文整理汇总了C++中JoynrMessage::setHeaderReplyChannelId方法的典型用法代码示例。如果您正苦于以下问题:C++ JoynrMessage::setHeaderReplyChannelId方法的具体用法?C++ JoynrMessage::setHeaderReplyChannelId怎么用?C++ JoynrMessage::setHeaderReplyChannelId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoynrMessage
的用法示例。
在下文中一共展示了JoynrMessage::setHeaderReplyChannelId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transmit
TEST_F(MessagingTest, routeMsgToHttpCommunicationMgr)
{
JoynrMessage message = messageFactory.createRequest(
senderId,
receiverId,
qos,
request);
message.setHeaderReplyChannelId(senderChannelId);
// InProcessMessagingSkeleton should not receive the message
EXPECT_CALL(*inProcessMessagingSkeleton, transmit(Eq(message)))
.Times(0);
// HttpCommunicationManager should receive the message
EXPECT_CALL(*mockMessageSender, sendMessage(Eq(receiverChannelId),Eq(message)))
.Times(1).WillRepeatedly(ReleaseSemaphore(&semaphore));
std::shared_ptr<system::RoutingTypes::ChannelAddress> joynrMessagingEndpointAddr =
std::shared_ptr<system::RoutingTypes::ChannelAddress>(new system::RoutingTypes::ChannelAddress());
joynrMessagingEndpointAddr->setChannelId(receiverChannelId);
messageRouter->addNextHop(receiverId, joynrMessagingEndpointAddr);
messageRouter->route(message);
WaitXTimes(1);
}
示例2: InProcessMessagingAddress
TEST_F(MessagingTest, routeMultipleMessages)
{
JoynrMessage message = messageFactory.createRequest(
senderId,
receiverId,
qos,
request);
message.setHeaderReplyChannelId(senderChannelId);
std::string receiverId2("receiverId2");
JoynrMessage message2 = messageFactory.createRequest(
senderId,
receiverId2,
qos,
request);
message2.setHeaderReplyChannelId(senderChannelId);
// InProcessMessagingSkeleton should receive the message2 and message3
EXPECT_CALL(*inProcessMessagingSkeleton, transmit(Eq(message2)))
.Times(2).WillRepeatedly(ReleaseSemaphore(&semaphore));
// MessageSender should receive the message
EXPECT_CALL(*mockMessageSender, sendMessage(Eq(receiverChannelId), Eq(message)))
.Times(1).WillRepeatedly(ReleaseSemaphore(&semaphore));
EXPECT_CALL(*mockMessageReceiver, getReceiveChannelId())
// .WillOnce(ReturnRefOfCopy(senderChannelId));
.WillRepeatedly(ReturnRefOfCopy(senderChannelId));
std::shared_ptr<InProcessMessagingAddress> messagingSkeletonEndpointAddr(
new InProcessMessagingAddress(inProcessMessagingSkeleton)
);
messageRouter->addNextHop(receiverId2, messagingSkeletonEndpointAddr);
std::shared_ptr<system::RoutingTypes::ChannelAddress> joynrMessagingEndpointAddr =
std::shared_ptr<system::RoutingTypes::ChannelAddress>(new system::RoutingTypes::ChannelAddress());
joynrMessagingEndpointAddr->setChannelId(receiverChannelId);
messageRouter->addNextHop(receiverId, joynrMessagingEndpointAddr);
messageRouter->route(message);
messageRouter->route(message2);
messageRouter->route(message2);
WaitXTimes(3);
}