예제 #1
0
TEST_F(RemoteResourceUnitTest, onCacheCBCalled)
{
    bool isCalled = false;
    mocks.ExpectCallFunc(onCacheCB).Do(
        [this, &isCalled](const RCSResourceAttributes &)
    {
        isCalled = true;
    });
    RemoteResourceUnit::Ptr ptr = m_pRemoteResourceUnit->createRemoteResourceInfoWithCacheCB(
                                      m_pRCSRemoteResourceObject, m_updatedCBFromServer, onCacheCB);
    ptr->startCaching();
    testObject->ChangeAttributeValue();
    EXPECT_TRUE(isCalled);
}
예제 #2
0
void DiscoverResourceUnit::discoverdCB(RCSRemoteResourceObject::Ptr remoteObject, std::string uri)
{
    if (remoteObject && !isAlreadyDiscoveredResource(remoteObject))
    {
        RemoteResourceUnit::Ptr newDiscoveredResource =
            RemoteResourceUnit::createRemoteResourceInfo(remoteObject, pUpdatedCBFromServer);

        if (uri.empty() || uri.compare(remoteObject->getUri()) == 0)
        {
            m_vecRemoteResource.push_back(newDiscoveredResource);
            newDiscoveredResource->startMonitoring();
            newDiscoveredResource->startCaching();
        }
    }
    else
    {
        // Already Discovered Resource
    }
}
예제 #3
0
TEST_F(RemoteResourceUnitTest, startCaching)
{
    RemoteResourceUnit::Ptr ptr = m_pRemoteResourceUnit->createRemoteResourceInfo(
                                      m_pRCSRemoteResourceObject, m_updatedCBFromServer);
    ptr->startCaching();
}