本文整理汇总了C++中SubscriptionRequest::setAttributeName方法的典型用法代码示例。如果您正苦于以下问题:C++ SubscriptionRequest::setAttributeName方法的具体用法?C++ SubscriptionRequest::setAttributeName怎么用?C++ SubscriptionRequest::setAttributeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubscriptionRequest
的用法示例。
在下文中一共展示了SubscriptionRequest::setAttributeName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: semaphore
/**
* Trigger: The dispatcher receives a SubscriptionRequest.
* Expected: The PublicationManager creates a PublisherRunnable and polls
* the MockCaller for the attribute.
*/
TEST_F(SubscriptionTest, receive_subscriptionRequestAndPollAttribute) {
qRegisterMetaType<OnChangeWithKeepAliveSubscriptionQos>("OnChangeWithKeepAliveSubscriptionQos");
qRegisterMetaType<SubscriptionRequest>("SubscriptionRequest");
// Use a semaphore to count and wait on calls to the mockRequestCaller
QSemaphore semaphore(0);
EXPECT_CALL(*mockRequestCaller, getLocation(_, _))
.WillRepeatedly(ReleaseSemaphore(&semaphore));
QString attributeName = "Location";
auto subscriptionQos = QSharedPointer<SubscriptionQos>(new OnChangeWithKeepAliveSubscriptionQos(
80, // validity_ms
100, // minInterval_ms
200, // maxInterval_ms
80 // alertInterval_ms
));
QString subscriptionId = "SubscriptionID";
SubscriptionRequest subscriptionRequest;
subscriptionRequest.setSubscriptionId(subscriptionId);
subscriptionRequest.setAttributeName(attributeName);
subscriptionRequest.setQos(subscriptionQos);
JoynrMessage msg = messageFactory.createSubscriptionRequest(
proxyParticipantId,
providerParticipantId,
qos,
subscriptionRequest);
dispatcher.addRequestCaller(providerParticipantId, mockRequestCaller);
dispatcher.receive(msg, qos);
// Wait for a call to be made to the mockRequestCaller
ASSERT_TRUE(semaphore.tryAcquire(1,1000));
}
示例2: OnChangeSubscriptionQos
TEST_F(JoynrMessageFactoryTest, createSubscriptionRequest){
auto subscriptionQos = QSharedPointer<SubscriptionQos>(new OnChangeSubscriptionQos());
SubscriptionRequest subscriptionRequest;
subscriptionRequest.setSubscriptionId(QString("subscriptionId"));
subscriptionRequest.setAttributeName(QString("attributeName"));
subscriptionRequest.setQos(subscriptionQos);
JoynrMessage joynrMessage = messageFactory.createSubscriptionRequest(
senderID,
receiverID,
qos,
subscriptionRequest
);
checkParticipantIDs(joynrMessage);
EXPECT_QSTREQ(JoynrMessage::VALUE_MESSAGE_TYPE_SUBSCRIPTION_REQUEST, joynrMessage.getType());
}