comparison UnitTestsSources/ServerIndexTests.cpp @ 1177:5b2d8c280ac2 db-changes

Plugins can monitor changes through callbacks
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 Sep 2014 17:37:44 +0200
parents 1ea4094d077c
children 1169528a9a5f
comparison
equal deleted inserted replaced
1176:f24e04838054 1177:5b2d8c280ac2
80 const std::string fileUuid = info.GetUuid(); 80 const std::string fileUuid = info.GetUuid();
81 deletedFiles_.push_back(fileUuid); 81 deletedFiles_.push_back(fileUuid);
82 LOG(INFO) << "A file must be removed: " << fileUuid; 82 LOG(INFO) << "A file must be removed: " << fileUuid;
83 } 83 }
84 84
85 virtual void SignalResourceDeleted(ResourceType type, 85 virtual void SignalChange(ChangeType changeType,
86 const std::string& publicId) 86 ResourceType resourceType,
87 const std::string& publicId)
87 { 88 {
88 deletedResources_.push_back(publicId); 89 if (changeType == ChangeType_Deleted)
89 LOG(INFO) << "A resource was removed: " << publicId; 90 {
91 deletedResources_.push_back(publicId);
92 }
93
94 LOG(INFO) << "Change related to resource " << publicId << " of type "
95 << EnumerationToString(resourceType) << ": " << EnumerationToString(changeType);
90 } 96 }
91 97
92 }; 98 };
93 99
94 100
95 class DatabaseWrapperTest : public ::testing::TestWithParam<DatabaseWrapperClass> 101 class DatabaseWrapperTest : public ::testing::TestWithParam<DatabaseWrapperClass>
96 { 102 {