#include <MappingsTest.h>
Public Member Functions | |
void | runTests () |
Private Member Functions | |
void | testAdd3Contacts () |
void | testMappings () |
void | testPutClientServerInSync () |
void | testLookUpMappings () |
Tests the method SyncManager::lookUpMappings(). |
It means the SyncManager is able to cache the mappings that he has to send to the server until he receives an acknowledge from the server. Then the current cache is deleted. If there is something wrong and the sync is broken, at the next sync the client sends again the mappings cached from previous sync. Summary of the tests: There is a MappingTestSyncSource with doesn't send anything for a slow sync and 3 items for a two-way. There is a listener implementation that throw an exception after 3 items came on the client
testPutClientServerInSync: a refresh-from-client to empty the server and leave 2 client in sync
testAdd3Contacts: the first client adds 3 contacts
testMappings: it uses the testPutClientServerInSync and testAdd3Contacts to create the proper scenario. Then the second client executes a two-way sync. It sends 3 items (due to the SS implementation) and then receives 3 items. At the second, the listener hooked throws an exception to simulate a break. Then, after unregistering the listener, a new sync is performed by the client and the mappings are properly sent. Also the files that takes care of the cache deleting the files
SETTING CONFIGURATION
The first time the test is ran, the config is created using the api factory. Launching the test with CLIENT_TEST_SERVER=funambol CLIENT_TEST_SOURCES=vcard21 make check the default server is localhost with user/pass guest/guest. Set the proper in the .config/funambol_mappings_* (posix) or the windows registry (HKCU/Software).